Skip to content

Commit

Permalink
Merge pull request #3 from armazac/0.4
Browse files Browse the repository at this point in the history
0.4 release
  • Loading branch information
armazac authored Aug 20, 2016
2 parents def57bb + f23de84 commit 297180f
Show file tree
Hide file tree
Showing 72 changed files with 3,300 additions and 978 deletions.
14 changes: 0 additions & 14 deletions AI/civilian.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ _unit addEventHandler ["FiredNear", {
_u disableAI "fsm";
}];

_unit addEventHandler ["HandleDamage", {
_me = _this select 0;
_dmg = _this select 2;
_src = _this select 3;
_proj = _this select 4;
_veh = vehicle _src;
if(_veh != _src) then {
if((driver _veh) == _src) then {
_dmg = 0;
};
};
_dmg;
}];

while {alive _unit} do {
_s = _unit getVariable ["scared",-1];
if(_s > -1) then {
Expand Down
1 change: 1 addition & 0 deletions AI/militaryPatrol.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _group = _this;


_start = getpos ((units _group) select 0);
if(isNil "_start") exitWith {};

_wp = _group addWaypoint [getpos (nearestbuilding _start),75];
_wp setWaypointType "GUARD";
Expand Down
117 changes: 117 additions & 0 deletions AI/orders/loot.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
_sorted = [];

if(vehicle player != player) then {
_sorted = [vehicle player];
}else{
_objects = player nearEntities [["LandVehicle",AIT_item_Storage],20];
if(count _objects == 0) exitWith {
"Cannot find any containers or vehicles within 20m of you" call notify_minor;
};
_sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
};

if(count _sorted == 0) exitWith {};
_target = _sorted select 0;

format["Units will loot any dead bodies within 80m into this %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor;

_deadguys = [];
{
if !((_x distance player > 80) or (alive _x) or (_x getVariable ["looted",false])) then {
_deadguys pushback _x;
};
}foreach(entities "Man");

{
[_x,_target,_deadguys] spawn {
_wasincar = false;
_car = objNull;

_unit = _this select 0;

if((vehicle _unit) != _unit) then {
_car = (vehicle _unit);
doGetOut _unit;
_wasincar = true;
};

_t = _this select 1;
_deadguys = _this select 2;

_unit doMove getpos _t;

_timeout = time + 120;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 2) or (_timeOut < time) or (unitReady _unit)};
if(!alive _unit or (isNull _t) or (_timeOut < time)) exitWith {};

[_unit,_t] call dumpStuff;

while {true} do {
_timeout = time + 120;
_got = false;
_deadguy = objNull;
{
if !(_x getVariable ["looted",false]) exitWith {
_deadguy = _x;
_got = true;
};
}foreach(_deadguys);
if(!_got) exitWith {_unit globalChat "All done sir!"};
_deadguy setVariable ["looted",true,true];

_unit doMove getpos _deadguy;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 2) or (_timeOut < time) or (unitReady _unit)};
if((!alive _unit) or (_timeOut < time)) exitWith {hint "0"};

[_deadguy,_unit] call takeStuff;
[_deadguy] spawn {
sleep 600;
_n = _this select 0;
if!(isNil "_n") then {
deleteVehicle (_this select 0);
}
};
sleep 2;
if(primaryWeapon _unit == "") then {
_weapon = objNull;
{
if !(_x getVariable ["looted",false]) exitWith {
_weapon = _x;
_weapon setVariable ["looted",true,true];
};
}foreach(_unit nearentities ["WeaponHolderSimulated",30]);
if !(isNull _weapon) then {
_unit doMove getpos _weapon;
waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 2) or (_timeOut < time) or (unitReady _unit)};
if(alive _unit and (_timeOut > time)) then {
_s = (weaponsItems _weapon) select 0;

_unit addWeapon (_s select 0);
_i = _s select 1;
if(_i != "") then {_unit addPrimaryWeaponItem _i};
_i = _s select 2;
if(_i != "") then {_unit addPrimaryWeaponItem _i};
_i = _s select 3;
if(_i != "") then {_unit addPrimaryWeaponItem _i};
deleteVehicle _weapon;
sleep 1;
};
};
};
if(!alive _unit) exitWith {hint "1"};
_timeout = time + 120;
_unit doMove getpos _t;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 2) or (_timeOut < time) or (unitReady _unit)};
if((!alive _unit) or (_timeOut < time)) exitWith {hint "2"};

[_unit,_t] call dumpStuff;
sleep 1;
};

if(_wasincar) then {
_unit assignAsCargo _car;
[_unit] orderGetIn true;
};
};
sleep 0.1;
}foreach(groupSelectedUnits player);
30 changes: 30 additions & 0 deletions AI/orders/openInventory.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
_sorted = [];

if((vehicle player) != player) then {
_sorted = [vehicle player];
}else{
_objects = player nearEntities [["LandVehicle",AIT_item_Storage],20];
if(count _objects == 0) exitWith {
"Cannot find any containers or vehicles within 20m of you" call notify_minor;
};
_sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
};

if(count _sorted == 0) exitWith {};

_target = _sorted select 0;

_unit = (groupSelectedUnits player) select 0;

_unit groupChat format["Opening %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName];
if(((vehicle _unit) != _unit) and (vehicle _unit) != _target) then {
doGetOut _unit;
};
if(vehicle _unit != _target) then {
_unit doMove getpos _target;
waitUntil {sleep 1;!alive _unit or unitReady _unit};
};

if(alive _unit) then {
_unit action ["Gear",_target];
};
17 changes: 17 additions & 0 deletions AI/recruit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
private ["_civ"];

_civ = _this select 0;

removeAllActions _civ;
_civ removeAllEventHandlers "FiredNear";

_civ setSkill 1.0;
_civ setRank "PRIVATE";

_civ spawn wantedSystem;

_recruits = server getVariable ["recruits",[]];
_nameparts = (name _civ) splitString " ";

_recruits pushback [getplayeruid player,[name _civ]+_nameparts,_civ,"PRIVATE",[],typeof _civ];
server setVariable ["recruits",_recruits,true];
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ Will you decide to overthrow the occupying NATO forces using brains.. or brawn?
* GTA-inspired wanted/stealth system
* Dynamic political system with regional stability affecting presence of 2 different opposing factions to the player (NATO and criminal elements)
* Buy and sell just about in any-game item/vehicle/weapon for currency at local shops and gun dealers
* Capture towns and military objectives, island by island
* Dynamic economy/Regional pricing/Trade
* Buy real estate
* Fast travel to any owned real estate
* Recruit and arm civilians
* Buy, sell and lease real estate with prices affected by regional politics
* Fast travel to any owned real estate or camp
* Manipulate the markets with guns or piles of cash
* Recruit and arm civilians with easy to use commands, dont fiddle with scroll menus for 5 mins to tell them to pick up a gun
* Recruit civilians simply just to loot for you
* Designed to work in both single player and multiplayer
* Committed to creating a living and breathing Tanoa where anything can happen

# Coming Features
* Recruit and command entire squads
* Player-based economy/production
* Mid and end-game mechanics

# Required DLC
* APEX

Expand Down
Loading

0 comments on commit 297180f

Please sign in to comment.