diff --git a/AI/civilian.sqf b/AI/civilian.sqf
index 6e99efcf..1214b133 100644
--- a/AI/civilian.sqf
+++ b/AI/civilian.sqf
@@ -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 {
diff --git a/AI/militaryPatrol.sqf b/AI/militaryPatrol.sqf
index 8db03356..6c06dca8 100644
--- a/AI/militaryPatrol.sqf
+++ b/AI/militaryPatrol.sqf
@@ -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";
diff --git a/AI/orders/loot.sqf b/AI/orders/loot.sqf
new file mode 100644
index 00000000..c97615e6
--- /dev/null
+++ b/AI/orders/loot.sqf
@@ -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);
\ No newline at end of file
diff --git a/AI/orders/openInventory.sqf b/AI/orders/openInventory.sqf
new file mode 100644
index 00000000..98cd8294
--- /dev/null
+++ b/AI/orders/openInventory.sqf
@@ -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];
+};
\ No newline at end of file
diff --git a/AI/recruit.sqf b/AI/recruit.sqf
new file mode 100644
index 00000000..e6808ab0
--- /dev/null
+++ b/AI/recruit.sqf
@@ -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];
\ No newline at end of file
diff --git a/README.md b/README.md
index 819f62d5..71208335 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/UI/buildMenu.sqf b/UI/buildMenu.sqf
new file mode 100644
index 00000000..db7c5415
--- /dev/null
+++ b/UI/buildMenu.sqf
@@ -0,0 +1,375 @@
+if !(captive player) exitWith {"You cannot build while wanted" call notify_minor};
+_base = (getpos player) call nearestBase;
+_closest = "";
+_isbase = false;
+_isobj = false;
+_center = getpos player;
+modeMax = 350;
+if !(isNil "_base") then {
+ if((_base select 0) distance player < 120) then {
+ _closest = _base select 1;
+ _center = _base select 0;
+ _isbase = true;
+ modeMax = 100;
+ };
+};
+
+if(!_isBase) then {
+ _obj = (getpos player) call nearestObjective;
+ _objpos = _obj select 0;
+
+ _town = (getpos player) call nearestTown;
+ _townpos = server getVariable _town;
+
+ _closest = _town;
+ _center = _townpos;
+ if((_objpos distance player) < (_townpos distance player)) then {
+ _closest = _obj select 1;
+ _isobj = true;
+ _center = _objpos;
+ }else{
+ if(_town in AIT_capitals) then {
+ modeMax = 750;
+ };
+ };
+};
+
+
+
+if ((!_isbase) and !(_closest in (server getVariable ["NATOabandoned",[]]))) exitWith {
+ if(_isobj) then {
+ format ["NATO does not allow construction this close to %1.",_closest] call notify_minor;
+ }else{
+ format ["NATO is currently not allowing any construction in %1",_closest] call notify_minor;
+ };
+};
+
+openMap false;
+
+_campos = [(_center select 0)+35,(_center select 1)+35,(_center select 2)+70];
+_start = [position player select 0, position player select 1, 2];
+buildcam = "camera" camCreate _start;
+buildFocus = createVehicle ["Sign_Sphere10cm_F", [_start,1000,getDir player] call BIS_fnc_relPos, [], 0, "NONE"];
+buildFocus setObjectTexture [0,"dialogs\clear.paa"];
+
+buildcam camSetTarget buildFocus;
+buildcam cameraEffect ["internal", "BACK"];
+buildcam camCommit 0;
+showCinemaBorder false;
+waitUntil {camCommitted buildcam};
+
+buildFocus setPos _center;
+buildcam camSetTarget buildFocus;
+buildcam camSetPos _campos;
+buildcam camCommit 2;
+waitUntil {camCommitted buildcam};
+
+modeFinished = false;
+modeCancelled = false;
+
+cancelBuild = {
+ modeCancelled = true;
+};
+modeValue = [0,0,0];
+
+buildCamMoving = false;
+buildCamRotating = false;
+canBuildHere = false;
+
+modeCenter = _center;
+
+buildOnMouseMove = {
+ _relX = _this select 1;
+ _relY = _this select 2;
+ modeValue = screenToWorld getMousePosition;
+ if(!isNull modeTarget) then {
+ modeTarget setPos modeValue;
+ modeVisual setPos modeValue;
+ modeVisual setVectorDirAndUp [[0,0,-1],[0,1,0]];
+
+ if(modeMode == 0) then {
+ if(surfaceIsWater modeValue or (modeTarget distance modeCenter > modeMax) or ({!(_x isKindOf "Man") and (typeof _x != AIT_item_Flag) and !(_x == modeTarget) and !(_x == modeVisual)} count(nearestObjects [modeTarget,[],15]) > 0)) then {
+ if (canBuildHere) then {
+ canBuildHere = false;
+ modeVisual setObjectTexture [0,'#(argb,8,8,3)color(1,0,0,0.5)'];
+ }
+ }else{
+ if !(canBuildHere) then {
+ canBuildHere = true;
+ modeVisual setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,0.5)'];
+ }
+ };
+ }else{
+ if(surfaceIsWater modeValue or (modeTarget distance modeCenter > modeMax)) then {
+ if (canBuildHere) then {
+ canBuildHere = false;
+ modeVisual setObjectTexture [0,'#(argb,8,8,3)color(1,0,0,0.5)'];
+ }
+ }else{
+ if !(canBuildHere) then {
+ canBuildHere = true;
+ modeVisual setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,0.5)'];
+ }
+ };
+ };
+ };
+ if(buildCamRotating and buildCamMoving) exitWith {
+ _pos = getpos buildcam;
+ buildcam camSetPos [(_pos select 0)+_relX,(_pos select 1)+_relY,(_pos select 2)];
+ buildcam camSetTarget buildFocus;
+ buildcam camCommit 0;
+ };
+ if(buildCamMoving) exitWith {
+ _pos = getpos buildcam;
+ buildcam camSetPos [(_pos select 0)+_relX,(_pos select 1)-_relY,(_pos select 2)];
+ _pos = getpos buildFocus;
+ buildFocus setPos [(_pos select 0)+_relX,(_pos select 1)-_relY,_pos select 2];
+ buildcam camSetTarget buildFocus;
+ buildcam camCommit 0;
+ };
+
+};
+
+buildMoveCam = {
+ _relX = _this select 0;
+ _relY = _this select 1;
+ _relZ = _this select 2;
+
+ _pos = getpos buildcam;
+ buildcam camSetPos [(_pos select 0)+_relX,(_pos select 1)-_relY,(_pos select 2)+_relZ];
+ _pos = getpos buildFocus;
+ buildFocus setPos [(_pos select 0)+_relX,(_pos select 1)-_relY,(_pos select 2)+_relZ];
+ buildcam camSetTarget buildFocus;
+ buildcam camCommit 0;
+};
+
+buildOnKeyUp = {
+ if(_this select 2) then {
+ buildCamRotating = false;
+ };
+};
+
+buildOnKeyDown = {
+ _key = _this select 1;
+ _handled = false;
+ if(_this select 2) then {
+ buildCamRotating = true;
+ };
+ call {
+ if (_key == 17) exitWith {
+ //W
+ _handled = true;
+ _rel = [[0,0,0],2,(getDir buildCam)+90] call BIS_fnc_relPos;
+ _rel call buildMoveCam;
+ };
+ if (_key == 31) exitWith {
+ //S
+ _handled = true;
+ _rel = [[0,0,0],-2,(getDir buildCam)+90] call BIS_fnc_relPos;
+ _rel call buildMoveCam;
+ };
+ if (_key == 30) exitWith {
+ //A
+ _handled = true;
+ _rel = [[0,0,0],-2,(getDir buildCam)] call BIS_fnc_relPos;
+ _rel call buildMoveCam;
+ };
+ if (_key == 32) exitWith {
+ //D
+ _handled = true;
+ _rel = [[0,0,0],2,(getDir buildCam)] call BIS_fnc_relPos;
+ _rel call buildMoveCam;
+ };
+
+ if(isNull modeTarget) exitWith {};
+ _dir = getDir modeTarget;
+
+ if(_key == 57 and modeMode == 1) exitWith {
+ //Space
+ _handled = true;
+ deleteVehicle modeTarget;
+ modeIndex = modeIndex + 1;
+ if(modeIndex > ((count modeValues)-1)) then {modeIndex = 0};
+
+ _cls = modeValues select modeIndex;
+
+ modeTarget = createVehicle [_cls, modeValue, [], 0, "CAN_COLLIDE"];
+ modeTarget remoteExec ["enableSimulationGlobal false",2];
+ modeTarget setDir _dir;
+ };
+ _amt = 5;
+ if(_this select 2) then {
+ _amt = 1;
+ };
+ if (_key == 16) exitWith {
+ //Q
+ _handled = true;
+ _newdir = _dir - _amt;
+ if(_newdir < 0) then {_newdir = 359};
+ modeTarget setDir (_newdir);
+ };
+ if (_key == 18) exitWith {
+ //E
+ _handled = true;
+ _newdir = _dir + _amt;
+ if(_newdir > 359) then {_newdir = 0};
+ modeTarget setDir (_newdir);
+ };
+ };
+ _handled
+};
+
+buildOnMouseDown = {
+ _btn = _this select 1;
+ if(_btn == 1) then {
+ buildCamMoving = true;
+ };
+};
+
+buildOnMouseUp = {
+ _btn = _this select 1;
+ _sx = _this select 2;
+ if(_btn == 1) then {
+ buildCamMoving = false;
+ };
+ if(_btn == 2) then {
+ buildCamRotating = false;
+ };
+ if(_btn == 0 and _sx > (safezoneX + (0.1 * safezoneW))) then {
+ //Click LMB
+ if(!isNull modeTarget and canBuildHere) then {
+ _money = player getVariable "money";
+ if(_money < modePrice) then {
+ "You cannot afford that" call notify_minor;
+ }else{
+ player setVariable ["money",_money-modePrice,true];
+
+ if(modeMode == 0) then {
+ _objects = [modeValue,getDir modeTarget,modeValues] call BIS_fnc_objectsMapper;
+ {
+ clearWeaponCargoGlobal _x;
+ clearMagazineCargoGlobal _x;
+ clearBackpackCargoGlobal _x;
+ clearItemCargoGlobal _x;
+ _x setVariable ["owner",getplayeruid player,true];
+ _x call initObjectLocal;
+ }foreach(_objects);
+ }else{
+ _cls = typeof modeTarget;
+ _o = createVehicle [_cls, modeValue, [], 0, "CAN_COLLIDE"];
+ _o setDir (getDir modeTarget);
+ _o setVariable ["owner",getplayeruid player,true];
+ };
+ };
+ deleteVehicle modeTarget;
+ deleteVehicle modeVisual;
+ };
+ if(!isNull modeTarget and !canBuildHere) then {
+ "You cannot build that there" call notify_minor;
+ };
+ };
+};
+
+buildOnMouseWheel = {
+ _z = _this select 1;
+ _pos = position buildcam;
+
+ if(_z < 0) then {
+ if((_pos select 2) < 30) exitWith {
+ buildcam camSetPos [(_pos select 0),(_pos select 1),(_pos select 2)+5];
+ };
+ if((_pos select 2) < 200) exitWith {
+ buildcam camSetPos [(_pos select 0),(_pos select 1),(_pos select 2)+20];
+ };
+ }else{
+ if((_pos select 2) > 30) exitWith {
+ buildcam camSetPos [(_pos select 0),(_pos select 1),(_pos select 2)-20];
+ };
+ if((_pos select 2) > 10) exitWith {
+ buildcam camSetPos [(_pos select 0),(_pos select 1),(_pos select 2)-5];
+ };
+ };
+ buildcam camSetTarget buildFocus;
+ buildCam camCommit 0.1;
+};
+
+modeTarget = objNull;
+modeValues = [];
+modeMode = 0;
+modePrice = 0;
+modeSelected = "";
+modeVisual = objNull;
+modeIndex = 0;
+
+build = {
+ canBuildHere = false;
+ modeSelected = _this;
+ _def = [];
+ {
+ if((_x select 0) == modeSelected) exitWith {_def = _x};
+ }foreach(AIT_Buildables_Base);
+ modeIndex = 0;
+ _name = _def select 0;
+ _description = _def select 5;
+ modeCode = compile preprocessFileLineNumbers (_def select 3);
+ modeValues = _def select 2;
+ modePrice = _def select 1;
+ _isTemplate = _def select 4;
+ _buildcls = "";
+ if(_isTemplate) then {
+ modeMode = 0;
+ _buildcls = (modeValues select 0) select 0;
+ }else{
+ modeMode = 1;
+ _buildcls = modeValues select modeIndex;
+ };
+
+ if(!isNull modeTarget) then {
+ deleteVehicle modeTarget;
+ deleteVehicle modeVisual;
+ };
+ modeTarget = createVehicle [_buildcls,modeValue,[],0,"CAN_COLLIDE"];
+ modeVisual = createVehicle ["Sign_Circle_F",modeValue,[],0,"CAN_COLLIDE"];
+ {
+ modeTarget disableCollisionWith _x;
+ modeVisual disableCollisionWith _x;
+ }foreach(vehicles + allUnits);
+
+ modeVisual setVectorDirAndUp [[0,0,-1],[0,1,0]];
+ modeVisual setObjectTexture [0,'#(argb,8,8,3)color(1,0,0,0.5)'];
+ modeTarget remoteExec ["enableSimulationGlobal false",2];
+ modeTarget enableSimulation false;
+ modeVisual allowDamage false;
+ modeTarget setMass 0;
+ modeVisual setMass 0;
+ modeTarget setDir (getDir buildCam);
+ modeTarget allowDamage false;
+
+ _txt = format ["%1
$%2
%3
Q,E = Rotate (Shift for smaller)
Space = Change Type
Left Click = Build It
Right Click = Move Camera
Mouse Wheel = Zoom",_name,[modePrice, 1, 0, true] call CBA_fnc_formatNumber,_description];
+ [_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
+};
+
+createDialog "AIT_dialog_buildbase";
+
+waitUntil {sleep 1;modeFinished or modeCancelled or !dialog};
+
+if(!isNull modeTarget) then {
+ deleteVehicle modeTarget;
+ deleteVehicle modeVisual;
+};
+
+deleteVehicle buildFocus;
+
+closeDialog 0;
+buildcam cameraEffect ["Terminate", "BACK" ];
+buildcam = nil;
+
+modeTarget = nil;
+modeCancelled = nil;
+modeFinished = nil;
+modeValue = nil;
+modeValues = nil;
+modeSelected = nil;
+modeMode = nil;
+modeCode = nil;
+
diff --git a/UI/mainMenu.sqf b/UI/mainMenu.sqf
new file mode 100644
index 00000000..6bffd65d
--- /dev/null
+++ b/UI/mainMenu.sqf
@@ -0,0 +1,165 @@
+
+
+closedialog 0;
+createDialog "AIT_dialog_main";
+openMap false;
+disableSerialization;
+_buildingtextctrl = (findDisplay 8001) displayCtrl 1102;
+
+_town = (getpos player) call nearestTown;
+_standing = player getVariable format['rep%1',_town];
+
+_weather = "Clear";
+if(overcast > 0.4) then {
+ _weather = "Cloudy";
+};
+if(rain > 0) then {
+ _weather = "Rain";
+};
+if(rain > 0.9) then {
+ _weather = "Storm";
+};
+
+_ctrl = (findDisplay 8001) displayCtrl 1100;
+_standing = player getVariable format["rep%1",_town];
+_plusmin = "";
+if(_standing > -1) then {_plusmin = "+"};
+
+_ctrl ctrlSetStructuredText parseText format["
+ %1
+ %2 (%3%4)
+ Weather: %5
+ Forecast: %6
+",name player,_town,_plusmin,_standing,_weather,server getVariable "forecast"];
+
+sleep 0.1;
+//Nearest building info
+_b = player call getNearestRealEstate;
+_buildingTxt = "";
+
+if(typename _b == "ARRAY") then {
+ _building = _b select 0;
+ _price = _b select 1;
+ _sell = _b select 2;
+ _lease = _b select 3;
+ _totaloccupants = _b select 4;
+
+ _cls = typeof _building;
+ _name = _cls call ISSE_Cfg_Vehicle_GetName;
+ _pic = getText(configFile >> "CfgVehicles" >> _cls >> "editorPreview");
+
+ if !(isNil "_pic") then {
+ ctrlSetText [1201,_pic];
+ };
+ _txt = "";
+
+ if(_building call hasOwner) then {
+ _owner = _building getVariable "owner";
+ _ownername = server getVariable format["name%1",_owner];
+
+ if(_owner == getplayerUID player) then {
+ if(typeof _building == AIT_item_Tent) exitWith {
+ ctrlSetText [1608,"Sell"];
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+
+ _buildingTxt = format["
+ Camp
+ Owned by %1
+ ",_ownername];
+ };
+ if(typeof _building == AIT_item_Flag) exitWith {
+ ctrlSetText [1608,"Sell"];
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+
+ _buildingTxt = format["
+ %1
+ Owned by %2
+ ",_building getVariable "name",_ownername];
+ };
+ ctrlSetText [1608,format["Sell ($%1)",[_sell, 1, 0, true] call CBA_fnc_formatNumber]];
+
+ _buildingTxt = format["
+ %1
+ Owned by %2
+ Lease Value: $%3/hr
+ ",_name,_ownername,[_lease, 1, 0, true] call CBA_fnc_formatNumber];
+
+ }else{
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+ if(typeof _building == AIT_item_Tent) then {
+ _name = "Camp";
+ };
+ if(typeof _building == AIT_item_Flag) then {
+ _name = _building getVariable "name";
+ };
+ _buildingTxt = format["
+ %1
+ Owned by %2
+ ",_name,_ownername];
+ };
+ }else{
+ ctrlSetText [1608,format["Buy ($%1)",[_price, 1, 0, true] call CBA_fnc_formatNumber]];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+ _buildingTxt = format["
+ %1
+ Capacity: %2
+ Lease Value: $%3/hr
+ ",_name,_totaloccupants,[_lease, 1, 0, true] call CBA_fnc_formatNumber];
+ };
+}else{
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+};
+
+
+_buildingtextctrl ctrlSetStructuredText parseText _buildingTxt;
+
+
+//Nearest Civ info
+_civs = player nearEntities ["Man", 10];
+_possible = [];
+_civTxt = "";
+_civtxtctrl = (findDisplay 8001) displayCtrl 1101;
+{
+ if !(_x call hasOwner or _x == player or side _x == west or side _x == east) then {
+ //"self" returns true ie for shopkeepers, so double check this civ has no owner
+ _owner = _x getVariable "owner";
+ if(isNil "_owner") then {
+ _possible pushBack _x;
+ };
+
+ };
+}foreach(_civs);
+
+if(count _possible > 0) then {
+ _possible = [_possible,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
+ _civ = _possible select 0;
+
+ _cls = typeof _civ;
+
+ _name = name _civ;
+
+ player setVariable ["hiringciv",_civ,false];
+
+ _civprice = [_town,"CIV",_standing] call getPrice;
+
+ ctrlSetText [1605,format["Recruit ($%1)",[_civprice, 1, 0, true] call CBA_fnc_formatNumber]];
+
+ _civTxt = format["
+ %1
+ ",_name];
+}else{
+ ctrlEnable [1605,false];
+ ctrlEnable [1606,false];
+ ctrlEnable [1607,false];
+};
+
+_civtxtctrl ctrlSetStructuredText parseText _civTxt;
\ No newline at end of file
diff --git a/UI/manageRecruits.sqf b/UI/manageRecruits.sqf
new file mode 100644
index 00000000..56b477b5
--- /dev/null
+++ b/UI/manageRecruits.sqf
@@ -0,0 +1,45 @@
+closedialog 0;
+createDialog "AIT_dialog_recruits";
+openMap false;
+
+
+
+ctrlEnable [1600,false];
+
+
+refreshRecruits = {
+ lbClear 1500;
+ _t = 1;
+ {
+ if !(isPlayer _x) then {
+ _idx = lbadd [1500,format["%1. %2 (%3)",_t,name _x,rank _x]];
+ lbSetValue [1500,_idx,_t];
+ };
+ _t = _t + 1;
+ }foreach(units(group player));
+};
+
+recruitSelected = {
+ ctrlEnable [1600,true];
+ _recruit = (units group player) select (lbValue[1500,lbCurSel 1500]-1);
+ _town = (getpos _recruit) call nearestTown;
+ disableSerialization;
+ _ctrl = (findDisplay 8004) displayCtrl 1100;
+ _ctrl ctrlSetStructuredText parseText format["
+ %1
+ Currently In %2
+ Rank: %3
+ ",name _recruit,_town,rank _recruit];
+};
+
+dismissRecruit = {
+ _recruit = (units group player) select (lbValue[1500,lbCurSel 1500]-1);
+ deleteVehicle _recruit;
+ ctrlEnable [1600,false];
+ [] call refreshRecruits;
+ disableSerialization;
+ _ctrl = (findDisplay 8004) displayCtrl 1100;
+ _ctrl ctrlSetStructuredText parseText "";
+};
+
+[] call refreshRecruits;
\ No newline at end of file
diff --git a/VCOMAI/functions/VCOMAI_DefaultSettings.sqf b/VCOMAI/functions/VCOMAI_DefaultSettings.sqf
index 3566aa7c..5c64d817 100644
--- a/VCOMAI/functions/VCOMAI_DefaultSettings.sqf
+++ b/VCOMAI/functions/VCOMAI_DefaultSettings.sqf
@@ -9,7 +9,7 @@ VCOM_AIDEBUG = 0;
//Turn on map markers that track AI movement
VCOM_UseMarkers = false;
//Turns off VCOMAI for AI units in a players squad
-NOAI_FOR_PLAYERLEADERS = 1;
+NOAI_FOR_PLAYERLEADERS = 0;
//Will AI garrison static weapons nearby?
VCOM_STATICGARRISON = 1;
//How far can the AI hear gunshots from?
@@ -30,7 +30,7 @@ VCOM_MineLayChance = 40;
//The longer an AI's target stays in 1 location, the more accurate and aware of the target the AI becomes.DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_IncreasingAccuracy = true;
//VCOM_SideBasedMovement- Remove sides from the array below to force that specific AI side to not execute any advance movement code. (I.E. Moving to reinforce allies, being alerted by distant gunshots and etc). AI with this will still react normally in combat. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
-VCOM_SideBasedMovement = [WEST,EAST,RESISTANCE];
+VCOM_SideBasedMovement = [WEST,EAST];
//VCOM_SideBasedExecution- Remove sides from the array below to remove that specific AI side from executing any of the VCOMAI scripts at all. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_SideBasedExecution = [WEST,EAST,RESISTANCE];
//Distance AI will respond to call of help from each other
@@ -77,7 +77,7 @@ _Unit setSkill ["reloadSpeed",(0.3 + (random 0.3))];
AccuracyFunctionRank4 = {
_Unit = _this select 0;
-_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.3))];
+_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.5))];
_Unit setSkill ["aimingShake",(0.4 + (random 0.1))];
_Unit setSkill ["spotDistance",0.9];
_Unit setSkill ["spotTime",1];
@@ -92,7 +92,7 @@ _Unit setSkill ["reloadSpeed",(0.4 + (random 0.3))];
AccuracyFunctionRank3 = {
_Unit = _this select 0;
-_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.2))];
+_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.4))];
_Unit setSkill ["aimingShake",(0.3 + (random 0.1))];
_Unit setSkill ["spotDistance",0.8];
_Unit setSkill ["spotTime",1];
@@ -107,7 +107,7 @@ _Unit setSkill ["reloadSpeed",(0.5 + (random 0.3))];
AccuracyFunctionRank2 = {
_Unit = _this select 0;
-_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.3))];
+_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.3))];
_Unit setSkill ["aimingShake",(0.2 + (random 0.1))];
_Unit setSkill ["spotDistance",0.7];
_Unit setSkill ["spotTime",1];
@@ -122,7 +122,7 @@ _Unit setSkill ["reloadSpeed",(0.6 + (random 0.3))];
AccuracyFunctionRank1 = {
_Unit = _this select 0;
-_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.2))];
+_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.2))];
_Unit setSkill ["aimingShake",(0.1 + (random 0.1))];
_Unit setSkill ["spotDistance",0.6];
_Unit setSkill ["spotTime",1];
@@ -137,8 +137,8 @@ _Unit setSkill ["reloadSpeed",(0.5 + (random 0.3))];
AccuracyFunctionRank0 = {
_Unit = _this select 0;
-_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.1))];
-_Unit setSkill ["aimingShake",(random 0.1)];
+_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.1))];
+_Unit setSkill ["aimingShake",0.1 + (random 0.1)];
_Unit setSkill ["spotDistance",0.5];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.2 + (random 0.3))];
diff --git a/actions/buyBuilding.sqf b/actions/buyBuilding.sqf
index c6af472a..cdcc623d 100644
--- a/actions/buyBuilding.sqf
+++ b/actions/buyBuilding.sqf
@@ -1,63 +1,65 @@
-if !(captive player) exitWith {hint "You cannot buy buildings while wanted"};
+if !(captive player) exitWith {"You cannot buy buildings while wanted" call notify_minor};
-
-
-_buildings = (getpos player) nearObjects 15;
+_b = player call getNearestRealEstate;
_handled = false;
-_building = objNULL;
-_price = 0;
-{
- _owner = _x getVariable "owner";
- if ((typeof _x) in AIT_allBuyableBuildings and (isNil "_owner")) exitWith {
+_type = "buy";
+_err = false;
+if(typename _b == "ARRAY") then {
+ _building = (_b select 0);
+ if !(_building call hasOwner) then {
_handled = true;
- _town = (getpos _x) call nearestTown;
- _stability = ((server getVariable format["stability%1",_town]) / 100);
- _standing = (player getVariable format["rep%1",_town]) + 40;
-
- if(_standing < -100) then {_standing = -100};
- if(_standing > 100) then {_standing = 100};
- if(_standing != 0) then {
- _standing = ((_standing/100) * -1)+1;
+ }else{
+ _owner = _building getVariable "owner";
+ if(_owner == getplayeruid player) then {
+ _home = player getVariable "home";
+ if(_home == _building) exitWith {"You cannot sell your home" call notify_minor;_err = true};
+ _type = "sell";
+ _handled = true;
};
-
- _baseprice = 400;
- _type = typeof _x;
- if !(_type in AIT_spawnHouses) then {
- if(_type in AIT_mansions) then {_baseprice = 25000}else{
- if(_type in AIT_medPopHouses) then {_baseprice = 5000};
- if(_type in AIT_lowPopHouses) then {_baseprice = 1000};
- };
- };
- _price = round(_baseprice + (_stability * _baseprice * _standing));
- _building = _x;
};
-}foreach(_buildings);
-
+};
+if(_err) exitWith {};
if(_handled) then {
- _money = player getVariable "money";
- if(_money < _price) exitWith {format["You need $%1",_price] call notify_minor};
+ _building = _b select 0;
+ _price = _b select 1;
+ _sell = _b select 2;
+ _lease = _b select 3;
+ _totaloccupants = _b select 4;
- playSound "ClickSoft";
+ _money = player getVariable "money";
- _building setVariable ["owner",getPlayerUID player,true];
- player setVariable ["money",_money-_price,true];
+ if(_type == "buy" and _money < _price) exitWith {"You cannot afford that" call notify_minor};
+
+ playSound "3DEN_notificationDefault";
+ _mrkid = format["bought%1",str(_building)];
+ _owned = player getVariable "owned";
- _mrk = createMarkerLocal [format["bought%1",str(_building)],getpos _building];
- _mrk setMarkerShape "ICON";
- _mrk setMarkerType "loc_Tourism";
- _mrk setMarkerColor "ColorWhite";
- _mrk setMarkerAlpha 0;
- _mrk setMarkerAlphaLocal 1;
+ if(_type == "buy") then {
+ _building setVariable ["owner",getPlayerUID player,true];
+ player setVariable ["money",_money-_price,true];
+
+ _mrk = createMarkerLocal [_mrkid,getpos _building];
+ _mrk setMarkerShape "ICON";
+ _mrk setMarkerType "loc_Tourism";
+ _mrk setMarkerColor "ColorWhite";
+ _mrk setMarkerAlpha 0;
+ _mrk setMarkerAlphaLocal 1;
+ _owned pushback _building;
+ "Building purchased" call notify_minor;
+ if(_price > 10000) then {
+ [_town,round(_price / 10000)] call standing;
+ };
+ }else{
+ _building setVariable ["owner",nil,true];
+ deleteMarker _mrkid;
+ _owned deleteAt (_owned find _building);
+ "Building sold" call notify_minor;
+ player setVariable ["money",_money+_sell,true];
+ };
- _owned = player getVariable "owned";
- _owned pushback _building;
player setVariable ["owned",_owned,true];
+
- format["You purchased this building for $%1",_price] call notify_minor;
-
- if(_price > 2000) then {
- [_town,round(_price / 1000)] call standing;
- };
}else{
"There are no buildings for sale nearby" call notify_minor;
};
diff --git a/actions/fastTravel.sqf b/actions/fastTravel.sqf
index 05133ca7..92093a4a 100644
--- a/actions/fastTravel.sqf
+++ b/actions/fastTravel.sqf
@@ -5,7 +5,7 @@ if((vehicle player) != player) then {
if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call notify_minor};
};
posTravel = [];
-hint "Click near a building you own";
+hint "Click near a building or camp you own";
openMap true;
onMapSingleClick "posTravel = _pos;";
@@ -15,46 +15,45 @@ onMapSingleClick "";
if !(visibleMap) exitWith {};
-_buildings = posTravel nearObjects 50;
_handled = false;
-_possible = [];
-{
- if (_x call hasOwner) then {
- _owner = _x getVariable "owner";
- if((_owner == getplayerUID player) and (typeof _x) in AIT_allBuyableBuildings) exitWith {
- _handled = true;
- player allowDamage false;
- disableUserInput true;
-
- cutText ["Fast traveling, please wait","BLACK",2];
- sleep 2;
- openMap false;
- if((vehicle player) != player) then {
- if (driver vehicle player == player) then {
- _tam = 10;
- _roads = [];
- while {true} do {
- _roads = posTravel nearRoads _tam;
- if (count _roads < 1) then {_tam = _tam + 10};
- if (count _roads > 0) exitWith {};
- };
- {_x allowDamage false} foreach(crew vehicle player);
- _road = _roads select 0;
- _pos = position _road findEmptyPosition [1,50,typeOf (vehicle player)];
- vehicle player setPos _pos;
- };
- }else{
- player setpos (getpos _x);
- };
- disableUserInput false;
- cutText ["","BLACK IN",3]
- };
- }
-}foreach(_buildings);
+if(posTravel distance player < 250) then {
+ "You cannot fast travel less than 250m. Just walk!" call notify_minor;
+ openMap false;
+};
+
+if([posTravel,"Misc"] call canPlace) then {
+ _handled = true;
+ player allowDamage false;
+ disableUserInput true;
+
+ cutText ["Fast traveling, please wait","BLACK",2];
+ sleep 2;
+ openMap false;
+ if((vehicle player) != player) then {
+ if (driver vehicle player == player) then {
+ _tam = 10;
+ _roads = [];
+ while {true} do {
+ _roads = posTravel nearRoads _tam;
+ if (count _roads < 1) then {_tam = _tam + 10};
+ if (count _roads > 0) exitWith {};
+ };
+ {_x allowDamage false} foreach(crew vehicle player);
+ _road = _roads select 0;
+ _pos = position _road findEmptyPosition [1,50,typeOf (vehicle player)];
+ vehicle player setPos _pos;
+ };
+ }else{
+ player setpos posTravel;
+ };
+
+ disableUserInput false;
+ cutText ["","BLACK IN",3]
+};
if !(_handled) then {
- "You don't own any buildings near there" call notify_minor;
+ "You must click near a base, camp or owned building" call notify_minor;
openMap false;
}else{
if((vehicle player) != player) then {
diff --git a/actions/getIntel.sqf b/actions/getIntel.sqf
new file mode 100644
index 00000000..fd5ec6cf
--- /dev/null
+++ b/actions/getIntel.sqf
@@ -0,0 +1,22 @@
+if !(captive player) exitWith {"You cannot ask for intel while wanted" call notify_minor};
+
+_town = (getpos player) call nearestTown;
+_standing = player getVariable 'rep';
+
+_civ = player getvariable "hiringciv";
+_handled = false;
+
+if(_civ getvariable ["askedintel",false]) exitWith {
+ _civ globalChat "You already asked me";
+};
+
+_got = _civ getVariable ["gotmoney",false];
+
+if(_got or (random 500 < _standing)) then {
+ _handled = [player,_civ] call giveIntel;
+}else{
+ _civ globalChat "Can't help you, I'm sorry";
+};
+
+_civ setVariable ["askedintel",true];
+_civ setVariable ["gotmoney",false,false];
\ No newline at end of file
diff --git a/actions/giveMoney.sqf b/actions/giveMoney.sqf
index 4b84c6d7..8f2de056 100644
--- a/actions/giveMoney.sqf
+++ b/actions/giveMoney.sqf
@@ -2,7 +2,7 @@ _money = player getVariable "money";
if(_money < 100) exitWith {"You don't have $100 to give" call notify_minor};
-_people = (getpos player) nearObjects ["Man",5];
+_civ = player getvariable "hiringciv";
_handled = false;
@@ -10,42 +10,24 @@ _town = (getpos player) call nearestTown;
_rep = player getVariable format["rep%1",_town];
if(_rep > 100) then {_rep = 100};
if(_rep < -100) then {_rep = -100};
-{
- if !(_x == player) then {
- if(side _x == west and (random 100 > 80)) then {
- if(random 100 > _rep) exitWith {
- _handled = true;
- _x globalChat "Don't tell my superiors, but thanks!";
- };
- };
- if(isPlayer _x) exitWith {
- _handled = true;
- _mon = _x getVariable "money";
- _x setVariable ["money",_mon+100,true];
- };
- if(side _x == civilian) then {
- _handled = true;
-
- if((random 100) > 80) then {
- _x globalChat "I'll tell everyone in town how generous you are!";
- player setVariable [format["rep%1",_town],_rep+1,true];
- format["Standing (%1): %2",_town,_rep+1] call notify;
- }else{
- _x globalChat "Thank you, kind sir!";
- };
- };
- if(side _x == east) then {
- //lol
- _x globalChat "Hahahah thanks for the money!";
- _handled = true;
- player setVariable [format["rep%1",_town],_rep-1,true];
- format["Standing (%1): %2",_town,_rep-1] call notify;
- };
- };
-}foreach(_people);
+
+if(isPlayer _civ) exitWith {
+ _handled = true;
+ _mon = _x getVariable "money";
+ _x setVariable ["money",_mon+100,true];
+};
+if(side _civ == civilian) then {
+ _handled = true;
+ _civ setVariable ["gotmoney",true,false];
+ _civ setVariable ["askedintel",false,false];
+ if((random 100) > 80) then {
+ _x globalChat "I'll tell everyone in town how generous you are!";
+ [_town,1] call standing;
+ }else{
+ _civ globalChat "Thank you, kind sir!";
+ };
+};
if(_handled) then {
player setVariable ["money",_money-100,true];
-}else{
- "There is noone nearby that will take your money" call notify_minor;
};
\ No newline at end of file
diff --git a/actions/loadGame.sqf b/actions/loadGame.sqf
index 861c1b4f..db294320 100644
--- a/actions/loadGame.sqf
+++ b/actions/loadGame.sqf
@@ -3,8 +3,8 @@ private ["_data"];
//get all server data
"Please wait.. loading persistent save" remoteExec['blackFaded',0];
-_data = profileNameSpace getVariable ("Overthrow.save.001");
-if(isNil "_data") exitWith {
+_data = profileNameSpace getVariable ["Overthrow.save.001",""];
+if(typename _data != "ARRAY") exitWith {
server setVariable ["StartupType","NEW",true];
hint "No save found, starting new game";
};
@@ -12,6 +12,25 @@ if(isNil "_data") exitWith {
_key = _x select 0;
_val = _x select 1;
_set = true;
+ if(_key == "bases") then {
+ {
+ _pos = _x select 0;
+ _name = _x select 1;
+ _owner = _x select 2;
+
+ _veh = createVehicle [AIT_Item_Flag, _pos, [], 0, "CAN_COLLIDE"];
+ _veh setVariable ["owner",_owner];
+ _veh = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];
+
+ _mrkid = format["%1-base",_pos];
+ createMarker [_mrkid,_pos];
+ _mrkid setMarkerShape "ICON";
+ _mrkid setMarkerType "mil_Flag";
+ _mrkid setMarkerColor "ColorWhite";
+ _mrkid setMarkerAlpha 1;
+ _mrkid setMarkerText _name;
+ }foreach(_val);
+ };
if(_key == "vehicles") then {
_set = false;
{
@@ -20,14 +39,22 @@ if(isNil "_data") exitWith {
_dir = _x select 2;
_stock = _x select 3;
_owner = _x select 4;
- _veh = _type createVehicle _pos;
- _veh setPos _pos;
+ _name = "";
+ if(count _x > 5) then {
+ _name = _x select 5;
+ };
+ _veh = createVehicle [_type,_pos,[],0,"CAN_COLLIDE"];
_veh setDir _dir;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
+ _veh setVariable ["name",_name];
+ if(_type == AIT_item_Map) then {
+ _veh setObjectTextureGlobal [0,"dialogs\maptanoa.paa"];
+ };
+
_veh setVariable ["owner",_owner];
{
_cls = _x select 0;
@@ -49,5 +76,6 @@ if(isNil "_data") exitWith {
server setvariable [_key,_val,true];
};
}foreach(_data);
-
-server setVariable ["StartupType","LOAD",true];
\ No newline at end of file
+sleep 2; //let the variables propagate
+server setVariable ["StartupType","LOAD",true];
+hint "Persistent Save Loaded";
\ No newline at end of file
diff --git a/actions/move.sqf b/actions/move.sqf
index 8d10b848..40c9e130 100644
--- a/actions/move.sqf
+++ b/actions/move.sqf
@@ -3,19 +3,46 @@ private ["_idx","_jugador","_cosa","_id"];
_cosa = _this select 0;
_jugador = _this select 1;
_id = _this select 2;
-_cosa enableSimulationGlobal false;
+_cosa remoteExec ["enableSimulationGlobal false",2];
+_cosa enableSimulation false;
_cosa removeAction _id;
-_cosa attachTo [_jugador,[0,2,1]];
-_idx = _jugador addAction ["Drop Here", {{detach _x} forEach attachedObjects player;},nil,0,false,true,"",""];
+_originalpos = getposATL _cosa;
+_originaldir = getDir _cosa;
+_mass = getMass _cosa;
+_cosa setMass 0;
+{
+ _cosa disableCollisionWith _x;
+}foreach(vehicles + allUnits);
-waitUntil {sleep 0.05; (count attachedObjects _jugador == 0) or (vehicle _jugador != _jugador) or (!alive _jugador) or (!isPlayer _jugador)};
+_p = getpos _cosa;
+_j = getpos _jugador;
+_p = [0,2.5,((_p select 2) - (_j select 2))+1.2];
+
+_cosa attachTo [_jugador,_p];
+_cosa allowDamage false;
+
+AIT_moveIdx = _jugador addAction ["Drop Here", {{detach _x} forEach attachedObjects player;},nil,0,false,true,"",""];
+
+waitUntil {sleep 0.1; (count attachedObjects _jugador == 0) or (vehicle _jugador != _jugador) or (!alive _jugador) or (!isPlayer _jugador)};
{detach _x} forEach attachedObjects _jugador;
-_jugador removeAction _idx;
+_jugador removeAction AIT_moveIdx;
-_cosa setPosATL [getPosATL _cosa select 0,getPosATL _cosa select 1,getPosATL _jugador select 2];
+if!([(getpos player),"Misc"] call canPlace) exitWith {
+ "You cannot move this too far from a building or camp that you own" call notify_minor;
+ _cosa setPosATL _originalpos;
+ _cosa setDir _originaldir;
+ _cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
+ _cosa enableSimulationGlobal true;
+};
-sleep 1;
+_cosa setPosATL [getPosATL _cosa select 0,getPosATL _cosa select 1,getPosATL _jugador select 2];
_cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
-_cosa enableSimulationGlobal true;
\ No newline at end of file
+_cosa remoteExec ["enableSimulationGlobal true",2];
+_cosa enableSimulation true;
+_cosa allowDamage true;
+_cosa setMass _mass;
+{
+ _cosa enableCollisionWith _x;
+}foreach(vehicles + allUnits);
\ No newline at end of file
diff --git a/actions/placementMode.sqf b/actions/placementMode.sqf
new file mode 100644
index 00000000..21d5528e
--- /dev/null
+++ b/actions/placementMode.sqf
@@ -0,0 +1,213 @@
+if !(captive player) exitWith {"You cannot place objects while wanted" call notify_minor};
+private ["_typecls","_types","_cost","_attach","_idx","_money"];
+
+_typecls = _this;
+modeValues = [];
+_cost = 0;
+attachAt = [0,2,1];
+_description = "";
+modeFinished = false;
+modeCancelled = false;
+call {
+ if(_typecls == "Camp") exitWith {attachAt = [0,3.5,1.1];modeValues = [AIT_item_Tent];_cost=40;_description="Creates a fast travel destination for you and your group. Only one allowed per player, will remove any existing camps."};
+ if(_typecls == "Base") exitWith {attachAt = [0,6,4];modeValues = [AIT_item_Flag];_cost=500;_description="Creates a fast travel destination for all friendlies and enables build mode for military structures"};
+ if(_typecls == "Ammobox") exitWith {modeValues = [AIT_item_Storage];_cost=60;_description="Another empty ammobox to fill with items you have acquired through.. various means."};
+ if(_typecls == "Whiteboard") exitWith {modeValues = [AIT_item_Map];_cost=20;_description="Plan out your next assault in the middle of the jungle."};
+ {
+ if((_x select 0) == _typecls) exitWith {modeValues = _x select 2;_cost = _x select 1;attachAt = _x select 3};
+ }foreach(AIT_Placeables);
+};
+//Price check (on aisle 3)
+_money = player getVariable "money";
+if(_cost > _money) exitWith {format["You cannot afford that, you need $%1",_cost] call notify_minor};
+
+if !([getpos player,_typecls] call canPlace) exitWith {
+ call {
+ if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call notify_minor};
+ if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call notify_minor};
+ "You must be near a base, camp or owned structure" call notify_minor
+ };
+};
+
+modeValue = 0;
+modeTarget = objNULL;
+
+
+if(_cost > 0) then {
+ _txt = format ["%1
$%2
%3
Q,E = Rotate
Space = Change Type
Enter = Done
Esc = Cancel",_typecls,[_cost, 1, 0, true] call CBA_fnc_formatNumber,_description];
+ [_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
+
+
+ _keyhandler = {
+ _handled = false;
+ _key = _this select 1;
+
+ _p = getDir modeTarget;
+ _v = getDir player;
+ _c = 360;
+
+ _dir = _c-((_c-_p)-(_c-_v));
+ if(_dir >= 360) then {_dir = _dir - 360};
+
+ call {
+ if (_key == 16) exitWith {
+ //Q
+ _handled = true;
+ _newdir = _dir - 1;
+ if(_newdir < 0) then {_newdir = 359};
+ modeTarget setDir (_newdir);
+ };
+ if (_key == 18) exitWith {
+ //E
+ _handled = true;
+ _newdir = _dir + 1;
+ if(_newdir > 359) then {_newdir = 0};
+ modeTarget setDir (_newdir);
+ };
+ if(_key == 57) exitWith {
+ //Space
+ _handled = true;
+ detach modeTarget;
+ deleteVehicle modeTarget;
+ modeValue = modeValue + 1;
+ if(modeValue > ((count modeValues)-1)) then {modeValue = 0};
+
+ _cls = modeValues select modeValue;
+
+ modeTarget = createVehicle [_cls, [0,0,0], [], 0, "CAN_COLLIDE"];
+ if(_cls == "C_Rubberboat") then {
+ _dir = _dir + 90;
+ };
+ modeTarget remoteExec ["enableSimulationGlobal false",2];
+ if(_cls == AIT_item_Map) then {
+ modeTarget setObjectTextureGlobal [0,"dialogs\maptanoa.paa"];
+ };
+ clearWeaponCargoGlobal modeTarget;
+ clearMagazineCargoGlobal modeTarget;
+ clearBackpackCargoGlobal modeTarget;
+ clearItemCargoGlobal modeTarget;
+
+ modeTarget attachTo [player,attachAt];
+ modeTarget setDir _dir;
+ };
+ if(_key == 28) exitWith {
+ //Enter
+ _handled = true;
+ modeFinished = true;
+ };
+ if(_key == 1) exitWith {
+ //ESC
+ _handled = true;
+ modeCancelled = true;
+ };
+ };
+ _handled
+ };
+ _cls = modeValues select modeValue;
+ _handlerId = (findDisplay 46) displayAddEventHandler ["KeyDown",_keyhandler];
+ modeTarget = createVehicle [_cls, [0,0,0], [], 0, "CAN_COLLIDE"];
+ modeTarget remoteExec ["enableSimulationGlobal false",2];
+ modeTarget enableSimulation false;
+ if(_cls == AIT_item_Map) then {
+ modeTarget setObjectTextureGlobal [0,"dialogs\maptanoa.paa"];
+ };
+ modeTarget enableSimulationGlobal false;
+
+
+ clearWeaponCargoGlobal modeTarget;
+ clearMagazineCargoGlobal modeTarget;
+ clearBackpackCargoGlobal modeTarget;
+ clearItemCargoGlobal modeTarget;
+
+ modeTarget attachTo [player,attachAt];
+
+ if(_cls == "C_Rubberboat") then {
+ _p = getDir modeTarget;
+ _v = getDir player;
+ _c = 360;
+
+ _dir = _c-((_c-_p)-(_c-_v));
+ if(_dir >= 360) then {_dir = _dir - 360};
+
+ modeTarget setDir _dir + 90;
+ };
+
+ waitUntil {sleep 0.1; modeFinished or modeCancelled or (count attachedObjects player == 0) or (vehicle player != player) or (!alive player) or (!isPlayer player)};
+
+ (findDisplay 46) displayRemoveEventHandler ["KeyDown",_handlerId];
+
+ {detach _x} forEach attachedObjects player;
+
+ if(modeCancelled or (vehicle player != player) or (!alive player) or (!isPlayer player)) then {
+ detach modeTarget;
+ deleteVehicle modeTarget;
+ }else{
+ if ([getpos player,_typecls] call canPlace) then {
+ player setVariable ["money",_money - _cost,true];
+ modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2];
+ modeTarget remoteExec ["enableSimulationGlobal true",2];
+ modeTarget enableSimulation true;
+ modeTarget setVariable ["owner",getPlayerUID player,true];
+ modeTarget call initObjectLocal;
+ if(_typecls == "Base" or _typecls == "Camp") then {
+ _veh = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"];
+ };
+
+ if(_typecls == "Base") then {
+ createDialog "AIT_dialog_name";
+ ctrlSetText [1400,"Base"];
+
+ onNameDone = {
+ _name = ctrltext 1400;
+ if(_name != "") then {
+ closeDialog 0;
+
+ _base = (player nearObjects [AIT_item_Flag,50]) select 0;
+
+ _bases = server getVariable ["bases",[]];
+ _bases pushback [getpos _base,_name,getplayeruid player];
+ server setVariable ["bases",_bases,true];
+
+ _base setVariable ["name",_name];
+
+ _mrkid = format["%1-base",getpos _base];
+ createMarker [_mrkid,getpos _base];
+ _mrkid setMarkerShape "ICON";
+ _mrkid setMarkerType "mil_Flag";
+ _mrkid setMarkerColor "ColorWhite";
+ _mrkid setMarkerAlpha 1;
+ _mrkid setMarkerText _name;
+ };
+ };
+ onNameKeyDown = {
+ _key = _this select 1;
+ _name = ctrltext 1400;
+ if(_key == 28 and _name != "") exitWith {
+ [] call onNameDone;
+ true
+ };
+ };
+ };
+ }else{
+ call {
+ if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call notify_minor};
+ if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call notify_minor};
+ "You must be near a base, camp or owned structure" call notify_minor
+ };
+ detach modeTarget;
+ deleteVehicle modeTarget;
+ };
+ };
+}else{
+ if(_typecls != "Camp" and _typecls != "Base") then {
+ "To place this item you must be near a base or a building/camp that you own" call notify_minor;
+ }else{
+ "You cannot place a camp/base near a building you own. Bases must also be built away from towns." call notify_minor;
+ };
+};
+
+//Cleanup public vars
+modeTarget = nil;
+modeCancelled = nil;
+modeFinished = nil;
+modeValue = nil;
\ No newline at end of file
diff --git a/actions/recruitCiv.sqf b/actions/recruitCiv.sqf
index 9e4a5539..9cdd4acc 100644
--- a/actions/recruitCiv.sqf
+++ b/actions/recruitCiv.sqf
@@ -4,32 +4,19 @@ _town = (getpos player) call nearestTown;
_standing = player getVariable format['rep%1',_town];
_price = [_town,"CIV",_standing] call getPrice;
-
_money = player getVariable "money";
-if(_money < _price) exitWith {format["You need $%1",_price] call notify_minor};
-
-_civs = player nearEntities ["Man", 10];
-_possible = [];
-
-{
- _owner = _x getVariable "owner";
- if(isNil "_owner" and side _x == civilian and _x != player) then {
- _possible pushBack _x;
- };
-}foreach(_civs);
-
-if(count _possible == 0) exitWith {"No eligible civilians within 10 meters" call notify_minor};
-playSound "ClickSoft";
+if(_money < _price) exitWith {"You cannot afford that" call notify_minor};
+playSound "3DEN_notificationDefault";
player setVariable ["money",_money-_price,true];
-[_town,1] call standing;
+if(random 100 > 80) then {
+ [_town,1] call standing;
+};
-_civ = _possible select 0;
+_civ = player getvariable "hiringciv";
_civ setVariable ["owner",getPlayerUID player,true];
[_civ] joinSilent (group player);
-removeAllActions _civ;
-_civ spawn wantedSystem;
-_civ setVariable ["NOAI",1,true];
+[_civ] spawn initRecruit;
format["%1 has joined your crew",name _civ] call notify_minor;
\ No newline at end of file
diff --git a/actions/saveGame.sqf b/actions/saveGame.sqf
index d6956f4f..0eeb061d 100644
--- a/actions/saveGame.sqf
+++ b/actions/saveGame.sqf
@@ -1,12 +1,19 @@
-private ["_data"];
+private ["_data","_done"];
if(AIT_saving) exitWith {hint "Please wait, save still in progress"};
AIT_saving = true;
publicVariable "AIT_saving";
+
+"Persistent Saving..." remoteExec ["notify_minor",0,true];
+sleep 0.1;
+waitUntil {!isNil "AIT_NATOInitDone"};
+
_data = [];
//get all server data
{
- _data pushback [_x,server getVariable _x];
+ if !(_x == "StartupType" or _x == "recruits") then {
+ _data pushback [_x,server getVariable _x];
+ };
}foreach(allVariables server);
//get all online player data
@@ -30,7 +37,7 @@ _data = [];
_val = _owned;
};
- if(_x == "home") then {
+ if(_x == "home" or _x == "camp") then {
_val = getpos _val;
};
_d pushback [_x,_val];
@@ -43,18 +50,47 @@ _data = [];
_vehicles = [];
+_count = 10001;
{
- if(alive _x and (_x call hasOwner)) then {
+ if((!isPlayer _x) and (alive _x) and (_x call hasOwner) and (typeof _x != AIT_item_Flag) and (!(_x isKindOf "Building"))) then {
_owner = _x getVariable ["owner",false];
- _vehicles pushback [typeof _x,getpos _x,getdir _x,_x call unitStock,_owner];
+ _vehicles pushback [typeof _x,getpos _x,getdir _x,_x call unitStock,_owner,_x getVariable ["name",""]];
+ _done pushback _x;
};
-}foreach(vehicles);
+ if(_count > 10000) then {
+ "Still persistent Saving... please wait" remoteExec ["notify_minor",0,true];
+ _count = 0;
+ sleep 0.1;
+ };
+ _count = _count + 1;
+}foreach((getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition")) nearObjects 50000);
+
+sleep 0.2;
_data pushback ["vehicles",_vehicles];
+_recruits = [];
+{
+ _do = true;
+ _unitorpos = _x select 2;
+ if(typename _unitorpos == "OBJECT") then {
+ if(alive _unitorpos) then {
+ _p = getpos _unitorpos;
+ _x set [4,getUnitLoadout _unitorpos];
+ _x set [2,[_p select 0,_p select 1,_p select 2]];
+ }else{
+ _do = false;
+ };
+ };
+ if(_do) then {
+ _recruits pushback _x;
+ };
+}foreach(server getVariable ["recruits",[]]);
+_data pushback ["recruits",_recruits];
+
profileNameSpace setVariable ["Overthrow.save.001",_data];
if (isDedicated) then {saveProfileNamespace};
-"Persistent Save Done" remoteExec ["notify_minor",0,true];
+"Persistent Save Completed" remoteExec ["notify_minor",0,true];
AIT_saving = false;
publicVariable "AIT_saving";
diff --git a/actions/townInfo.sqf b/actions/townInfo.sqf
index eb6fc0dd..17d93be0 100644
--- a/actions/townInfo.sqf
+++ b/actions/townInfo.sqf
@@ -16,6 +16,14 @@ while {visibleMap} do {
if!(isNil "_town") then {
_pop = server getVariable format["population%1",_town];
_stability = server getVariable format["stability%1",_town];
+ _abandon = "Under NATO Control";
+ if(_town in (server getVariable ["NATOabandoned",[]])) then {
+ if(_stability < 50) then {
+ _abandon = "Anarchy";
+ }else{
+ _abandon = "Under Resistance Control";
+ };
+ };
_rep = player getVariable format["rep%1",_town];
_numshops = server getVariable format["shopsin%1",_town];
if(_numshops == 0) then {
@@ -25,7 +33,7 @@ while {visibleMap} do {
if(_rep > -1) then {
_plusmin = "+";
};
- _txt = format ["%1
Population: %2
Stability: %3%4
Your Standing: %5%6
Shops: %7",_town,[_pop, 1, 0, true] call CBA_fnc_formatNumber,_stability,"%",_plusmin,_rep,_numshops];
+ _txt = format ["%1
Status: %8
Population: %2
Stability: %3%4
Your Standing: %5%6
Shops: %7",_town,[_pop, 1, 0, true] call CBA_fnc_formatNumber,_stability,"%",_plusmin,_rep,_numshops,_abandon];
[_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
gotone = false;
diff --git a/description.ext b/description.ext
index 50eed7ee..72939aa1 100644
--- a/description.ext
+++ b/description.ext
@@ -2,10 +2,13 @@
#include "dialogs\stats.hpp"
#include "dialogs\shop.hpp"
#include "dialogs\main.hpp"
+#include "dialogs\place.hpp"
+#include "dialogs\build.hpp"
+#include "dialogs\recruits.hpp"
author="ARMAzac";
OnLoadName = "Overthrow.Tanoa";
-OnLoadMission = "v0.3.0 (20160813)";
+OnLoadMission = "v0.4.0";
loadScreen = "pic.jpg";
class Header
diff --git a/dialogs/build.hpp b/dialogs/build.hpp
new file mode 100644
index 00000000..8a14da23
--- /dev/null
+++ b/dialogs/build.hpp
@@ -0,0 +1,82 @@
+class AIT_dialog_buildbase
+{
+ idd=-1;
+ movingenable=false;
+ onMouseMoving = "_this call buildOnMouseMove";
+ onMouseButtonDown = "_this call buildOnMouseDown";
+ onMouseButtonUp = "_this call buildOnMouseUp";
+ onMouseZChanged = "_this call buildOnMouseWheel";
+ onKeyDown = "_this call buildOnKeyDown";
+ onKeyUp = "_this call buildOnKeyUp";
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Qytyja)
+ ////////////////////////////////////////////////////////
+
+ class RscButton_1600: RscButton
+ {
+ idc = 1600;
+ action = "closeDialog 0;[] call cancelBuild;";
+
+ text = "Close"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.324 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ };
+ class RscButton_1601: RscButton
+ {
+ idc = 1601;
+ action = "'Walls' call build";
+
+ text = "Walls"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.588 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Stop people (or tanks) from getting in"; //--- ToDo: Localize;
+ };
+ class RscButton_1602: RscButton
+ {
+ idc = 1602;
+ action = "'Training Camp' call build";
+
+ text = "Training Camp"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.412 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Allows training of recruits and hiring of mercenaries"; //--- ToDo: Localize;
+ };
+ class RscButton_1603: RscButton
+ {
+ idc = 1603;
+ action = "'Bunkers' call build";
+
+ text = "Bunkers"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.5 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Small defensive structures"; //--- ToDo: Localize;
+ };
+ class RscButton_1604: RscButton
+ {
+ idc = 1604;
+ action = "'Helipad' call build";
+
+ text = "Helipad"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.676 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Apparently helicopter pilots need to be told where they are allowed to land"; //--- ToDo: Localize;
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+
+
+ }
+};
\ No newline at end of file
diff --git a/dialogs/clear.paa b/dialogs/clear.paa
new file mode 100644
index 00000000..94fe8cc6
Binary files /dev/null and b/dialogs/clear.paa differ
diff --git a/dialogs/defines.hpp b/dialogs/defines.hpp
index 60c368fa..897fbb20 100644
--- a/dialogs/defines.hpp
+++ b/dialogs/defines.hpp
@@ -190,7 +190,7 @@ class RscStructuredText
w = 0.1;
text = "";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
- shadow = 1;
+ shadow = 0;
};
class RscPicture
{
@@ -246,6 +246,7 @@ class RscPicture
0.65
};
};
+
class RscEdit
{
deletable = 0;
diff --git a/dialogs/main.hpp b/dialogs/main.hpp
index dbf631ec..24a07bca 100644
--- a/dialogs/main.hpp
+++ b/dialogs/main.hpp
@@ -6,7 +6,7 @@ class AIT_dialog_start
class controls
{
////////////////////////////////////////////////////////
- // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Rofuji)
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Rofuji)
////////////////////////////////////////////////////////
class RscButton_1600: RscButton
@@ -18,7 +18,7 @@ class AIT_dialog_start
w = 0.118594 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Continue previous save"; //--- ToDo: Localize;
- action = "closeDialog 0;[] remoteExec ['loadGamePersistent',2];";
+ action = "closeDialog 0;'actions\loadGame.sqf' remoteExec ['execVM',2];";
};
class RscButton_1601: RscButton
{
@@ -37,6 +37,65 @@ class AIT_dialog_start
};
};
+class AIT_dialog_command
+{
+ idd=-1;
+ movingenable=false;
+
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Xeqozy)
+ ////////////////////////////////////////////////////////
+
+ class RscButton_1600: RscButton
+ {
+ idc = 1600;
+ text = "Fast Travel Unit/s"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.39 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Fast travels all selected units that are not currently wanted"; //--- ToDo: Localize;
+ };
+ class RscButton_1601: RscButton
+ {
+ idc = 1601;
+ text = "Loot"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.654 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Commands all selected units to loot bodies and fill closest container to you"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] spawn loot;"
+ };
+ class RscButton_1602: RscButton
+ {
+ idc = 1602;
+ text = "Open Inventory"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.478 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Commands first unit selected to walk to and open the closest container to you"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] spawn openInventory;"
+ };
+ class RscButton_1603: RscButton
+ {
+ idc = 1603;
+ text = "Rearm"; //--- ToDo: Localize;
+ x = 0.0204687 * safezoneW + safezoneX;
+ y = 0.566 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Commands all selected units to find ammo in the surrounding area"; //--- ToDo: Localize;
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+
+ }
+}
class AIT_dialog_options
{
@@ -46,7 +105,7 @@ class AIT_dialog_options
class controls
{
////////////////////////////////////////////////////////
- // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Wiwiho)
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Wiwiho)
////////////////////////////////////////////////////////
class RscText_1001: RscText
@@ -68,7 +127,7 @@ class AIT_dialog_options
w = 0.118594 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "A more secure save than default, this will work across updates of both Arma and Overthrow"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn saveGamePersistent;";
+ action = "closeDialog 0;'actions\saveGame.sqf' remoteExec ['execVM',2];";
};
class RscButton_1601: RscButton
{
@@ -130,74 +189,174 @@ class AIT_dialog_options
class AIT_dialog_main
{
- idd=-1;
- movingenable=false;
+ idd=8001;
+ movingenable=false;
class controls
{
////////////////////////////////////////////////////////
- // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Syqojo)
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Giqadi)
////////////////////////////////////////////////////////
class RscButton_1600: RscButton
{
idc = 1600;
- text = "Recruit Civ"; //--- ToDo: Localize;
- x = 0.381406 * safezoneW + safezoneX;
- y = 0.698 * safezoneH + safezoneY;
- w = 0.0773437 * safezoneW;
- h = 0.055 * safezoneH;
- action = "closeDialog 0;[] call recruitCiv;";
+ action = "closeDialog 0;[] spawn fastTravel";
+
+ text = "Fast Travel"; //--- ToDo: Localize;
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.5 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.066 * safezoneH;
+ };
+ class RscStructuredText_1100: RscStructuredText
+ {
+ idc = 1100;
+
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.368 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.121 * safezoneH;
+ colorBackground[] = {0,0,0,0.4};
};
class RscButton_1601: RscButton
{
idc = 1601;
- text = "Buy Building"; //--- ToDo: Localize;
- x = 0.469062 * safezoneW + safezoneX;
- y = 0.698 * safezoneH + safezoneY;
- w = 0.0773437 * safezoneW;
- h = 0.055 * safezoneH;
- action = "closeDialog 0;[] call buyBuilding;";
+
+ text = "Place"; //--- ToDo: Localize;
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.577 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.066 * safezoneH;
+ action = "closeDialog 0;createDialog 'AIT_dialog_place'";
};
class RscButton_1602: RscButton
{
idc = 1602;
- text = "Buy Ammobox"; //--- ToDo: Localize;
- x = 0.556719 * safezoneW + safezoneX;
- y = 0.698 * safezoneH + safezoneY;
- w = 0.0670312 * safezoneW;
- h = 0.055 * safezoneH;
- action = "closeDialog 0;[] spawn buyAmmobox;";
+
+ text = "Build"; //--- ToDo: Localize;
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.654 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.066 * safezoneH;
+ action = "closeDialog 0;[] spawn buildMenu";
};
class RscButton_1603: RscButton
{
- idc = 1604;
- text = "Set Home"; //--- ToDo: Localize;
- x = 0.469062 * safezoneW + safezoneX;
- y = 0.764 * safezoneH + safezoneY;
- w = 0.0773437 * safezoneW;
- h = 0.055 * safezoneH;
- action = "closeDialog 0;[] call setHome;";
+ idc = 1603;
+
+ text = "Manage Recruits"; //--- ToDo: Localize;
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.731 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.066 * safezoneH;
+ action = "[] spawn manageRecruits;"
};
- class RscButton_1604: RscButton
+ class RscPicture_1200: RscPicture
{
- idc = 1603;
- text = "Give $100"; //--- ToDo: Localize;
- x = 0.381406 * safezoneW + safezoneX;
- y = 0.764 * safezoneH + safezoneY;
- w = 0.0773437 * safezoneW;
- h = 0.055 * safezoneH;
- action = "[] call giveMoney;";
+ idc = 1200;
+
+ text = "#(argb,8,8,3)color(0,0,0,0)";
+ x = 0.762969 * safezoneW + safezoneX;
+ y = 0.368 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.143 * safezoneH;
};
class RscButton_1605: RscButton
+ {
+ idc = 1605;
+
+ text = "Recruit"; //--- ToDo: Localize;
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.522 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.044 * safezoneH;
+ action = "closeDialog 0;[] spawn recruitCiv";
+ };
+ class RscButton_1606: RscButton
{
idc = 1606;
- text = "Fast Travel"; //--- ToDo: Localize;
- x = 0.556719 * safezoneW + safezoneX;
- y = 0.764 * safezoneH + safezoneY;
- w = 0.0670312 * safezoneW;
- h = 0.055 * safezoneH;
- action = "closeDialog 0;[] spawn fastTravel;";
+
+ text = "Get Intel"; //--- ToDo: Localize;
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.577 * safezoneH + safezoneY;
+ w = 0.0515625 * safezoneW;
+ h = 0.044 * safezoneH;
+ action = "closeDialog 0;[] call getIntel";
+ };
+ class RscButton_1607: RscButton
+ {
+ idc = 1607;
+
+ text = "Give $100"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] spawn giveMoney";
+ x = 0.943438 * safezoneW + safezoneX;
+ y = 0.577 * safezoneH + safezoneY;
+ w = 0.0515625 * safezoneW;
+ h = 0.044 * safezoneH;
+ };
+ class RscPicture_1201: RscPicture
+ {
+ idc = 1201;
+
+ text = "#(argb,8,8,3)color(0,0,0,0)";
+ x = 0.762969 * safezoneW + safezoneX;
+ y = 0.632 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.143 * safezoneH;
+ };
+ class RscButton_1608: RscButton
+ {
+ idc = 1608;
+
+ text = "Buy"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] call buyBuilding";
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.786 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.044 * safezoneH;
+ };
+ class RscButton_1609: RscButton
+ {
+ idc = 1609;
+
+ text = "Lease"; //--- ToDo: Localize;
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.841 * safezoneH + safezoneY;
+ w = 0.0515625 * safezoneW;
+ h = 0.044 * safezoneH;
+ action = "hint 'Not yet implemented'";
+ };
+ class RscButton_1610: RscButton
+ {
+ idc = 1610;
+
+ text = "Set Home"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] spawn setHome";
+ x = 0.943438 * safezoneW + safezoneX;
+ y = 0.841 * safezoneH + safezoneY;
+ w = 0.0515625 * safezoneW;
+ h = 0.044 * safezoneH;
+ };
+ class RscStructuredText_1101: RscStructuredText
+ {
+ idc = 1101;
+
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.368 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.143 * safezoneH;
+ colorBackground[] = {0,0,0,0.4};
+ };
+ class RscStructuredText_1102: RscStructuredText
+ {
+ idc = 1102;
+
+ x = 0.881562 * safezoneW + safezoneX;
+ y = 0.632 * safezoneH + safezoneY;
+ w = 0.113437 * safezoneW;
+ h = 0.143 * safezoneH;
+ colorBackground[] = {0,0,0,0.4};
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
diff --git a/dialogs/maptanoa.paa b/dialogs/maptanoa.paa
new file mode 100644
index 00000000..62965e4b
Binary files /dev/null and b/dialogs/maptanoa.paa differ
diff --git a/dialogs/place.hpp b/dialogs/place.hpp
new file mode 100644
index 00000000..6c319627
--- /dev/null
+++ b/dialogs/place.hpp
@@ -0,0 +1,159 @@
+class AIT_dialog_name
+{
+ idd=-1;
+ movingenable=false;
+
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Votehi)
+ ////////////////////////////////////////////////////////
+
+ class RscEdit_1400: RscEdit
+ {
+ idc = 1400;
+ x = 0.37625 * safezoneW + safezoneX;
+ y = 0.412 * safezoneH + safezoneY;
+ w = 0.242344 * safezoneW;
+ h = 0.055 * safezoneH;
+ onKeyDown = "_this call onNameKeyDown;";
+ text = "Base";
+ };
+ class RscStructuredText_1100: RscStructuredText
+ {
+ idc = 1100;
+ text = "Enter a name for your new base"; //--- ToDo: Localize;
+ x = 0.37625 * safezoneW + safezoneX;
+ y = 0.379 * safezoneH + safezoneY;
+ w = 0.195937 * safezoneW;
+ h = 0.022 * safezoneH;
+ colorBackground[] = {0,0,0,0};
+ };
+ class RscButton_1600: RscButton
+ {
+ idc = 1600;
+ text = "Done"; //--- ToDo: Localize;
+ x = 0.577344 * safezoneW + safezoneX;
+ y = 0.478 * safezoneH + safezoneY;
+ w = 0.04125 * safezoneW;
+ h = 0.055 * safezoneH;
+ action = "_this call onNameDone";
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+ };
+};
+
+class AIT_dialog_place
+{
+ idd=8002;
+ movingenable=false;
+
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Jawatu)
+ ////////////////////////////////////////////////////////
+
+ class RscButton_1600: RscButton
+ {
+ idc = 1600;
+ action = "closeDialog 0;'Sandbags' spawn placementMode";
+
+ text = "Sandbags"; //--- ToDo: Localize;
+ x = 0.551562 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Light defense"; //--- ToDo: Localize;
+ };
+ class RscButton_1601: RscButton
+ {
+ idc = 1601;
+ action = "closeDialog 0;'Camo Nets' spawn placementMode";
+
+ text = "Camo Nets"; //--- ToDo: Localize;
+ x = 0.7475 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Hide from the helicopters"; //--- ToDo: Localize;
+ };
+ class RscButton_1602: RscButton
+ {
+ idc = 1602;
+ action = "closeDialog 0;'Barriers' spawn placementMode";
+
+ text = "Barriers"; //--- ToDo: Localize;
+ x = 0.649531 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Medium defense"; //--- ToDo: Localize;
+ };
+ class RscButton_1603: RscButton
+ {
+ idc = 1603;
+ action = "closeDialog 0;'Camp' spawn placementMode";
+
+ text = "Camp"; //--- ToDo: Localize;
+ x = 0.159687 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Creates a fast travel destination for you and your group"; //--- ToDo: Localize;
+ };
+ class RscButton_1604: RscButton
+ {
+ idc = 1604;
+ action = "closeDialog 0;'Ammobox' spawn placementMode";
+
+ text = "Ammobox"; //--- ToDo: Localize;
+ x = 0.355625 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "An empty ammobox"; //--- ToDo: Localize;
+ };
+ class RscButton_1605: RscButton
+ {
+ idc = 1605;
+ action = "closeDialog 0;'Misc' spawn placementMode";
+
+ text = "Misc"; //--- ToDo: Localize;
+ x = 0.453594 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Miscellaneous (but useful) items"; //--- ToDo: Localize;
+ };
+ class RscButton_1606: RscButton
+ {
+ idc = 1603;
+ action = "closeDialog 0;'Base' spawn placementMode";
+
+ text = "Base"; //--- ToDo: Localize;
+ x = 0.257656 * safezoneW + safezoneX;
+ y = 0.797 * safezoneH + safezoneY;
+ w = 0.0928125 * safezoneW;
+ h = 0.088 * safezoneH;
+ tooltip = "Creates a fast travel destination for all friendlies, allows building of military structures"; //--- ToDo: Localize;
+ };
+ class RscButton_1607: RscButton
+ {
+ idc = 1607;
+ text = "Deploy"; //--- ToDo: Localize;
+ x = 0.422656 * safezoneW + safezoneX;
+ y = 0.687 * safezoneH + safezoneY;
+ w = 0.154687 * safezoneW;
+ h = 0.099 * safezoneH;
+ tooltip = "Deploy a static weapon or rubber boat"; //--- ToDo: Localize;
+ action = "closeDialog 0;'Deploy' spawn placementMode";
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+
+ };
+};
\ No newline at end of file
diff --git a/dialogs/recruits.hpp b/dialogs/recruits.hpp
new file mode 100644
index 00000000..fd97e5a6
--- /dev/null
+++ b/dialogs/recruits.hpp
@@ -0,0 +1,48 @@
+class AIT_dialog_recruits
+{
+ idd=8004;
+ movingenable=false;
+
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Viwapa)
+ ////////////////////////////////////////////////////////
+
+ class RscListbox_1500: RscListbox
+ {
+ idc = 1500;
+ x = 0.206094 * safezoneW + safezoneX;
+ y = 0.258 * safezoneH + safezoneY;
+ w = 0.360937 * safezoneW;
+ h = 0.418 * safezoneH;
+ colorBackground[] = {0,0,0,0.5};
+ onLBSelChanged = "_this call recruitSelected";
+ };
+ class RscStructuredText_1100: RscStructuredText
+ {
+ idc = 1100;
+ x = 0.572187 * safezoneW + safezoneX;
+ y = 0.258 * safezoneH + safezoneY;
+ w = 0.221719 * safezoneW;
+ h = 0.33 * safezoneH;
+ colorBackground[] = {0,0,0,0.5};
+ };
+ class RscButton_1600: RscButton
+ {
+ idc = 1600;
+ text = "Dismiss"; //--- ToDo: Localize;
+ x = 0.711406 * safezoneW + safezoneX;
+ y = 0.599 * safezoneH + safezoneY;
+ w = 0.0825 * safezoneW;
+ h = 0.077 * safezoneH;
+ colorBackground[] = {0.5,0,0,1};
+ colorActive[] = {0.6,0,0,1};
+ action = "_this call dismissRecruit;"
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+
+ }
+}
\ No newline at end of file
diff --git a/dialogs/shop.hpp b/dialogs/shop.hpp
index 0b8206ad..364b099d 100644
--- a/dialogs/shop.hpp
+++ b/dialogs/shop.hpp
@@ -6,7 +6,7 @@ class AIT_dialog_buy
class controls
{
////////////////////////////////////////////////////////
- // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Jeduvu)
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Jeduvu)
////////////////////////////////////////////////////////
class RscListbox_1500: RscListbox
@@ -22,7 +22,7 @@ class AIT_dialog_buy
class RscPicture_1200: RscPicture
{
idc = 1200;
- text = "#(argb,8,8,3)color(1,1,1,1)";
+ text = "";
x = 0.654688 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.237187 * safezoneW;
@@ -66,7 +66,7 @@ class AIT_dialog_sell
class controls
{
////////////////////////////////////////////////////////
- // GUI EDITOR OUTPUT START (by Aaron Static, v1.063, #Zobiki)
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Zobiki)
////////////////////////////////////////////////////////
class RscListbox_1500: RscListbox
diff --git a/dialogs/stats.hpp b/dialogs/stats.hpp
index f2099e77..b955c5ca 100644
--- a/dialogs/stats.hpp
+++ b/dialogs/stats.hpp
@@ -28,12 +28,12 @@ class RscTitles {
w = 0.19 * safezoneW;
h = 0.1 * safezoneH;
size = 0.055;//0.020
- colorBackground[] = {0,0,0,0};
+ colorBackground[] = {0,0,0,0.2};
colorText[] = {0.34,0.33,0.33,0};//{1,1,1,1}
text = "";
- font = "PuristaLight";
+ font = "PuristaMedium";
class Attributes {
- font = "PuristaLight";
+ font = "PuristaMedium";
color = "#C1C0BB";//"#FFFFFF";
align = "RIGHT";
valign = "top";
diff --git a/events/entityKilled.sqf b/events/entityKilled.sqf
index f5f8d58a..2e54b01c 100644
--- a/events/entityKilled.sqf
+++ b/events/entityKilled.sqf
@@ -53,13 +53,13 @@ if(!isNil "_criminal") then {
if(isMultiplayer) then {
format["%1 has killed the gang leader in %2",name _killer,_town] remoteExec ["notify_minor",0,true];
}else{
- format["You killed the gang leader in %2",_town] call notify_minor;
+ format["You killed the gang leader in %1",_town] call notify_minor;
};
}else{
if(side _killer == west) then {
- format["NATO has removed the gang leader in %2",_town] remoteExec ["notify_minor",0,true];
+ format["NATO has removed the gang leader in %1",_town] remoteExec ["notify_minor",0,true];
}else{
- format["The gang leader in %2 is dead",_town] remoteExec ["notify_minor",0,true];
+ format["The gang leader in %1 is dead",_town] remoteExec ["notify_minor",0,true];
};
};
server setVariable [format["CRIMbounty%1",_town],0,true];
diff --git a/factions/CRIM.sqf b/factions/CRIM.sqf
index a360e86f..b06ad390 100644
--- a/factions/CRIM.sqf
+++ b/factions/CRIM.sqf
@@ -47,10 +47,10 @@ while {true} do {
};
_stability = server getVariable format ["stability%1",_town];
if((_stability < 30) || (_town in (server getvariable "NATOabandoned"))) then {
- _time = server getVariable format ["timecrims%1",_town];
- _num = server getVariable format ["numcrims%1",_town];
+ _time = server getVariable [format ["timecrims%1",_town],0];
+ _num = server getVariable [format ["numcrims%1",_town],0];
- _leaderpos = server getVariable format["crimleader%1",_town];
+ _leaderpos = server getVariable [format["crimleader%1",_town],false];
if ((typeName _leaderpos) == "ARRAY") then {
server setVariable [format ["timecrims%1",_x],_time+_sleeptime,false];
if(((random 100) > 80) and _num < 20) then {
@@ -74,6 +74,13 @@ while {true} do {
sleep 0.1;
}foreach (AIT_allTowns);
};
+
+ {
+ if(side _x == east and count (units _x) == 0) then {
+ deleteGroup _x;
+ };
+ }foreach(allGroups);
+
_sleeptime = AIT_CRIMwait + round(random AIT_CRIMwait);
sleep _sleeptime;
};
diff --git a/factions/NATO.sqf b/factions/NATO.sqf
index 6f0710b2..53345d7a 100644
--- a/factions/NATO.sqf
+++ b/factions/NATO.sqf
@@ -14,7 +14,7 @@ if((server getVariable "StartupType") == "NEW") then {
_abandoned pushback _x;
};
}foreach (AIT_allTowns);
- server setVariable ["NATOabandoned",_abandoned,false];
+ server setVariable ["NATOabandoned",_abandoned,true];
server setVariable ["garrisonHQ",1000,false];
{
_airports pushBack text _x;
@@ -34,18 +34,19 @@ if((server getVariable "StartupType") == "NEW") then {
if(_name in AIT_NATO_priority) then {
_garrison = floor(16 + random(8));
};
- server setVariable [format ["garrison%1",_name],_garrison,false];
- server setVariable [format ["vehgarrison%1",_name],[],false];
- server setVariable [format ["airgarrison%1",_name],[],false];
+ server setVariable [format ["garrison%1",_name],_garrison,true];
+ server setVariable [format ["vehgarrison%1",_name],[],true];
+ server setVariable [format ["airgarrison%1",_name],[],true];
};
if(_name == AIT_NATO_HQ) then {
+ hint "yep";
AIT_NATO_HQPos = getpos _x;
};
sleep 0.05;
}foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameLocal","Airport"], 50000]);
- server setVariable ["NATOobjectives",AIT_NATOobjectives];
+ server setVariable ["NATOobjectives",AIT_NATOobjectives,true];
//Randomly distribute NATO's vehicles
{
@@ -58,7 +59,7 @@ if((server getVariable "StartupType") == "NEW") then {
_garrison = server getVariable format["vehgarrison%1",_name];
_garrison pushback _type;
_count = _count + 1;
- server setVariable [format ["vehgarrison%1",_name],_garrison,false];
+ server setVariable [format ["vehgarrison%1",_name],_garrison,true];
};
}foreach(AIT_NATO_Vehicles_Garrison);
@@ -71,7 +72,7 @@ if((server getVariable "StartupType") == "NEW") then {
_garrison = server getVariable format["airgarrison%1",_name];
_garrison pushback _type;
_count = _count + 1;
- server setVariable [format ["airgarrison%1",_name],_garrison,false];
+ server setVariable [format ["airgarrison%1",_name],_garrison,true];
};
}foreach(AIT_NATO_Vehicles_AirGarrison);
@@ -83,7 +84,7 @@ if((server getVariable "StartupType") == "NEW") then {
//_x setMarkerText format ["%1",_garrison];
_x setMarkerAlpha 0;
- server setVariable [format ["garrison%1",_x],_garrison,false];
+ server setVariable [format ["garrison%1",_x],_garrison,true];
sleep 0.05;
}foreach (AIT_NATO_control);
@@ -100,7 +101,7 @@ if((server getVariable "StartupType") == "NEW") then {
_garrison = round(_garrison * 2);
};
};
- server setVariable [format ["garrison%1",_x],_garrison,false];
+ server setVariable [format ["garrison%1",_x],_garrison,true];
server setVariable [format ["garrisonadd%1",_x], 0,false];
sleep 0.05;
}foreach (AIT_allTowns);
@@ -111,6 +112,7 @@ AIT_NATOInitDone = true;
publicVariable "AIT_NATOInitDone";
sleep 5;
{
+ _pos = _x select 0;
_name = _x select 1;
_mrk = createMarker [_name,_pos];
_mrk setMarkerShape "ICON";
@@ -142,14 +144,14 @@ while {true} do {
if(_need < 0) then {_need = 0};
if(_need > 1) then {
server setVariable [format ["garrisonadd%1",_x], 2,false];
- server setVariable [format ["garrison%1",_x],_current+2,false];
+ server setVariable [format ["garrison%1",_x],_current+2,true];
};
}else{
- server setVariable [format ["garrison%1",_town],0,false];
+ server setVariable [format ["garrison%1",_town],0,true];
if(!(_town in _abandoned)) then {
_town spawn NATOattack;
_abandoned pushback _town;
- server setVariable ["NATOabandoned",_abandoned,false];
+ server setVariable ["NATOabandoned",_abandoned,true];
}
};
sleep 0.1;
@@ -165,12 +167,18 @@ while {true} do {
if(_garrison == 0) then {
_name spawn NATOcounter;
_abandoned pushback _name;
- server setVariable ["NATOabandoned",_abandoned,false];
+ server setVariable ["NATOabandoned",_abandoned,true];
_name setMarkerAlpha 1;
};
}
}foreach(AIT_NATOobjectives);
+ {
+ if(side _x == west and count (units _x) == 0) then {
+ deleteGroup _x;
+ };
+ }foreach(allGroups);
+
sleep AIT_NATOwait + round(random AIT_NATOwait);
};
diff --git a/funcs/canPlace.sqf b/funcs/canPlace.sqf
new file mode 100644
index 00000000..f10ba68f
--- /dev/null
+++ b/funcs/canPlace.sqf
@@ -0,0 +1,62 @@
+private ["_canplace","_base","_isbase","_owner","_typecls","_estate","_pos","_typecls"];
+
+_pos = _this select 0;
+_typecls = _this select 1;
+
+_isbase = false;
+_canplace = true;
+
+if(_typecls != "Base") then {
+ _base = _pos call nearestBase;
+ if !(isNil "_base") then {
+ if((_base select 0) distance _pos < 100) then {
+ _isbase = true;
+ };
+ };
+}else{
+ _base = _pos call nearestBase;
+ if !(isNil "_base") then {
+ if((_base select 0) distance _pos < 1500) then {
+ _canplace = false;
+ };
+ };
+};
+
+if(!_canplace) exitWith {false};
+
+if !(_isbase) then {
+ //Building proximity check
+ _estate = _pos call getNearestRealEstate;
+ if(typename _estate == "ARRAY") then {
+ _b = _estate select 0;
+ if(_b call hasOwner) then {
+ _owner = _b getVariable "owner";
+ if(_owner != getplayeruid player) then {
+ if(_typecls != "Camp" and _typecls != "Base") then {
+ _canplace = false;
+ };
+ }else{
+ if(_typecls == "Camp" or _typecls == "Base") then {
+ _canplace = false;
+ };
+ };
+ }else{
+ _canplace = false;
+ };
+ }else{
+ if(_typecls != "Camp" and _typecls != "Base") then {
+ _canplace = false;
+ };
+ };
+};
+
+
+if(_typecls == "Base") then {
+ _town = _pos call nearestTown;
+ _postown = server getVariable _town;
+ _dist = 400;
+ if(_town == "Georgetown") then {_dist = 950};
+ if((_postown distance _pos) < _dist) then {_canplace = false};
+};
+
+_canplace
\ No newline at end of file
diff --git a/funcs/dumpStuff.sqf b/funcs/dumpStuff.sqf
new file mode 100644
index 00000000..fb896f95
--- /dev/null
+++ b/funcs/dumpStuff.sqf
@@ -0,0 +1,48 @@
+private ["_unit","_t"];
+
+_unit = _this select 0;
+_t = _this select 1;
+
+if(headgear _unit != "") then {
+ _t addItemCargo [headgear _unit,1];
+ removeHeadgear _unit;
+};
+if(vest _unit != "") then {
+ _t addItemCargo [vest _unit,1];
+ removeVest _unit;
+};
+if(goggles _unit != "") then {
+ _t addItemCargo [goggles _unit,1];
+ removeGoggles _unit;
+};
+if(primaryWeapon _unit != "") then {
+ {
+ _t addItemCargo [_x,1];
+ _unit removePrimaryWeaponItem _x;
+ }foreach(primaryWeaponItems _unit);
+
+ _t addWeaponCargo [primaryWeapon _unit,1];
+ _unit removeWeapon primaryWeapon _unit;
+};
+if(secondaryWeapon _unit != "") then {
+ {
+ _t addItemCargo [_x,1];
+ _unit removeSecondaryWeaponItem _x;
+ }foreach(secondaryWeaponItems _unit);
+
+ _t addWeaponCargo [secondaryWeapon _unit,1];
+ _unit removeWeapon secondaryWeapon _unit;
+};
+if(handgunWeapon _unit != "") then {
+ {
+ _t addItemCargo [_x,1];
+ _unit removeHandgunItem _x;
+ }foreach(handgunItems _unit);
+
+ _t addWeaponCargo [handgunWeapon _unit,1];
+ _unit removeWeapon handgunWeapon _unit;
+};
+{
+ _unit unlinkItem _x;
+ _t addItemCargo[_x,1];
+}foreach(assignedItems _unit);
\ No newline at end of file
diff --git a/funcs/getNearestOwned.sqf b/funcs/getNearestOwned.sqf
new file mode 100644
index 00000000..61497ba4
--- /dev/null
+++ b/funcs/getNearestOwned.sqf
@@ -0,0 +1,19 @@
+_buildings = _this nearObjects ["Building",30];
+_gotbuilding = false;
+_building = objNULL;
+_sorted = [_buildings,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
+{
+ if ((typeof _x) in AIT_allBuyableBuildings and _x call hasOwner) then {
+ _owner = _x getVariable "owner";
+ if(_owner == getplayeruid player) then {
+ _gotbuilding = true;
+ _building = _x;
+ };
+ };
+ if(_gotbuilding) exitWith{};
+}foreach(_sorted);
+_ret = false;
+if(_gotbuilding) then {
+ _ret = _building;
+};
+_ret
\ No newline at end of file
diff --git a/funcs/getNearestRealEstate.sqf b/funcs/getNearestRealEstate.sqf
new file mode 100644
index 00000000..3c9381b6
--- /dev/null
+++ b/funcs/getNearestRealEstate.sqf
@@ -0,0 +1,49 @@
+private ["_buildings","_building","_gotbuilding","_price","_lease","_sell","_totaloccupants"];
+
+_buildings = _this nearObjects ["Building",30];
+_gotbuilding = false;
+_building = objNULL;
+_price = 0;
+_lease = 0;
+_sell = 0;
+_totaloccupants = 0;
+_sorted = [_buildings,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
+
+if(!isNil "modeTarget") then {
+ _sorted = _sorted - [modeTarget];
+};
+
+{
+ if ((typeof _x) in AIT_allBuyableBuildings) exitWith {
+ _gotbuilding = true;
+ _town = (getpos _x) call nearestTown;
+ _stability = ((server getVariable format["stability%1",_town]) / 100);
+ _population = server getVariable format["population%1",_town];
+ if(_population > 1000) then {_population = 1000};
+ _population = (_population / 1000);
+ _totaloccupants = 1;
+
+ _baseprice = 400;
+ _type = typeof _x;
+ if !(_type in AIT_spawnHouses) then {
+ call {
+ if(_type in AIT_lowPopHouses) exitWith {_baseprice = 1000;_totaloccupants=4};
+ if(_type in AIT_mansions) exitWith {_baseprice = 25000;_totaloccupants=5;};
+ if(_type in AIT_medPopHouses) exitWith {_baseprice = 5000;_totaloccupants=6};
+ if(_type in AIT_highPopHouses) exitWith {_baseprice = 5000;_totaloccupants=12};
+ if(_type in AIT_hugePopHouses) exitWith {_baseprice = 5000;_totaloccupants=50};
+ };
+ };
+ _price = _baseprice + ((_baseprice * _stability * _population) * (1+AIT_standardMarkup));
+ _sell = _baseprice + (_baseprice * _stability * _population);
+ _lease = round((_stability * _population) * (_baseprice * 0.15));
+ if(_lease < 5) then {_lease = 5};
+
+ _building = _x;
+ };
+}foreach(_sorted);
+_ret = false;
+if(_gotbuilding) then {
+ _ret = [_building,_price,_sell,_lease,_totaloccupants];
+};
+_ret
\ No newline at end of file
diff --git a/funcs/getPrice.sqf b/funcs/getPrice.sqf
index d0373d2b..af840165 100644
--- a/funcs/getPrice.sqf
+++ b/funcs/getPrice.sqf
@@ -16,7 +16,7 @@ if(_cls in (AIT_allWeapons + AIT_allMagazines + AIT_illegalItems)) then {
_baseprice = _cost select 0;
_stability = 1.0 - ((server getVariable format["stability%1",_town]) / 100);
- _population = server getVariable format["stability%1",_town];
+ _population = server getVariable format["population%1",_town];
if(_population > 1000) then {_population = 1000};
_population = 1-(_population / 1000);
diff --git a/funcs/giveIntel.sqf b/funcs/giveIntel.sqf
new file mode 100644
index 00000000..e4623bf2
--- /dev/null
+++ b/funcs/giveIntel.sqf
@@ -0,0 +1,77 @@
+private ["_handled","_player","_civ","_pos","_rnd","_txt"];
+
+_player = _this select 0;
+_civ = _this select 1;
+
+_pos = getpos _player;
+
+_rnd = random 100;
+_txt = "";
+_handled = false;
+call {
+ if(_rnd > 95) exitWith {
+ //Release the vehicle garrison of a nearby objective
+ _objective = _pos call nearestObjective;
+ _loc = _objective select 0;
+ _name = _objective select 1;
+ _handled = true;
+
+ _garrison = server getvariable format["vehgarrison%1",_name];
+ if(count _garrison > 0) then{
+ _cls = _garrison call BIS_fnc_selectRandom;
+ _vehname = _cls call ISSE_Cfg_Vehicle_GetName;
+ _txt = format["I saw a %1 at %2.",_vehname,_name];
+ }else{
+ _txt = format["I don't know what happened to all the tanks they had over at %1.",_name];
+ };
+ _name setMarkerAlpha 1;
+ };
+ if(_rnd > 80) exitWith {
+ //Release the garrison size of a nearby objective
+ _objective = _pos call nearestObjective;
+ _loc = _objective select 0;
+ _name = _objective select 1;
+ _handled = true;
+
+ _garrison = server getvariable format["garrison%1",_name];
+
+ _txt = format["I saw %1 military guys over at %2.",_garrison,_name];
+ _name setMarkerAlpha 1;
+ };
+ if(_rnd > 60) exitWith {
+ //Release the location of a nearby objective
+ _objective = _pos call nearestObjective;
+ _loc = _objective select 0;
+ _name = _objective select 1;
+ _handled = true;
+
+ _txt = format["I saw a bunch of military guys over at %1. I'll put it on your map.",_name];
+ _name setMarkerAlpha 1;
+ };
+ if(_rnd > 40) exitWith {
+ //Release the garrison size of this town
+ _handled = true;
+ _town = _pos call nearestTown;
+ _garrison = server getvariable format["garrison%1",_town];
+ if(_garrison > 0) then {
+ _txt = format["I've seen about %1 Gendarmerie in %2 recently",_garrison,_town];
+ }else{
+ _txt = "I haven't seen any of those guys in blue for a while";
+ };
+ };
+ //Release the approximate location of a nearby gendarm
+ {
+ if(side _x == west) exitWith {
+ _handled = true;
+ _txt = "I saw a guy just now, I'll put it on your map";
+ player reveal [(leader group _x),1.5];
+ };
+ }foreach(_pos nearentities ["Man",250]);
+
+};
+
+if !(_handled) then {
+ _txt = "I'd love to help you, but I just can't";
+};
+
+_civ globalChat _txt;
\ No newline at end of file
diff --git a/funcs/nearestBase.sqf b/funcs/nearestBase.sqf
new file mode 100644
index 00000000..664984e1
--- /dev/null
+++ b/funcs/nearestBase.sqf
@@ -0,0 +1,6 @@
+_pos = _this;
+_obj = server getVariable ["bases",[]];
+
+_sorted = [_obj,[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy;
+
+_sorted select 0;
\ No newline at end of file
diff --git a/funcs/nearestObjective.sqf b/funcs/nearestObjective.sqf
new file mode 100644
index 00000000..a7cc2f68
--- /dev/null
+++ b/funcs/nearestObjective.sqf
@@ -0,0 +1,6 @@
+_pos = _this;
+_obj = server getVariable "NATOobjectives";
+
+_sorted = [_obj,[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy;
+
+_sorted select 0;
\ No newline at end of file
diff --git a/funcs/spawnTemplate.sqf b/funcs/spawnTemplate.sqf
index 2bc8dd35..e87cc915 100644
--- a/funcs/spawnTemplate.sqf
+++ b/funcs/spawnTemplate.sqf
@@ -28,7 +28,8 @@ _objects = [];
_pos = [(_buildingpos select 0)+(_rel select 0),(_buildingpos select 1)+(_rel select 1),(_buildingpos select 2)+(_rel select 2)];
- _o = _type createVehicle _pos;
+ //_o = _type createVehicle _pos;
+ _o = createVehicle [_type, [0,0,0], [], 0, "CAN_COLLIDE"];
//_o enableSimulationGlobal false;
_o setPos _pos;
_dir = _dir + _bdir;
diff --git a/funcs/takeStuff.sqf b/funcs/takeStuff.sqf
new file mode 100644
index 00000000..e3ae7fe7
--- /dev/null
+++ b/funcs/takeStuff.sqf
@@ -0,0 +1,67 @@
+private ["_unit","_t"];
+
+_unit = _this select 0;
+_t = _this select 1;
+
+{
+ _count = 0;
+ _cls = _x select 0;
+ _full = false;
+ while {_count < (_x select 1)} do {
+ if !([_unit,_cls] call canFit) exitWith {
+ _full = true;
+ };
+
+ if(_cls in AIT_allMagazines) then {
+ hint _cls;
+ _unit addMagazineCargo [_cls,1];
+ }else{
+ _unit addItemCargo [_cls,1];
+ };
+ _count = _count + 1;
+ };
+ if(_full) exitWith {};
+}foreach(_unit call unitStock);
+
+if(headgear _unit != "") then {
+ _t addHeadgear headgear _unit;
+ removeHeadgear _unit;
+};
+if(vest _unit != "") then {
+ _t addVest vest _unit;
+ removeVest _unit;
+};
+if(goggles _unit != "") then {
+ _t addGoggles goggles _unit;
+ removeGoggles _unit;
+};
+if(primaryWeapon _unit != "") then {
+ _t addWeapon primaryWeapon _unit;
+ {
+ _t addPrimaryWeaponItem _x;
+ _unit removePrimaryWeaponItem _x;
+ }foreach(primaryWeaponItems _unit);
+ _unit removeWeapon primaryWeapon _unit;
+};
+if(secondaryWeapon _unit != "") then {
+ _t addWeapon secondaryWeapon _unit;
+ {
+ _t addSecondaryWeaponItem _x;
+ _unit removeSecondaryWeaponItem _x;
+ }foreach(secondaryWeaponItems _unit);
+
+ _t addWeaponCargo [secondaryWeapon _unit,1];
+ _unit removeWeapon secondaryWeapon _unit;
+};
+if(handgunWeapon _unit != "") then {
+ _t addWeapon handgunWeapon _unit;
+ {
+ _t addHandgunItem _x;
+ _unit removeHandgunItem _x;
+ }foreach(handgunItems _unit);
+ _unit removeWeapon handgunWeapon _unit;
+};
+{
+ _unit unlinkItem _x;
+ _t linkItem _x;
+}foreach(assignedItems _unit);
\ No newline at end of file
diff --git a/income.sqf b/income.sqf
new file mode 100644
index 00000000..1b5b15e9
--- /dev/null
+++ b/income.sqf
@@ -0,0 +1,31 @@
+//Manages passive income for all players (Lease + taxes)
+_lasthour = 0;
+while {true} do {
+ _lasthour = date select 3;
+ _total = 0;
+ {
+ _town = _x;
+ if(_town in AIT_allTowns) then {
+ _population = server getVariable format["population%1",_town];
+ _stability = server getVariable format["stability%1",_town];
+ _add = round(_population * (_stability/100));
+ if(_stability > 49) then {
+ _add = round(_add * 2);
+ };
+ _total = _total + _add;
+ };
+ }foreach(server getVariable ["NATOabandoned",[]]);
+
+ _numPlayers = count(allPlayers);
+ _perPlayer = round(_total / _numPlayers);
+ if(_perPlayer > 0) then {
+ {
+ _money = _x getVariable ["money",0];
+ _x setVariable ["money",_money+_perPlayer];
+ }foreach(allPlayers);
+ format ["Tax income: $%1",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["notify_good",0,true];
+ };
+
+ waitUntil {sleep 5;(date select 3) != _lasthour}; //do actions on the hour
+};
+
diff --git a/initEconomy.sqf b/initEconomy.sqf
index a72e229e..e84adb5e 100644
--- a/initEconomy.sqf
+++ b/initEconomy.sqf
@@ -54,7 +54,7 @@ private ["_mSize","_name","_low","_med","_hi","_huge","_shops","_allshops","_pos
};
_stability = round(_base + random(20));
if((_pop < 40) and !(_name in AIT_NATO_priority) and !(_name in AIT_Capitals) and (_pos select 1 < 7000)) then {
- _stability = floor(4 + random(30));
+ _stability = floor(10 + random(20));
};
server setVariable [format["stability%1",_name],_stability,true];
diff --git a/initEconomyLoad.sqf b/initEconomyLoad.sqf
index b4c126ce..e4032146 100644
--- a/initEconomyLoad.sqf
+++ b/initEconomyLoad.sqf
@@ -1,9 +1,18 @@
{_x setMarkerAlpha 0} foreach AIT_regions;
+//Find NATO HQ
+{
+ _name = text _x;
+ if(_name == AIT_NATO_HQ) then {
+ AIT_NATO_HQPos = getpos _x;
+ };
+}foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameLocal","Airport"], 50000]);
+
//Stability markers
{
_stability = server getVariable format["stability%1",_x];
_pos = server getVariable _x;
+ _pos = [_pos,40,-90] call BIS_fnc_relPos;
_mSize = 250;
if(_x in AIT_Capitals) then {
@@ -20,6 +29,19 @@
}else{
_mrk setMarkerAlpha 0;
};
+ _mrk = createMarker [format["%1-abandon",_x],_pos];
+ _mrk setMarkerShape "ICON";
+ _mrk setMarkerType "mil_dot";
+ if(_stability < 50) then {
+ _mrk setMarkerColor "ColorOPFOR";
+ }else{
+ _mrk setMarkerColor "ColorGUER";
+ };
+ if(_x in (server getVariable ["NATOabandoned",[]])) then {
+ _mrk setMarkerAlpha 1;
+ }else{
+ _mrk setMarkerAlpha 0;
+ };
}foreach(AIT_allTowns);
//Temporary place for stuff that isnt saved in the persistent save
@@ -27,13 +49,15 @@
{
_posTown = server getVariable _x;
_town = _x;
+ _key = format["shopsin%1",_town];
+ server setVariable [_key,0,true];
{
if !(_x call hasOwner) then {
//spawn any main shops
if((random 100 > 20)) then {
AIT_activeShops pushback _x;
};
- _key = format["shopsin%1",_town];
+
server setVariable [_key,(server getVariable [_key,0])+1,true];
};
}foreach(nearestObjects [_posTown, AIT_shops, 700]);
diff --git a/initFuncs.sqf b/initFuncs.sqf
index 0192c2fd..62432506 100644
--- a/initFuncs.sqf
+++ b/initFuncs.sqf
@@ -16,10 +16,18 @@ unitStock = compileFinal preProcessFileLineNumbers "funcs\unitStock.sqf";
hasOwner = compileFinal preProcessFileLineNumbers "funcs\hasOwner.sqf";
getRandomBuildingPosition = compileFinal preProcessFileLineNumbers "funcs\getRandomBuildingPosition.sqf";
getRandomBuilding = compileFinal preProcessFileLineNumbers "funcs\getRandomBuilding.sqf";
+getNearestRealEstate = compileFinal preProcessFileLineNumbers "funcs\getNearestRealEstate.sqf";
+getNearestOwned = compileFinal preProcessFileLineNumbers "funcs\getNearestOwned.sqf";
nearestPositionRegion = compileFinal preProcessFileLineNumbers "funcs\nearestPositionRegion.sqf";
+nearestObjective = compileFinal preProcessFileLineNumbers "funcs\nearestObjective.sqf";
+nearestBase = compileFinal preProcessFileLineNumbers "funcs\nearestBase.sqf";
+giveIntel = compileFinal preProcessFileLineNumbers "funcs\giveIntel.sqf";
logisticsUnload = compileFinal preProcessFileLineNumbers "funcs\logisticsUnload.sqf";
eject = compileFinal preProcessFileLineNumbers "funcs\addons\eject.sqf";
displayShopPic = compileFinal preProcessFileLineNumbers "funcs\displayShopPic.sqf";
+dumpStuff = compileFinal preProcessFileLineNumbers "funcs\dumpStuff.sqf";
+takeStuff = compileFinal preProcessFileLineNumbers "funcs\takeStuff.sqf";
+canPlace = compileFinal preProcessFileLineNumbers "funcs\canPlace.sqf";
//AI init
initCivilian = compileFinal preProcessFileLineNumbers "AI\civilian.sqf";
@@ -35,6 +43,16 @@ initShopkeeper = compileFinal preProcessFileLineNumbers "AI\shopkeeper.sqf";
initCarDealer = compileFinal preProcessFileLineNumbers "AI\carDealer.sqf";
initGunDealer = compileFinal preProcessFileLineNumbers "AI\gunDealer.sqf";
civilianGroup = compileFinal preProcessFileLineNumbers "AI\civilianGroup.sqf";
+initRecruit = compileFinal preProcessFileLineNumbers "AI\recruit.sqf";
+
+//AI Orders
+openInventory = compileFinal preProcessFileLineNumbers "AI\orders\openInventory.sqf";
+loot = compileFinal preProcessFileLineNumbers "AI\orders\loot.sqf";
+
+//UI
+mainMenu = compileFinal preProcessFileLineNumbers "UI\mainMenu.sqf";
+buildMenu = compileFinal preProcessFileLineNumbers "UI\buildMenu.sqf";
+manageRecruits = compileFinal preProcessFileLineNumbers "UI\manageRecruits.sqf";
//QRF
NATOattack = compileFinal preProcessFileLineNumbers "AI\QRF\NATOattack.sqf";
@@ -55,10 +73,11 @@ sendCrims = compileFinal preProcessFileLineNumbers "spawners\insertion\sendCrims
newLeader = compileFinal preProcessFileLineNumbers "spawners\insertion\newLeader.sqf";
logistics = compileFinal preProcessFileLineNumbers "spawners\insertion\logistics.sqf";
-//AI interactions
+//Local interactions
initShopLocal = compileFinal preProcessFileLineNumbers "interaction\initShopLocal.sqf";
initCarShopLocal = compileFinal preProcessFileLineNumbers "interaction\initCarShopLocal.sqf";
initGunDealerLocal = compileFinal preProcessFileLineNumbers "interaction\initGunDealerLocal.sqf";
+initObjectLocal = compileFinal preProcessFileLineNumbers "interaction\initObjectLocal.sqf";
//Economy agents
run_shop = compileFinal preProcessFileLineNumbers "economy\shop.sqf";
@@ -78,10 +97,13 @@ rearmGroup = compileFinal preProcessFileLineNumbers "actions\rearmGroup.sqf";
recruitSoldier = compileFinal preProcessFileLineNumbers "actions\recruitSoldier.sqf";
fastTravel = compileFinal preProcessFileLineNumbers "actions\fastTravel.sqf";
setHome = compileFinal preProcessFileLineNumbers "actions\setHome.sqf";
-buyAmmobox = compileFinal preProcessFileLineNumbers "actions\buyAmmobox.sqf";
giveMoney = compileFinal preProcessFileLineNumbers "actions\giveMoney.sqf";
saveGamePersistent = compileFinal preProcessFileLineNumbers "actions\saveGame.sqf";
loadGamePersistent = compileFinal preProcessFileLineNumbers "actions\loadGame.sqf";
+getIntel = compileFinal preProcessFileLineNumbers "actions\getIntel.sqf";
+
+//Modes
+placementMode = compileFinal preProcessFileLineNumbers "actions\placementMode.sqf";
//Wanted System
unitSeen = compileFinal preProcessFileLineNumbers "funcs\unitSeen.sqf";
@@ -149,16 +171,26 @@ money = {
stability = {
_town = _this select 0;
+
+ _townmrk = format["%1-abandon",_town];
_stability = (server getVariable format["stability%1",_town])+(_this select 1);
if(_stability < 0) then {_stability = 0};
server setVariable [format["stability%1",_town],_stability,true];
- //update the marker
+ _abandoned = server getVariable "NATOabandoned";
+ if(_town in _abandoned) then {
+ _townmrk setMarkerAlpha 1;
+ }else{
+ _townmrk setMarkerAlpha 0;
+ };
+
+ //update the markers
if(_stability < 50) then {
_town setMarkerColor "ColorRed";
_town setMarkerAlpha 1.0 - (_stability / 50);
+ _townmrk setMarkerColor "ColorOPFOR";
}else{
- _abandoned = server getVariable "NATOabandoned";
+ _townmrk setMarkerColor "ColorGUER";
if(_town in _abandoned) then {
_town setMarkerAlpha ((_stability - 50) / 100);
_town setMarkerColor "ColorGreen";
@@ -166,6 +198,7 @@ stability = {
_town setMarkerAlpha 0;
};
}
+
};
KK_fnc_fileExists = {
@@ -180,24 +213,24 @@ KK_fnc_fileExists = {
notify = {
_txt = format ["%1",_this];
- [_txt, 0.8, 0.2, 5, 0, 0, 2] spawn bis_fnc_dynamicText;
+ [_txt, 0.8, 0.2, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
notify_good = {
playSound "3DEN_notificationDefault";
_txt = format ["%1",_this];
- [_txt, 0, -0.2, 5, 0, 0, 2] spawn bis_fnc_dynamicText;
+ [_txt, 0, -0.2, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
notify_minor = {
playSound "ClickSoft";
_txt = format ["%1",_this];
- [_txt, 0, -0.2, 5, 0, 0, 2] spawn bis_fnc_dynamicText;
+ [_txt, 0, -0.2, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
notify_talk = {
_txt = format ["%1",_this];
- [_txt, 0, -0.2, 5, 0, 0, 2] spawn bis_fnc_dynamicText;
+ [_txt, 0, -0.2, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
[] execVM "funcs\info.sqf";
diff --git a/initPlayerLocal.sqf b/initPlayerLocal.sqf
index 4be986a5..4a725596 100644
--- a/initPlayerLocal.sqf
+++ b/initPlayerLocal.sqf
@@ -11,7 +11,7 @@ removeVest player;
player linkItem "ItemMap";
-
+server setVariable [format["name%1",getplayeruid player],name player,true];
if(isMultiplayer and (!isServer)) then {
call compile preprocessFileLineNumbers "initFuncs.sqf";
@@ -29,6 +29,7 @@ if(player == bigboss) then {
};
waitUntil {sleep 1;server getVariable ["StartupType",""] != ""};
+_startup = server getVariable "StartupType";
_newplayer = true;
_furniture = [];
_town = "";
@@ -49,7 +50,7 @@ player addEventHandler ["HandleDamage", {
_dmg;
}];
-if(isMultiplayer || (server getVariable "StartupType") == "LOAD") then {
+if(isMultiplayer or _startup == "LOAD") then {
_data = server getvariable (getplayeruid player);
if !(isNil "_data") then {
_newplayer = false;
@@ -59,6 +60,13 @@ if(isMultiplayer || (server getVariable "StartupType") == "LOAD") then {
if(_key == "home") then {
_val = nearestBuilding _val;
};
+ if(_key == "camp" and typename _val == "ARRAY") then {
+ _val = createVehicle [AIT_item_tent, _val, [], 0, "CAN_COLLIDE"];
+ _val setVariable ["owner",getplayeruid player,true];
+ _val call initObjectLocal;
+
+ _v = "Land_ClutterCutter_large_F" createVehicle (getpos _val);
+ };
if(_key == "owned") then {
_d = [];
{
@@ -95,6 +103,31 @@ if(isMultiplayer || (server getVariable "StartupType") == "LOAD") then {
};
};
}foreach(_housepos nearObjects 50);
+
+ _recruits = server getVariable ["recruits",[]];
+ _newrecruits = [];
+ {
+ _owner = _x select 0;
+ _name = _x select 1;
+ _civ = _x select 2;
+ _rank = _x select 3;
+ _loadout = _x select 4;
+ _type = _x select 5;
+ if(_owner == (getplayeruid player)) then {
+ if(typename _civ == "ARRAY") then {
+ _civ = group player createUnit [_type,_civ,[],0,"NONE"];
+ _civ setUnitLoadout _loadout;
+ _civ spawn wantedSystem;
+ _civ setName _name;
+ }else{
+ [_civ] joinSilent (group player);
+ };
+ };
+ _newrecruits pushback [_owner,_name,_civ,_rank,_loadout,_type];
+ }foreach (_recruits);
+ server setVariable ["recruits",_newrecruits,true];
+ }else{
+ //hint "New Player";
};
//JIP interactions
@@ -168,6 +201,9 @@ if (_newplayer) then {
_furniture = (_house call spawnTemplate) select 0;
{
+ if(typeof _x == AIT_item_Map) then {
+ _x setObjectTextureGlobal [0,"dialogs\maptanoa.paa"];
+ };
if(typeof _x == AIT_item_Storage) then {
_x addWeaponCargo [AIT_item_BasicGun,1];
_x addMagazineCargo [AIT_item_BasicAmmo,5];
@@ -196,21 +232,13 @@ if (_newplayer) then {
};
{
- if(typeof _x == AIT_item_Map) then {
- _x addAction ["Town Info", "actions\townInfo.sqf",nil,0,false,true,"",""];
- _x addAction ["Most Wanted", "actions\mostWanted.sqf",nil,0,false,true,"",""];
- if(player == bigboss) then {
- _x addAction ["Options", {
- closedialog 0;
- _nul = createDialog "AIT_dialog_options";
- },nil,0,false,true,"",""];
+ if(_x call hasOwner) then {
+ _owner = _x getVariable ["owner",""];
+ if(_owner == getplayeruid player) then {
+ _x call initObjectLocal;
};
- };
- if(typeof _x == AIT_item_Repair) then {
- _x addAction ["Repair Nearby Vehicles", "actions\repairAll.sqf",nil,0,false,true,"",""];
- };
- _x addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
-}foreach(_furniture);
+ };
+}foreach(entities "");
player setCaptive true;
player setPos _housepos;
@@ -222,5 +250,5 @@ if (isMultiplayer) then {
};
[] spawn setupKeyHandler;
-
+[] execVM "intelSystem.sqf";
[] execVM "setupPlayer.sqf";
\ No newline at end of file
diff --git a/initServer.sqf b/initServer.sqf
index 5401e52b..7d08b51c 100644
--- a/initServer.sqf
+++ b/initServer.sqf
@@ -1,3 +1,9 @@
+if(AIT_fastTime) then {
+ setTimeMultiplier 4;
+};
+[] execVM "weather.sqf";
+[] execVM "income.sqf";
+
if (!isMultiplayer) exitWith {};
//VCOM AI, huge credits to Genesis, without VCOM this mission would be so much less
diff --git a/initVar.sqf b/initVar.sqf
index 7608adbe..dbbb9c51 100644
--- a/initVar.sqf
+++ b/initVar.sqf
@@ -7,7 +7,7 @@ AIT_hasAce = false;
if (!isNil "ace_common_settingFeedbackIcons") then {
AIT_hasAce = true;
};
-
+AIT_fastTime = true; //When true, 1 day will last 6 hrs real time
AIT_spawnDistance = 1200;
AIT_spawnCivPercentage = 0.08;
AIT_spawnVehiclePercentage = 0.04;
@@ -16,12 +16,36 @@ AIT_randomSpawnTown = false; //if true, every player will start in a different t
AIT_distroThreshold = 500; //Size a towns order must be before a truck is sent (in dollars)
AIT_saving = false;
-AIT_spawnTowns = ["Balavu","Rautake","Tavu","Yanukka","Tobakoro","Bua Bua","Saioko","Doodstil","Harcourt","Lijnhaven","Katkoula","Moddergat"]; //Towns where new players will spawn
+AIT_spawnTowns = ["Balavu","Rautake","Tavu","Yanukka","Tobakoro","Bua Bua","Saioko","Doodstil","Harcourt","Lijnhaven","Moddergat"]; //Towns where new players will spawn
AIT_spawnHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Native_02_F"]; //Houses where new players will spawn
-AIT_NATOwait = 300; //Half the Average time between NATO orders
+AIT_NATOwait = 20; //Half the Average time between NATO orders
AIT_CRIMwait = 200; //Half the Average time between crim changes
+//Interactable items that spawn in your house
+AIT_item_Storage = "B_CargoNet_01_ammo_F"; //Your spawn ammobox
+AIT_item_Desk = "OfficeTable_01_new_F"; //Your spawn desk
+AIT_item_Radio = "Land_PortableLongRangeRadio_F";
+AIT_item_Map = "Land_MapBoard_F";
+AIT_item_Repair = "Land_ToolTrolley_02_F";
+AIT_item_Tent = "Land_TentDome_F";
+AIT_item_Flag = "Flag_HorizonIslands_F";
+
+AIT_Placeables = [
+ ["Sandbags",20,["Land_BagFence_01_long_green_F","Land_BagFence_01_short_green_F","Land_BagFence_01_round_green_F","Land_BagFence_01_corner_green_F","Land_BagFence_01_end_green_F"],[0,3,0.8]],
+ ["Camo Nets",40,["CamoNet_ghex_F","CamoNet_ghex_open_F","CamoNet_ghex_big_F"],[0,7,2]],
+ ["Barriers",60,["Land_HBarrier_01_line_5_green_F","Land_HBarrier_01_line_3_green_F","Land_HBarrier_01_line_1_green_F"],[0,4,1.2]],
+ ["Misc",30,[AIT_item_Map,AIT_item_Repair,"Land_PortableLight_single_F","Land_PortableLight_double_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F","PortableHelipadLight_01_green_F","PortableHelipadLight_01_red_F","PortableHelipadLight_01_white_F","PortableHelipadLight_01_yellow_F","Land_Campfire_F"],[0,2,1.2]],
+ ["Deploy",500,["C_Rubberboat","I_HMG_01_high_F","I_HMG_01_F"],[0,2.3,2]]
+];
+
+AIT_Buildables_Base = [
+ ["Training Camp",1500,[] call compileFinal preProcessFileLineNumbers "templates\military\trainingCamp.sqf","structures\trainingCamp.sqf",true,"Allows training of recruits and hiring of mercenaries"],
+ ["Bunkers",500,["Land_BagBunker_01_small_green_F","Land_HBarrier_01_big_tower_green_F","Land_HBarrier_01_tower_green_F"],"",false,"Small Defensive Structures. Press space to change type."],
+ ["Walls",200,["Land_ConcreteWall_01_l_8m_F","Land_ConcreteWall_01_l_gate_F","Land_HBarrier_01_wall_6_green_F","Land_HBarrier_01_wall_4_green_F","Land_HBarrier_01_wall_corner_green_F"],"",false,"Stop people (or tanks) from getting in. Press space to change type."],
+ ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Apparently helicopter pilots need to be told where they are allowed to land"]
+];
+
AIT_civTypes_gunDealers = ["CUP_C_C_Profiteer_01","CUP_C_C_Profiteer_02","CUP_C_C_Profiteer_03","CUP_C_C_Profiteer_04"];
AIT_civTypes_locals = ["C_Man_casual_1_F_tanoan","C_Man_casual_2_F_tanoan","C_Man_casual_3_F_tanoan","C_man_sport_1_F_tanoan","C_man_sport_2_F_tanoan","C_man_sport_3_F_tanoan","C_Man_casual_4_F_tanoan","C_Man_casual_5_F_tanoan","C_Man_casual_6_F_tanoan"];
AIT_civTypes_expats = ["CUP_C_C_Citizen_02","CUP_C_C_Citizen_01","CUP_C_C_Citizen_04","CUP_C_C_Citizen_03","CUP_C_C_Rocker_01","CUP_C_C_Rocker_03","CUP_C_C_Rocker_02","CUP_C_C_Rocker_04","C_man_p_beggar_F","C_man_1","C_Man_casual_1_F","C_Man_casual_2_F","C_Man_casual_3_F","C_man_sport_1_F","C_man_sport_2_F","C_man_sport_3_F","C_Man_casual_4_F","C_Man_casual_5_F","C_Man_casual_6_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F","C_man_shorts_1_F","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_p_beggar_F_asia","C_Man_casual_1_F_asia","C_Man_casual_2_F_asia","C_Man_casual_3_F_asia","C_man_sport_1_F_asia","C_man_sport_2_F_asia","C_man_sport_3_F_asia","C_Man_casual_4_F_asia","C_Man_casual_5_F_asia","C_Man_casual_6_F_asia","C_man_polo_1_F_asia","C_man_polo_2_F_asia","C_man_polo_3_F_asia","C_man_polo_4_F_asia","C_man_polo_5_F_asia","C_man_polo_6_F_asia","C_man_shorts_1_F_asia"];
@@ -52,24 +76,12 @@ if(AIT_hasAce) then {
AIT_illegalItems = [];
};
-//Player items
-AIT_item_Main = "Land_Laptop_unfolded_F"; //object for main interactions at owned houses
-AIT_item_Secondary = "Land_PortableLongRangeRadio_F"; //object for secondary interactions at owned houses (not used yet, may be a mid game thing)
-AIT_items_Sleep = ["CUP_vojenska_palanda"]; //Items with the "sleep" interaction (Single player only)
-AIT_items_Heal = ["Land_WaterCooler_01_old_F"]; //Where the player can heal themselves
-AIT_items_Repair = ["Toolkit"]; //Inventory items that can be used to repair vehicles
-//Interactable items that spawn in your house
-AIT_item_Storage = "B_CargoNet_01_ammo_F"; //Your spawn ammobox
-AIT_item_Desk = "OfficeTable_01_new_F"; //Your spawn desk
-AIT_item_Radio = "Land_PortableLongRangeRadio_F";
-AIT_item_Map = "Land_MapBoard_F";
-AIT_item_Repair = "Land_ToolTrolley_02_F";
AIT_items_distroStorage = ["CargoNet_01_box_F"]; //Where distribution centers store inventory
AIT_items_Simulate = ["Box_NATO_Equip_F","Box_T_East_Wps_F","B_CargoNet_01_ammo_F","OfficeTable_01_old_F","Land_PortableLongRangeRadio_F"]; //These will be saved, position + inventory and have gravity
-AIT_staticMachineGuns = ["B_HMG_01_high_F"];
+AIT_staticMachineGuns = ["B_HMG_01_F","B_HMG_01_high_F","I_HMG_01_high_F","I_HMG_01_F"];
AIT_clothes_locals = ["CUP_U_I_GUE_Anorak_01","CUP_U_I_GUE_Anorak_02","CUP_U_I_GUE_Anorak_03","U_I_C_Soldier_Bandit_2_F","U_I_C_Soldier_Bandit_3_F","U_C_Poor_1"];
AIT_clothes_expats = ["U_I_C_Soldier_Bandit_5_F","U_C_Poloshirt_blue","U_C_Poloshirt_burgundy","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_stripped","U_C_Man_casual_6_F","U_C_Man_casual_4_F","U_C_Man_casual_5_F"];
@@ -155,7 +167,8 @@ if(AIT_hasAce) then {
["ACE_EarPlugs",5,0,0,0.2],
["ACE_Sandbag_empty",2,0,0,0],
["ACE_Altimeter",110,0,0,1],
- ["ACE_Banana",1,0,0,0]
+ ["ACE_Banana",1,0,0,0],
+ ["ACE_microDAGR",200,0,0,1]
]] call BIS_fnc_arrayPushStack;
}else{
[AIT_items,[
@@ -192,7 +205,7 @@ AIT_backpacks = [
["B_Bergen_dgtl_F",100,0,0,1],
["B_Bergen_hex_F",100,0,0,1]
];
-AIT_vehicles = [
+AIT_vehicles = [
["CUP_C_Skoda_Blue_CIV",30,1,1,1],
["CUP_C_Skoda_Green_CIV",30,1,1,1],
["CUP_C_Skoda_Red_CIV",30,1,1,1],
@@ -217,7 +230,7 @@ AIT_vehicles = [
["C_Truck_02_box_F",2500,1,1,1]
];
-AIT_allVehicles = [];
+AIT_allVehicles = ["C_Rubberboat"];
AIT_allItems = [];
AIT_allWeapons = [];
AIT_allMagazines = [];
@@ -247,6 +260,7 @@ _allLaunchers = "
{ getNumber ( _x >> ""type"" ) isEqualTo 4 } } )
" configClasses ( configFile >> "cfgWeapons" );
+AIT_allSubMachineGuns = [];
AIT_allAssaultRifles = [];
AIT_allMachineGuns = [];
AIT_allSniperRifles = [];
@@ -257,8 +271,18 @@ AIT_allRocketLaunchers = [];
{
_name = configName _x;
_name = [_name] call BIS_fnc_baseWeapon;
-
- _magazines = getArray (configFile / "CfgWeapons" / _name / "magazines");
+
+ _short = getText (configFile >> "CfgWeapons" >> _name >> "descriptionShort");
+
+ _s = _short splitString ":";
+ _caliber = " 5.56";
+ _haslauncher = false;
+ if(count _s > 1) then{
+ _s = (_s select 1) splitString "x";
+ _caliber = _s select 0;
+ };
+
+ _magazines = getArray (configFile >> "CfgWeapons" >> _name >> "magazines");
{
if !(_x in AIT_allMagazines) then {
AIT_allMagazines pushback _x;
@@ -267,19 +291,44 @@ AIT_allRocketLaunchers = [];
_weapon = [_name] call BIS_fnc_itemType;
_weaponType = _weapon select 1;
+
+ _muzzles = getArray (configFile >> "CfgWeapons" >> _name >> "muzzles");
+ {
+ if((_x find "EGLM") > -1) then {
+ _haslauncher = true;
+ };
+ }foreach(_muzzles);
+
_cost = 500;
switch (_weaponType) do {
- case "AssaultRifle": {_cost = 500;AIT_allAssaultRifles pushBack _name};
- case "MachineGun": {_cost = 1000;AIT_allMachineGuns pushBack _name};
- case "SniperRifle": {_cost = 1500;AIT_allSniperRifles pushBack _name};
+ case "SubmachineGun": {_cost = 250;AIT_allSubMachineGuns pushBack _name};
+
+ case "AssaultRifle": {
+ call {
+ if(_caliber == " 5.56" or _caliber == "5.56" or _caliber == " 5.45" or _caliber == " 5.8") exitWith {_cost = 500};
+ if(_caliber == " 12 gauge") exitWith {_cost = 1200};
+ if(_caliber == " .338 Lapua Magnum" or _caliber == " .408" or _caliber == " .303") exitWith {_cost = 800};
+ if(_caliber == " 9") exitWith {_cost = 400}; //9x21mm
+ if(_caliber == " 6.5") exitWith {_cost = 1000};
+ if(_caliber == " 7.62") exitWith {_cost = 1500};
+ if(_caliber == " 9.3" or _caliber == "9.3") exitWith {_cost = 1700};
+ if(_caliber == " 12.7") exitWith {_cost = 2500};
+ //I dunno what caliber this is
+ _cost = 1500;
+ };
+ if(_haslauncher) then {_cost = round(_cost * 1.2)};
+ AIT_allAssaultRifles pushBack _name
+ };
+ case "MachineGun": {_cost = 1500;AIT_allMachineGuns pushBack _name};
+ case "SniperRifle": {_cost = 2000;AIT_allSniperRifles pushBack _name};
case "Handgun": {_cost = 100;AIT_allHandGuns pushBack _name};
- case "MissileLauncher": {_cost=2000;AIT_allMissileLaunchers pushBack _name};
- case "RocketLauncher": {_cost = 1000;AIT_allRocketLaunchers pushBack _name};
+ case "MissileLauncher": {_cost=2500;AIT_allMissileLaunchers pushBack _name};
+ case "RocketLauncher": {_cost = 1500;AIT_allRocketLaunchers pushBack _name};
};
cost setVariable [_name,[_cost,1,0,1],true];
} foreach (_allPrimaryWeapons + _allHandGuns + _allLaunchers);
-AIT_allWeapons = AIT_allAssaultRifles + AIT_allMachineGuns + AIT_allSniperRifles + AIT_allHandGuns + AIT_allMissileLaunchers + AIT_allRocketLaunchers;
+AIT_allWeapons = AIT_allSubMachineGuns + AIT_allAssaultRifles + AIT_allMachineGuns + AIT_allSniperRifles + AIT_allHandGuns + AIT_allMissileLaunchers + AIT_allRocketLaunchers;
cost setVariable ["CIV",[50,0,0,0],true];
@@ -301,14 +350,14 @@ AIT_regions = ["island_1","island_2","island_3","island_4","island_5","island_6"
AIT_capitals = ["Georgetown","Lijnhaven","Katkoula","Balavu","Tuvanaka","Sosovu","Ipota"]; //region capitals
AIT_sprawling = ["Blue Pearl industrial port"];
-AIT_mansions = ["Land_House_Big_02_F","Land_House_Big_03_F","Land_House_Small_04_F"]; //buildings that rich guys like to live in
+AIT_mansions = ["Land_House_Big_02_F","Land_House_Big_03_F"]; //buildings that rich guys like to live in
AIT_gunDealerHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Big_02_F","Land_House_Small_03_F","Land_House_Small_06_F","Land_GarageShelter_01_F","Land_House_Small_05_F","Land_House_Native_02_F"];//houses where gun dealers will spawn
AIT_crimHouses = AIT_spawnHouses + AIT_gunDealerHouses + AIT_mansions;
AIT_lowPopHouses = ["Land_House_Native_02_F","Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_Slum_01_F","Land_Slum_02_F","Land_GarageShelter_01_F","Land_Slum_04_F"]; //buildings with just 1-4 people living in them (also player start houses)
-AIT_medPopHouses = ["Land_House_Native_01_F","Land_House_Big_01_F","Land_Slum_05_F","Land_House_Small_01_F","Land_Slum_03_F","Land_Slum_04_F","Land_House_Small_05_F","Land_Addon_04_F"]; //buildings with 5-10 people living in them
+AIT_medPopHouses = ["Land_House_Small_04_F","Land_House_Native_01_F","Land_House_Big_01_F","Land_Slum_05_F","Land_House_Small_01_F","Land_Slum_03_F","Land_Slum_04_F","Land_House_Small_05_F","Land_Addon_04_F"]; //buildings with 5-10 people living in them
AIT_highPopHouses = ["Land_House_Big_04_F","Land_Warehouse_01_F"]; //buildings with up to 20 (the warehouses are because ports end up with low pop)
AIT_hugePopHouses = ["Land_MultistoryBuilding_03_F"]; //buildings with potentially lots of people living in them
AIT_touristHouses = ["Land_House_Big_05_F"]; //hostels and the like
@@ -320,7 +369,15 @@ AIT_carShops = ["Land_FuelStation_01_workshop_F","Land_FuelStation_02_workshop_F
AIT_offices = ["Land_MultistoryBuilding_01_F","Land_MultistoryBuilding_04_F"];
AIT_portBuildings = ["Land_Warehouse_01_F","Land_Warehouse_02_F","Land_ContainerLine_01_F","Land_ContainerLine_02_F","Land_ContainerLine_03_F"];
-AIT_allBuyableBuildings = AIT_lowPopHouses + AIT_medPopHouses;
+AIT_allBuyableBuildings = AIT_lowPopHouses + AIT_medPopHouses + AIT_highPopHouses + AIT_hugePopHouses + AIT_mansions + [AIT_item_Tent,AIT_item_Flag];
+
+{
+ _istpl = _x select 4;
+ if(_istpl) then {
+ _tpl = _x select 2;
+ AIT_allBuyableBuildings pushback ((_tpl select 0) select 0);
+ };
+}foreach(AIT_Buildables_Base);
AIT_allHouses = AIT_lowPopHouses + AIT_medPopHouses + AIT_highPopHouses + AIT_hugePopHouses + AIT_touristHouses;
AIT_allEnterableHouses = ["Land_House_Small_02_F","Land_House_Big_02_F","Land_House_Small_03_F","Land_House_Small_06_F","Land_House_Big_01_F","Land_Slum_05_F","Land_Slum_01_F","Land_GarageShelter_01_F","Land_House_Small_01_F","Land_Slum_03_F","Land_House_Big_04_F","Land_House_Small_04_F","Land_House_Small_05_F"];
diff --git a/intelSystem.sqf b/intelSystem.sqf
new file mode 100644
index 00000000..f15f3532
--- /dev/null
+++ b/intelSystem.sqf
@@ -0,0 +1,187 @@
+private ["_eh","_handler"];
+
+_handler = {
+ private ["_vehs","_dest","_destpos","_passengers"];
+ if !(visibleMap or visibleGPS) exitWith {};
+ _vehs = [];
+ if(isMultiplayer) then {
+ {
+ _veh = vehicle _x;
+ if(_veh == _x) then {
+ _color = [0,0.5,0,1];
+ if!(captive _x) then {
+ _color = [0.5,0,0,1];
+ };
+ (_this select 0) drawIcon [
+ "iconMan",
+ _color,
+ getpos _x,
+ 24,
+ 24,
+ getdir _x,
+ name _x
+ ];
+ }else{
+ if !(_veh in _vehs) then {
+ _vehs pushback _veh;
+ };
+ };
+ }foreach(allPlayers);
+ };
+ _t = 1;
+ {
+ if (!(isPlayer _x)) then {
+ _veh = vehicle _x;
+ if(_veh == _x) then {
+ _dest = expectedDestination _x;
+ _destpos = _dest select 0;
+ _color = [0,0.5,0,1];
+ if !(captive _x) then {
+ _color = [0.5,0,0,1];
+ };
+ if(_x in groupSelectedUnits player) then {
+ (_this select 0) drawIcon [
+ "\A3\ui_f\data\igui\cfg\islandmap\iconplayer_ca.paa",
+ _color,
+ getpos _x,
+ 24,
+ 24,
+ 0
+ ];
+ };
+ if ((_dest select 1)== "LEADER PLANNED") then {
+ (_this select 0) drawLine [
+ getPos _x,
+ _destpos,
+ _color
+ ];
+ (_this select 0) drawIcon [
+ "\A3\ui_f\data\map\groupicons\waypoint.paa",
+ _color,
+ _destpos,
+ 24,
+ 24,
+ 0
+ ];
+ };
+
+
+ (_this select 0) drawIcon [
+ "iconMan",
+ _color,
+ getpos _x,
+ 24,
+ 24,
+ getDir _x,
+ format["%1",_t]
+ ];
+ }else{
+ if !(_veh in _vehs) then {
+ _vehs pushback _veh;
+ };
+ };
+ };
+ _t = _t + 1;
+ }foreach(units (group player));
+
+ {
+ _passengers = "";
+ _color = [0,0.5,0,1];
+ {
+ if(isPlayer _x and _x != player) then {
+ _passengers = format["%1 %2",_passengers,name _x];
+ };
+ if(!captive _x) then {_color = [0.5,0,0,1]};
+ }foreach(units _x);
+
+ (_this select 0) drawIcon [
+ "iconCar",
+ _color,
+ getpos _x,
+ 24,
+ 24,
+ getdir _x,
+ _passengers
+ ];
+ }foreach(_vehs);
+
+ {
+ if(side _x == west) then {
+ _u = leader _x;
+ _alive = false;
+ if(!alive _u) then {
+ {
+ if(alive _x) exitWith {_u = _x;_alive=true};
+ }foreach(units _x);
+ }else{
+ _alive = true;
+ };
+ if(_alive) then {
+ _ka = resistance knowsabout _u;
+ if(_ka > 1.4) then {
+ _opacity = (_ka-1.4) / 1;
+ if(_opacity > 1) then {_opacity = 1};
+ _pos = getpos _u;
+ (_this select 0) drawIcon [
+ "\A3\ui_f\data\map\markers\nato\b_inf.paa",
+ [0,0.3,0.59,_opacity],
+ _pos,
+ 30,
+ 30,
+ 0
+ ];
+ };
+ }
+ };
+
+ if(side _x == east) then {
+ _u = leader _x;
+ _alive = false;
+ if(!alive _u) then {
+ {
+ if(alive _x) exitWith {_u = _x;_alive=true};
+ }foreach(units _x);
+ }else{
+ _alive = true;
+ };
+ if(_alive) then {
+ _ka = resistance knowsabout _u;
+ if(_ka > 1.4) then {
+ _opacity = (_ka-1.4) / 1;
+ if(_opacity > 1) then {_opacity = 1};
+ _pos = getpos _u;
+ (_this select 0) drawIcon [
+ "\A3\ui_f\data\map\markers\nato\b_inf.paa",
+ [0.5,0,0,_opacity],
+ _pos,
+ 30,
+ 30,
+ 0
+ ];
+ };
+ }
+ };
+
+ }foreach(allGroups);
+};
+
+_eh = ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", _handler];
+
+[_handler] spawn {
+ private ['_gps',"_handler"];
+ _handler = _this select 0;
+ disableSerialization;
+ _gps = controlNull;
+ for '_x' from 0 to 1 step 0 do {
+ {
+ if !(isNil {_x displayCtrl 101}) then {
+ _gps = _x displayCtrl 101;
+ };
+ } count (uiNamespace getVariable 'IGUI_Displays');
+ uiSleep 1;
+ if (!isNull _gps) exitWith {
+ _gps ctrlAddEventHandler ['Draw',_handler];
+ };
+ uiSleep 0.25;
+ };
+};
\ No newline at end of file
diff --git a/interaction/initGunDealerLocal.sqf b/interaction/initGunDealerLocal.sqf
index 0e6ffe8a..43480efe 100644
--- a/interaction/initGunDealerLocal.sqf
+++ b/interaction/initGunDealerLocal.sqf
@@ -23,29 +23,34 @@ _civ addAction ["Buy", {
_base = [_type] call BIS_fnc_baseWeapon;
_magazines = getArray (configFile / "CfgWeapons" / _base / "magazines");
_cost = 2;
+ if(_type in AIT_allSubMachineGuns) then {
+ _cost = 3;
+ };
if(_type in AIT_allAssaultRifles) then {
_cost = 5;
+ if((_cost select 0) > 1400) then {
+ _cost = 10;
+ };
};
if(_type in AIT_allMachineGuns) then {
- _cost = 8;
+ _cost = 12;
};
if(_type in AIT_allSniperRifles) then {
- _cost = 10;
+ _cost = 20;
};
if(_type in AIT_allRocketLaunchers) then {
- _cost = 20;
+ _cost = 50;
};
if(_type in AIT_allMissileLaunchers) then {
- _cost = 40;
+ _cost = 100;
};
_stock pushBack [_magazines call BIS_fnc_selectRandom,_cost];
};
};
server setVariable [format["gunstock%1",_town],_stock,true];
- {
- _cost = cost getVariable _x;
- _price = round((_cost select 0) * ((random 1) + 1));
+ {
+ _price = round(50 * ((random 1) + 1));
_stock pushBack [_x,_price];
}foreach(AIT_illegalItems);
};
diff --git a/interaction/initObjectLocal.sqf b/interaction/initObjectLocal.sqf
new file mode 100644
index 00000000..9361af49
--- /dev/null
+++ b/interaction/initObjectLocal.sqf
@@ -0,0 +1,49 @@
+if(typeof _this == AIT_item_Map) then {
+ _this addAction ["Town Info", "actions\townInfo.sqf",nil,0,false,true,"",""];
+ _this addAction ["Most Wanted", "actions\mostWanted.sqf",nil,0,false,true,"",""];
+ if(player == bigboss) then {
+ _this addAction ["Options", {
+ closedialog 0;
+ _nul = createDialog "AIT_dialog_options";
+ },nil,0,false,true,"",""];
+ };
+};
+if(typeof _this == AIT_item_Repair) then {
+ _this addAction ["Repair Nearby Vehicles", "actions\repairAll.sqf",nil,0,false,true,"",""];
+};
+if(typeof _this == AIT_item_Tent) exitWith {
+ _camp = player getVariable ["camp",objNull];
+ if !(isNull _camp) then {
+ _fire = _camp getVariable "fire";
+ deleteVehicle _fire;
+ deleteVehicle _camp;
+ };
+ _mrkid = format["%1-camp",getplayeruid player];
+ createMarkerLocal [_mrkid,getpos _this];
+ _mrkid setMarkerPos (getpos _this);
+ _mrkid setMarkerShape "ICON";
+ _mrkid setMarkerType "loc_Bunker";
+ _mrkid setMarkerColor "ColorWhite";
+ _mrkid setMarkerAlpha 0;
+ _mrkid setMarkerAlphaLocal 1;
+ _mrkid setMarkerText "Camp";
+
+ _pos = [(getpos _this),1.2,getDir _this] call BIS_fnc_relPos;
+ _fire = "Land_Fire" createVehicle _pos;
+ _this setVariable ["fire",_fire,false];
+ player setvariable ["camp",_this,false];
+};
+
+if(_this isKindOf "Building" or _this isKindOf "Man") exitWith{};
+
+if(AIT_hasACE) then {
+ _dir = 0;
+ if(typeof _this == "C_Rubberboat") then {
+ _dir = 90;
+ };
+ [_this, true, [0, 2, 0.4],_dir] call ace_dragging_fnc_setCarryable;
+}else{
+ _this addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
+};
+
+
diff --git a/keyHandler.sqf b/keyHandler.sqf
index bb078f34..ac73c4ca 100644
--- a/keyHandler.sqf
+++ b/keyHandler.sqf
@@ -1,10 +1,19 @@
+private ["_handled","_key","_showing"];
_handled = false;
+_showing = false;
_key = _this select 1;
if (_key == 21) then
{
- closedialog 0;
- _nul = createDialog "AIT_dialog_main";
+ if(!dialog) then {
+ if(count (groupSelectedUnits player) > 0) then {
+ createDialog "AIT_dialog_command";
+ }else{
+ [] spawn mainMenu;
+ };
+ }else{
+ closeDialog 0;
+ };
_handled = true;
}
else
diff --git a/mission.sqm b/mission.sqm
index 9a6c32da..f2a823dd 100644
Binary files a/mission.sqm and b/mission.sqm differ
diff --git a/setupPlayer.sqf b/setupPlayer.sqf
index 13678039..aa87866d 100644
--- a/setupPlayer.sqf
+++ b/setupPlayer.sqf
@@ -3,11 +3,19 @@ townChange = {
_pop = server getVariable format["population%1",_town];
_stability = server getVariable format["stability%1",_town];
_rep = player getVariable format["rep%1",_town];
+ _abandon = "NATO Controlled";
+ if(_town in (server getVariable ["NATOabandoned",[]])) then {
+ if(_stability < 50) then {
+ _abandon = "Anarchy";
+ }else{
+ _abandon = "Resistance Controlled";
+ };
+ };
_plusmin = "";
if(_rep > -1) then {
_plusmin = "+";
};
- _txt = format ["%1
Population: %2
Stability: %3%4
Your Standing: %5%6",_town,[_pop, 1, 0, true] call CBA_fnc_formatNumber,_stability,"%",_plusmin,_rep];
+ _txt = format ["%1
Status: %7
Population: %2
Stability: %3%4
Your Standing: %5%6",_town,[_pop, 1, 0, true] call CBA_fnc_formatNumber,_stability,"%",_plusmin,_rep,_abandon];
[_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};
_town = (getPos player) call nearestTown;
diff --git a/spawners/ambientVehicles.sqf b/spawners/ambientVehicles.sqf
index c17b255d..749bf6ea 100644
--- a/spawners/ambientVehicles.sqf
+++ b/spawners/ambientVehicles.sqf
@@ -1,95 +1,60 @@
-private ["_id","_params","_town","_posTown","_active","_groups","_civs","_numCiv","_shops","_houses","_stability","_pop","_count","_mSize","_civTypes","_hour","_range","_found"];
+private ["_id","_params","_town","_posTown","_groups","_civs","_numCiv","_shops","_houses","_stability","_pop","_count","_mSize","_civTypes","_hour","_range","_found"];
if (!isServer) exitwith {};
-_active = false;
-
_count = 0;
-_id = _this select 0;
-_posTown = _this select 1;
-_town = _this select 3;
-
-_civs = []; //Stores all civs for tear down
-waitUntil{spawner getVariable _id};
+_town = _this;
+_posTown = server getVariable _town;
+_groups = [];
_mSize = 380;
if(_town in AIT_capitals + AIT_sprawling) then {//larger search radius
_mSize = 700;
};
-while{true} do {
- //Do any updates here that should happen whether spawned or not
-
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
- _active = true;
- //Spawn stuff in
- _count = 0;
- _pop = server getVariable format["population%1",_town];
- _stability = server getVariable format ["stability%1",_town];
- _numVeh = 2;
- if(_pop > 15) then {
- _numVeh = 2 + round(_pop * AIT_spawnVehiclePercentage);
- };
- while {(spawner getVariable _id) and (_count < _numVeh)} do {
- _start = [[[_posTown,_mSize]]] call BIS_fnc_randomPos;
- _road = [_start] call BIS_fnc_nearestRoad;
- if (!isNull _road) then {
- _pos = getPos _road;
- _vehtype = AIT_vehTypes_civ call BIS_Fnc_selectRandom;
- _dirveh = 0;
- _roadscon = roadsConnectedto _road;
- if (count _roadscon == 2) then {
- _dirveh = [_road, _roadscon select 0] call BIS_fnc_DirTo;
- if(isNil "_dirveh") then {_dirveh = random 359};
- _posVeh = ([_pos, 6, _dirveh + 90] call BIS_Fnc_relPos) findEmptyPosition [0,15,_vehtype];
+_count = 0;
+_pop = server getVariable format["population%1",_town];
+_stability = server getVariable format ["stability%1",_town];
+_numVeh = 2;
+if(_pop > 15) then {
+ _numVeh = 2 + round(_pop * AIT_spawnVehiclePercentage);
+};
+while {(_count < _numVeh)} do {
+ _start = [[[_posTown,_mSize]]] call BIS_fnc_randomPos;
+ _road = [_start] call BIS_fnc_nearestRoad;
+ if (!isNull _road) then {
+ _pos = getPos _road;
+ _vehtype = AIT_vehTypes_civ call BIS_Fnc_selectRandom;
+ _dirveh = 0;
+ _roadscon = roadsConnectedto _road;
+ if (count _roadscon == 2) then {
+ _dirveh = [_road, _roadscon select 0] call BIS_fnc_DirTo;
+ if(isNil "_dirveh") then {_dirveh = random 359};
+ _posVeh = ([_pos, 6, _dirveh + 90] call BIS_Fnc_relPos) findEmptyPosition [0,15,_vehtype];
+
+ if(count _posVeh > 0) then {
+ _veh = _vehtype createVehicle _posVeh;
+ clearItemCargoGlobal _veh;
- if(count _posVeh > 0) then {
- _veh = _vehtype createVehicle _posVeh;
- clearItemCargoGlobal _veh;
-
- _veh setDir _dirveh;
- _civs pushBack _veh;
-
- _veh addEventHandler ["GetIn",{
- _unit = _this select 2;
- _v = _this select 0;
- if(isPlayer _unit) then {
- _v setVariable ["owner",getPlayerUID _unit,true];
- _v setVariable ["stolen",true,true];
-
- if(_unit call unitSeen) then {
- _unit setCaptive false;
- };
- };
- }];
- sleep 0.05;
+ _veh setDir _dirveh;
+ _groups pushBack _veh;
+
+ _veh addEventHandler ["GetIn",{
+ _unit = _this select 2;
+ _v = _this select 0;
+ if(isPlayer _unit) then {
+ _v setVariable ["owner",getPlayerUID _unit,true];
+ _v setVariable ["stolen",true,true];
+
+ if(_unit call unitSeen) then {
+ _unit setCaptive false;
};
};
- };
- _count = _count + 1;
+ }];
+ sleep 0.03;
};
-
- sleep 1;
- {
- _x setDamage 0;
- }foreach(_civs);
- };
- }else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- }else{
- _active = false;
- //Tear it all down
- {
- if !(_x call hasOwner) then {
- deleteVehicle _x;
- };
- }foreach(_civs);
- _civs = [];
};
};
- sleep 1;
-};
\ No newline at end of file
+ _count = _count + 1;
+};
+_groups
\ No newline at end of file
diff --git a/spawners/carDealer.sqf b/spawners/carDealer.sqf
index 4ad33593..4c9ecfa1 100644
--- a/spawners/carDealer.sqf
+++ b/spawners/carDealer.sqf
@@ -1,84 +1,45 @@
private ["_id","_pos","_building","_tracked","_civs","_vehs","_group","_groups","_all","_shopkeeper"];
if (!isServer) exitwith {};
-_active = false;
_count = 0;
-_id = _this select 0;
-_posTown = _this select 1;
-_town = _this select 3;
+_town = _this;
+_posTown = server getVariable _town;
_shopkeeper = objNULL;
_groups = [];
-_vehs = [];
-waitUntil{spawner getVariable _id};
-
-while{true} do {
- //Do any updates here that should happen whether spawned or not
+{
+ _building = _x;
+ _pos = getpos _building;
+ _tracked = _building call spawnTemplate;
+ sleep 1;
+ _vehs = _tracked select 0;
+ [_groups,_vehs] call BIS_fnc_arrayPushStack;
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
- _active = true;
- //Spawn stuff in
- {
- _building = _x;
- _pos = getpos _building;
- _tracked = _building call spawnTemplate;
- sleep 1;
- _vehs = _tracked select 0;
-
- _cashdesk = _pos nearestObject AIT_item_ShopRegister;
- _cashpos = [getpos _cashdesk,1,getDir _cashdesk] call BIS_fnc_relPos;
- _pos = [[[_cashpos,50]]] call BIS_fnc_randomPos;
-
- _group = createGroup civilian;
- _group setBehaviour "CARELESS";
- _type = (AIT_civTypes_locals + AIT_civTypes_expats) call BIS_Fnc_selectRandom;
- _shopkeeper = _group createUnit [_type, _pos, [],0, "NONE"];
-
+ _cashdesk = _pos nearestObject AIT_item_ShopRegister;
+ _cashpos = [getpos _cashdesk,1,getDir _cashdesk] call BIS_fnc_relPos;
+ _pos = [[[_cashpos,50]]] call BIS_fnc_randomPos;
+
+ _group = createGroup civilian;
+ _group setBehaviour "CARELESS";
+ _type = (AIT_civTypes_locals + AIT_civTypes_expats) call BIS_Fnc_selectRandom;
+ _shopkeeper = _group createUnit [_type, _pos, [],0, "NONE"];
+
- _wp = _group addWaypoint [_cashpos,2];
- _wp setWaypointType "MOVE";
- _wp setWaypointSpeed "LIMITED";
+ _wp = _group addWaypoint [_cashpos,2];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointSpeed "LIMITED";
- _shopkeeper remoteExec ["initCarShopLocal",0,true];
- [_shopkeeper] call initCarDealer;
-
- _allactive = spawner getVariable ["activecarshops",[]];
- _allactive pushback _shopkeeper;
- spawner setVariable ["activecarshops",_allactive,true];
-
- }foreach(nearestObjects [_posTown, AIT_carShops, 600]);
- };
- }else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- }else{
- _active = false;
- //Tear it all down
- {
- deleteVehicle _x;
- }foreach(_vehs);
- _allactive = spawner getVariable ["activecarshops",[]];
- {
- {
- sleep 0.1;
- if(_x in _allactive) then {
- _allactive deleteAt (_allactive find _x);
- };
- if !(_x call hasOwner) then {
- deleteVehicle _x;
- };
- }foreach(units _x);
- deleteGroup _x;
- }foreach(_groups);
- _groups = [];
- spawner setVariable ["activecarshops",_allactive,true];
- };
- };
- sleep 2;
-};
\ No newline at end of file
+ _shopkeeper remoteExec ["initCarShopLocal",0,true];
+ [_shopkeeper] call initCarDealer;
+
+ _allactive = spawner getVariable ["activecarshops",[]];
+ _allactive pushback _shopkeeper;
+ spawner setVariable ["activecarshops",_allactive,true];
+
+}foreach(nearestObjects [_posTown,AIT_carShops, 400]);
+
+
+_groups
\ No newline at end of file
diff --git a/spawners/civ.sqf b/spawners/civ.sqf
index 546b20be..3126d7b0 100644
--- a/spawners/civ.sqf
+++ b/spawners/civ.sqf
@@ -1,120 +1,82 @@
-private ["_id","_params","_town","_posTown","_active","_groups","_numCiv","_shops","_houses","_stability","_pop","_count","_mSize","_civTypes","_hour","_range","_found","_lights"];
-if (!isServer) exitwith {};
-
-_active = false;
+private ["_id","_params","_town","_posTown","_groups","_numCiv","_shops","_houses","_stability","_pop","_count","_mSize","_civTypes","_hour","_range","_found"];
_count = 0;
-_id = _this select 0;
-_town = _this select 3;
+_town = _this;
_groups = [];
-_lights = [];
-waitUntil{spawner getVariable _id};
-
-while{true} do {
- //Do any updates here that should happen whether spawned or not
-
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
-
- _active = true;
- //Spawn stuff in
-
- _pop = server getVariable format["population%1",_town];
- _stability = server getVariable format ["stability%1",_town];
- _posTown = server getVariable _town;
-
- _mSize = 350;
- if(_town in AIT_capitals) then {
- _mSize = 800;
- };
- if(_pop > 15) then {
- _numCiv = round(_pop * AIT_spawnCivPercentage);
- if(_numCiv < 5) then {
- _numCiv = 5;
- };
- }else {
- _numCiv = _pop;
- };
-
- _hour = date select 3;
-
- _civTypes = AIT_civTypes_locals;
+_pop = server getVariable format["population%1",_town];
+_stability = server getVariable format ["stability%1",_town];
+_posTown = server getVariable _town;
+
+_mSize = 350;
+if(_town in AIT_capitals) then {
+ _mSize = 800;
+};
+
+if(_pop > 15) then {
+ _numCiv = round(_pop * AIT_spawnCivPercentage);
+ if(_numCiv < 5) then {
+ _numCiv = 5;
+ };
+}else {
+ _numCiv = _pop;
+};
- if(_pop > 600) then {
- _civTypes = _civTypes + AIT_civTypes_expats + AIT_civTypes_tourists;
- };
+_hour = date select 3;
+
+_civTypes = AIT_civTypes_locals;
+
+if(_pop > 600) then {
+ _civTypes = _civTypes + AIT_civTypes_expats + AIT_civTypes_tourists;
+};
+
+_count = 0;
+
+_pergroup = 2;
+if(_numCiv < 10) then {_pergroup = 1};
+if(_numCiv > 30) then {_pergroup = 3};
+if(_numCiv > 50) then {_pergroup = 4};
+if(_numCiv > 70) then {_pergroup = 5};
+if(_numCiv > 100) then {_pergroup = 8};
+_idd = 1;
+while {_count < _numCiv} do {
+ _groupcount = 0;
+ _group = createGroup civilian;
+ _groups pushback _group;
+ _group setGroupId [format["%1 %2-1",_town,_idd],""];
+ _idd = _idd + 1;
- _count = 0;
-
- _pergroup = 2;
- if(_numCiv < 10) then {_pergroup = 1};
- if(_numCiv > 30) then {_pergroup = 3};
- if(_numCiv > 50) then {_pergroup = 4};
- if(_numCiv > 70) then {_pergroup = 5};
- if(_numCiv > 100) then {_pergroup = 8};
- _idd = 1;
- while {_count < _numCiv} do {
- _groupcount = 0;
- sleep 0.1;
- _group = createGroup civilian;
- _groups pushback _group;
- _group setGroupId [format["%1 %2-1",_town,_idd],""];
- _idd = _idd + 1;
-
- //Give this group a "home"
- _home = [_posTown,AIT_allEnterableHouses] call getRandomBuilding;
- while {(_groupcount < _pergroup) and (_count < _numCiv)} do {
- _pos = [[[getpos _home,50]]] call BIS_fnc_randomPos;
-
- _civ = _group createUnit [_civTypes call BIS_fnc_selectRandom, _pos, [],0, "NONE"];
- _civ setBehaviour "SAFE";
- [_civ] spawn initCivilian;
- _count = _count + 1;
- _groupcount = _groupcount + 1;
- };
- [_group,_home] call civilianGroup;
- if((_hour > 18 and _hour < 23) or (_hour < 9 and _hour > 5)) then {
- //Put a light on at home
- _pos = getpos _home;
- _light = "#lightpoint" createVehicle [_pos select 0,_pos select 1,(_pos select 2)+2.2];
- _light setLightBrightness 0.09;
- _light setLightAmbient[.9, .9, .6];
- _light setLightColor[.5, .5, .4];
- _lights pushback _light;
- };
- };
-
- sleep 1;
- {
- {
- _x setDamage 0;
- }foreach(units _x);
- }foreach(_groups);
- };
- }else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- }else{
- _active = false;
- //Tear it all down
- {
- {
- sleep 0.1;
- if !(_x call hasOwner) then {
- deleteVehicle _x;
- };
- }foreach(units _x);
- deleteGroup _x;
- }foreach(_groups);
- {
- deleteVehicle _x;
- }foreach(_lights);
- _groups = [];
- _lights = [];
- };
+ //Give this group a "home"
+ _home = [_posTown,AIT_allEnterableHouses] call getRandomBuilding;
+ while {(_groupcount < _pergroup) and (_count < _numCiv)} do {
+ _pos = [[[getpos _home,50]]] call BIS_fnc_randomPos;
+
+ _civ = _group createUnit [_civTypes call BIS_fnc_selectRandom, _pos, [],0, "NONE"];
+ _civ setBehaviour "SAFE";
+ [_civ] spawn initCivilian;
+ _count = _count + 1;
+ _groupcount = _groupcount + 1;
+ };
+ [_group,_home] call civilianGroup;
+ if((_hour > 18 and _hour < 23) or (_hour < 9 and _hour > 5)) then {
+ //Put a light on at home
+ _pos = getpos _home;
+ _light = "#lightpoint" createVehicle [_pos select 0,_pos select 1,(_pos select 2)+2.2];
+ _light setLightBrightness 0.09;
+ _light setLightAmbient[.9, .9, .6];
+ _light setLightColor[.5, .5, .4];
+ _groups pushback _light;
};
- sleep 2;
-};
\ No newline at end of file
+ sleep 0.03;
+};
+
+_groups spawn {
+ sleep 1;
+ {
+ {
+ _x setDamage 0;
+ }foreach(units _x);
+ }foreach(_this);
+};
+
+_groups
\ No newline at end of file
diff --git a/spawners/criminal.sqf b/spawners/criminal.sqf
index cb24e4a9..f7121e9d 100644
--- a/spawners/criminal.sqf
+++ b/spawners/criminal.sqf
@@ -1,167 +1,100 @@
-private ["_id","_town","_posTown","_active","_groups","_soldiers","_numNATO","_pop","_count","_range"];
+private ["_id","_town","_posTown","_groups","_numNATO","_pop","_count","_range"];
if (!isServer) exitwith {};
-_active = false;
-
_count = 0;
-_id = _this select 0;
-_posTown = _this select 1;
-_town = _this select 3;
+
+_town = _this;
+_posTown = server getVariable _town;
_groups = [];
-_soldiers = []; //Stores all soldiers for tear down
-waitUntil{spawner getVariable _id};
+
+_numCRIM = server getVariable [format ["numcrims%1",_town],0];
-while{true} do {
- //Do any updates here that should happen whether spawned or not
+if(_numCRIM > 0) then {
+ _time = server getVariable [format ["timecrims%1",_town],0];
+ _leaderpos = server getVariable [format["crimleader%1",_town],false];
+ _group = objNULL;
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
- _active = true;
-
- _numCRIM = server getVariable [format ["numcrims%1",_town],0];
-
- if(_numCRIM > 0) then {
- _time = server getVariable format ["timecrims%1",_town];
- _leaderpos = server getVariable format["crimleader%1",_town];
- _group = objNULL;
-
- _skill = 0.7;
- if(_time > 0) then {
- _skill = 0.7 + (0.3 * (_time / 7200));
- if(_skill > 0.95) then {
- _skill = 0.95;
- };
- };
- //Spawn stuff in
- _count = 0;
- _group = createGroup east;
- _groups pushBack _group;
-
- if ((typeName _leaderpos) == "ARRAY") then {
- _start = [[[_leaderpos,40]]] call BIS_fnc_randomPos;
-
- _civ = _group createUnit [AIT_CRIM_Units_Para call BIS_fnc_selectRandom, _start, [],0, "NONE"];
- [_civ] joinSilent _group;
- _civ setskill _skill;
- if(_time > 1200) then {
- _civ setRank "MAJOR";
- }else{
- if(_time > 600) then {
- _civ setRank "CAPTAIN";
- }else{
- _civ setRank "LIEUTENANT";
- };
- };
-
- _soldiers pushBack _civ;
- [_civ,_name] call initCrimLeader;
- _civ setBehaviour "SAFE";
-
- _count = _count + 1;
-
- _wp = _group addWaypoint [_leaderpos,0];
- _wp setWaypointType "GUARD";
-
- sleep 0.1;
- }else{
- _start = [[[_posTown,150]]] call BIS_fnc_randomPos;
- _group setBehaviour "CARELESS";
+ _skill = 0.7;
+ if(_time > 0) then {
+ _skill = 0.7 + (0.3 * (_time / 7200));
+ if(_skill > 0.95) then {
+ _skill = 0.95;
+ };
+ };
+ //Spawn stuff in
+ _count = 0;
+ _group = createGroup east;
+ _groups pushBack _group;
+
+ if ((typeName _leaderpos) == "ARRAY") then {
+ _start = [[[_leaderpos,40]]] call BIS_fnc_randomPos;
- _wp = _group addWaypoint [_leaderpos,0];
- _wp setWaypointType "MOVE";
- _wp setWaypointSpeed "LIMITED";
- _wp setWaypointTimeout [0, 5, 10];
-
- _end = [[[_posTown,150]]] call BIS_fnc_randomPos;
-
- _wp = _group addWaypoint [_end,0];
- _wp setWaypointType "MOVE";
- _wp setWaypointSpeed "LIMITED";
- _wp setWaypointTimeout [0, 5, 10];
-
- _wp = _group addWaypoint [_leaderpos,0];
- _wp setWaypointType "CYCLE";
- _wp setWaypointSpeed "LIMITED";
- };
-
- while {(spawner getVariable _id) and (_count < _numCRIM)} do {
- _start = [[[_leaderpos,40]]] call BIS_fnc_randomPos;
-
- _civ = _group createUnit [AIT_CRIM_Units_Bandit call BIS_fnc_selectRandom, _start, [],0, "NONE"];
- [_civ] joinSilent _group;
- if(_time > 1200) then {
- _civ setRank "LIEUTENANT";
- }else{
- if(_time > 600) then {
- _civ setRank "SERGEANT";
- }else{
- _civ setRank "CORPORAL";
- };
- };
- _soldiers pushBack _civ;
- [_civ,_town] call initCriminal;
- _civ setBehaviour "SAFE";
-
- sleep 0.1;
- _count = _count + 1;
- };
-
- {
- _x addCuratorEditableObjects [_soldiers,true];
- } forEach allCurators;
- sleep 1;
- {
- _x setDamage 0;
- }foreach(_soldiers);
- }
+ _civ = _group createUnit [AIT_CRIM_Units_Para call BIS_fnc_selectRandom, _start, [],0, "NONE"];
+ [_civ] joinSilent _group;
+ _civ setskill _skill;
+ if(_time > 1200) then {
+ _civ setRank "MAJOR";
}else{
- //Do updates here that should only happen while not spawned
- _newpos = server getVariable format["crimnew%1",_town];
- _addnum = server getVariable format["crimadd%1",_town];
- _current = server getVariable format["numcrims%1",_town];
- if((typename "_newpos") == "ARRAY") then {
- server setVariable [format["crimleader%1",_town],_newpos,false];
- server setVariable [format["crimnew%1",_town],false,false];
+ if(_time > 600) then {
+ _civ setRank "CAPTAIN";
+ }else{
+ _civ setRank "LIEUTENANT";
};
- server setVariable [format["numcrims%1",_town],_current+_addnum,false];
- server setVariable [format["crimadd%1",_town],0,false];
- }
+ };
+
+ [_civ,_name] call initCrimLeader;
+ _civ setBehaviour "SAFE";
+
+ _count = _count + 1;
+
+ _wp = _group addWaypoint [_leaderpos,0];
+ _wp setWaypointType "GUARD";
+
+ sleep 0.1;
}else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- _newpos = server getVariable format["crimnew%1",_town];
- _addnum = server getVariable format["crimadd%1",_town];
- if((typename _newpos) == "ARRAY") then {
- server setVariable [format["crimleader%1",_town],_newpos,true];
- _new = [_newpos,_addnum,_town] call newleader;
- [_soldiers,_new] call BIS_fnc_arrayPushStack;
- _groups pushback group(_new select 0);
+ _start = [[[_posTown,150]]] call BIS_fnc_randomPos;
+ _group setBehaviour "CARELESS";
+
+ _wp = _group addWaypoint [_leaderpos,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointSpeed "LIMITED";
+ _wp setWaypointTimeout [0, 5, 10];
+
+ _end = [[[_posTown,150]]] call BIS_fnc_randomPos;
+
+ _wp = _group addWaypoint [_end,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointSpeed "LIMITED";
+ _wp setWaypointTimeout [0, 5, 10];
+
+ _wp = _group addWaypoint [_leaderpos,0];
+ _wp setWaypointType "CYCLE";
+ _wp setWaypointSpeed "LIMITED";
+ };
+
+ while {(_count < _numCRIM)} do {
+ _start = [[[_leaderpos,40]]] call BIS_fnc_randomPos;
+
+ _civ = _group createUnit [AIT_CRIM_Units_Bandit call BIS_fnc_selectRandom, _start, [],0, "NONE"];
+ [_civ] joinSilent _group;
+ if(_time > 1200) then {
+ _civ setRank "LIEUTENANT";
+ }else{
+ if(_time > 600) then {
+ _civ setRank "SERGEANT";
}else{
- if(_addnum > 0) then {
- _new = [_addnum,_town] call sendCrims;
- [_soldiers,_new] call BIS_fnc_arrayPushStack;
- _groups pushback group(_new select 0);
- };
+ _civ setRank "CORPORAL";
};
- server setVariable [format["crimnew%1",_town],false,false];
- _current = server getVariable format["numcrims%1",_town];
- server setVariable [format["numcrims%1",_town],_current+_addnum,false];
- server setVariable [format["crimadd%1",_town],0,false];
- }else{
- _active = false;
- //Tear it all down
- {
- deleteVehicle _x;
- }foreach(_soldiers);
- {
- deleteGroup _x;
- }foreach(_groups);
- _soldiers = [];
};
+ [_civ,_town] call initCriminal;
+ _civ setBehaviour "SAFE";
+
+ sleep 0.1;
+ _count = _count + 1;
};
- sleep 1;
-};
\ No newline at end of file
+
+};
+
+_groups
\ No newline at end of file
diff --git a/spawners/gunDealer.sqf b/spawners/gunDealer.sqf
index 9ed28f51..77d84aac 100644
--- a/spawners/gunDealer.sqf
+++ b/spawners/gunDealer.sqf
@@ -1,74 +1,35 @@
private ["_id","_pos","_building","_tracked","_civs","_vehs","_group","_all","_shopkeeper"];
if (!isServer) exitwith {};
-_active = false;
-
_count = 0;
-_id = _this select 0;
-_posTown = _this select 1;
-_town = _this select 3;
+_town = _this;
+_posTown = server getVariable _town;
+_pop = server getVariable format["population%1",_town];
+if(_pop > 160) exitWith {};
_groups = [];
-waitUntil{spawner getVariable _id};
-while{true} do {
- //Do any updates here that should happen whether spawned or not
-
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
-
- _active = true;
- //Spawn stuff in
- _gundealerpos = server getVariable format["gundealer%1",_town];
- if(isNil "_gundealerpos") then {
- _building = [_posTown,AIT_gunDealerHouses] call getRandomBuilding;
- _gundealerpos = (_building call BIS_fnc_buildingPositions) call BIS_fnc_selectRandom;
- server setVariable [format["gundealer%1",_town],_gundealerpos,false];
- _building setVariable ["owner","system",true];
- };
- _group = createGroup civilian;
- _groups pushback _group;
+_gundealerpos = server getVariable format["gundealer%1",_town];
+if(isNil "_gundealerpos") then {
+ _building = [_posTown,AIT_gunDealerHouses] call getRandomBuilding;
+ _gundealerpos = (_building call BIS_fnc_buildingPositions) call BIS_fnc_selectRandom;
+ server setVariable [format["gundealer%1",_town],_gundealerpos,false];
+ _building setVariable ["owner","system",true];
+};
+_group = createGroup civilian;
+_groups pushback _group;
+
+_group setBehaviour "CARELESS";
+_type = AIT_civTypes_gunDealers call BIS_Fnc_selectRandom;
+_pos = [[[_gundealerpos,50]]] call BIS_fnc_randomPos;
+_dealer = _group createUnit [_type, _pos, [],0, "NONE"];
- _group setBehaviour "CARELESS";
- _type = AIT_civTypes_gunDealers call BIS_Fnc_selectRandom;
- _pos = [[[_gundealerpos,50]]] call BIS_fnc_randomPos;
- _dealer = _group createUnit [_type, _pos, [],0, "NONE"];
-
- _wp = _group addWaypoint [_gundealerpos,0];
- _wp setWaypointType "MOVE";
- _wp setWaypointSpeed "LIMITED";
+_wp = _group addWaypoint [_gundealerpos,0];
+_wp setWaypointType "MOVE";
+_wp setWaypointSpeed "LIMITED";
+
+_dealer remoteExec ["initGunDealerLocal",0,true];
+[_dealer] call initGunDealer;
- _dealer remoteExec ["initGunDealerLocal",0,true];
- [_dealer] call initGunDealer;
- _allactive = spawner getVariable ["activedealers",[]];
- _allactive pushback _dealer;
- spawner setVariable ["activedealers",_allactive,true];
- };
- }else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- }else{
- _active = false;
- //Tear it all down
- _allactive = spawner getVariable ["activedealers",[]];
- {
- {
- sleep 0.1;
- if(_x in _allactive) then {
- _allactive deleteAt (_allactive find _x);
- };
- if !(_x call hasOwner) then {
- deleteVehicle _x;
- };
- }foreach(units _x);
- deleteGroup _x;
- }foreach(_groups);
- spawner setVariable ["activedealers",_allactive,true];
- _groups = [];
- };
- };
- sleep 2;
-};
\ No newline at end of file
+_groups
\ No newline at end of file
diff --git a/spawners/insertion/newLeader.sqf b/spawners/insertion/newLeader.sqf
index 461f836b..5483c2c9 100644
--- a/spawners/insertion/newLeader.sqf
+++ b/spawners/insertion/newLeader.sqf
@@ -1,3 +1,4 @@
+private ["_pos","_town","_townPos","_drop","_group","_start","_stability","_vehtype","_num","_count","_police","_group","_tgroup","_wp","_attackdir","_vehtype","_civ"];
_leaderpos = _this select 0;
_numcrim = _this select 1;
diff --git a/spawners/insertion/reGarrisonTown.sqf b/spawners/insertion/reGarrisonTown.sqf
index 5400d3b3..3a7707b9 100644
--- a/spawners/insertion/reGarrisonTown.sqf
+++ b/spawners/insertion/reGarrisonTown.sqf
@@ -1,4 +1,4 @@
-private ["_drop","_group","_start","_stability","_vehtype","_num","_count","_police","_group","_tgroup","_wp","_attackdir","_vehtype","_civ"];
+private ["_pos","_town","_townPos","_drop","_group","_start","_stability","_vehtype","_num","_count","_police","_group","_tgroup","_wp","_attackdir","_vehtype","_civ"];
_town = _this;
_townPos = server getVariable _town;
@@ -10,22 +10,8 @@ _police = [];
_support = [];
_opendoor = false;
-_close = nil;
_dist = 8000;
-{
- _pos = _x select 0;
- _name = _x select 1;
- if([_pos,_region] call fnc_isInMarker) then {
- _d = (_pos distance _townPos);
- if(_d < _dist) then {
- _dist = _d;
- _close = _pos;
-
- };
- };
-}foreach(AIT_NATOobjectives);
-
_attackdir = random 360;
if(surfaceIsWater ([_townPos,150,_attackDir] call BIS_fnc_relPos)) then {
@@ -50,7 +36,7 @@ _vehtype = AIT_NATO_Vehicle_PoliceHeli;
_drop = [_townPos,[350,500],_attackdir + (random 90)] call SHK_pos;
_spawnpos = AIT_NATO_HQPos;
-if(_stability < 25) then {
+if(_stability < 15) then {
//last ditch efforts to save this town
//send in the big guns
_vehtype = AIT_NATO_Vehicle_AirTransport;
diff --git a/spawners/insertion/sendCrims.sqf b/spawners/insertion/sendCrims.sqf
index 57ac4d16..6925923c 100644
--- a/spawners/insertion/sendCrims.sqf
+++ b/spawners/insertion/sendCrims.sqf
@@ -1,4 +1,4 @@
-
+private ["_pos","_town","_townPos","_drop","_group","_start","_stability","_vehtype","_num","_count","_police","_group","_tgroup","_wp","_attackdir","_vehtype","_civ"];
_numcrim = _this select 0;
_town = _this select 1;
diff --git a/spawners/townGarrison.sqf b/spawners/townGarrison.sqf
index f797ea63..c70a8179 100644
--- a/spawners/townGarrison.sqf
+++ b/spawners/townGarrison.sqf
@@ -1,107 +1,64 @@
-private ["_id","_town","_posTown","_active","_groups","_numNATO","_pop","_count","_range"];
+private ["_id","_town","_posTown","_groups","_numNATO","_pop","_count","_range"];
if (!isServer) exitwith {};
-_active = false;
-
_count = 0;
-_id = _this select 0;
-_posTown = _this select 1;
-_town = _this select 3;
+_town = _this;
+_posTown = server getVariable _town;
_groups = [];
-waitUntil{spawner getVariable _id};
-
+_numNATO = server getVariable format["garrison%1",_town];
+_count = 0;
+_range = 300;
+_pergroup = 4;
+
+while {_count < _numNATO} do {
+ _groupcount = 0;
+ _group = createGroup blufor;
+ _groups pushBack _group;
+
+ _start = [[[_posTown,_range]]] call BIS_fnc_randomPos;
+ _civ = _group createUnit [AIT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"];
+ _civ setVariable ["garrison",_town,false];
+ _civ setRank "CORPORAL";
+ _civ setBehaviour "SAFE";
+ [_civ,_town] call initPolice;
+ _count = _count + 1;
+ _groupcount = _groupcount + 1;
+
+ while {(_groupcount < _pergroup) and (_count < _numNATO)} do {
+ _pos = [[[_start,50]]] call BIS_fnc_randomPos;
+
+ _civ = _group createUnit [AIT_NATO_Unit_Police, _pos, [],0, "NONE"];
+ _civ setVariable ["garrison",_town,false];
-while{true} do {
- //Do any updates here that should happen whether spawned or not
- if(_town in (server getVariable "NATOabandoned")) exitWith{};
- //Main spawner
- if !(_active) then {
- if (spawner getVariable _id) then {
- _active = true;
- //Spawn stuff in
- _numNATO = server getVariable format["garrison%1",_town];
- _count = 0;
- _range = 300;
- _pergroup = 4;
-
- while {(spawner getVariable _id) and (_count < _numNATO)} do {
- _groupcount = 0;
- _group = createGroup blufor;
- _groups pushBack _group;
-
- _start = [[[_posTown,_range]]] call BIS_fnc_randomPos;
- _civ = _group createUnit [AIT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"];
- _civ setVariable ["garrison",_town,false];
+ _civ setRank "PRIVATE";
+ [_civ,_town] call initPolice;
+ _civ setBehaviour "SAFE";
+
+ _groupcount = _groupcount + 1;
+ _count = _count + 1;
+
+ };
+ _group call initPolicePatrol;
+ _range = _range + 50;
+ sleep 0.03;
+};
- _civ setRank "CORPORAL";
- _civ setBehaviour "SAFE";
- [_civ,_town] call initPolice;
- _count = _count + 1;
- _groupcount = _groupcount + 1;
-
- while {(spawner getVariable _id) and (_groupcount < _pergroup) and (_count < _numNATO)} do {
- _pos = [[[_start,50]]] call BIS_fnc_randomPos;
-
- _civ = _group createUnit [AIT_NATO_Unit_Police, _pos, [],0, "NONE"];
- _civ setVariable ["garrison",_town,false];
+{
+ _cur = _x;
+ {
+ _cur addCuratorEditableObjects [(units _x),true];
+ }foreach(_groups);
+} forEach allCurators;
- _civ setRank "PRIVATE";
- [_civ,_town] call initPolice;
- _civ setBehaviour "SAFE";
-
- _groupcount = _groupcount + 1;
- _count = _count + 1;
- };
- _group call initPolicePatrol;
- _range = _range + 50;
- };
-
- {
- _cur = _x;
- {
- _cur addCuratorEditableObjects [(units _x),true];
- }foreach(_groups);
- } forEach allCurators;
-
- sleep 1;
- {
- {
- _x setDamage 0;
- }foreach(units _x);
- }foreach(_groups);
- }else{
- _need = server getVariable format ["garrisonadd%1",_town];
- if(_need > 1) then {
- server setVariable[format ["garrisonadd%1",_town],_need-2,false];
- server setVariable[format ["garrison%1",_town],_numNATO+2,false];
- }
- };
- }else{
- if (spawner getVariable _id) then {
- //Do updates here that should happen only while spawned
- //...
- _need = server getVariable format ["garrisonadd%1",_town];
- if(_need > 1) then {
- _town spawn reGarrisonTown;
- server setVariable[format ["garrisonadd%1",_town],_need-2,false];
- }
- }else{
- _active = false;
- //Tear it all down
- {
- {
- sleep 0.1;
- deleteVehicle _x;
- }foreach(units _x);
- deleteGroup _x;
- }foreach(_groups);
- _groups = [];
- };
- };
- sleep 2;
-
- _numNATO = server getVariable format["garrison%1",_town];
-};
\ No newline at end of file
+_groups spawn {
+ sleep 1;
+ {
+ {
+ _x setDamage 0;
+ }foreach(units _x);
+ }foreach(_this);
+};
+_groups
\ No newline at end of file
diff --git a/stats.sqf b/stats.sqf
index f0baaaf0..bbeadfee 100644
--- a/stats.sqf
+++ b/stats.sqf
@@ -46,7 +46,7 @@ while {alive player} do {
};
};
};
- _txt = format ["$%1
%2
%3
%4", [player getVariable "money", 1, 0, true] call CBA_fnc_formatNumber,_standing,_seen,_wanted];
+ _txt = format ["$%1
%2
%3", [player getVariable "money", 1, 0, true] call CBA_fnc_formatNumber,_seen,_wanted];
if (_txt != _currentTxt) then {
_setText ctrlSetStructuredText (parseText format ["%1", _txt]);
_setText ctrlCommit 0;
diff --git a/structures/trainingCamp.sqf b/structures/trainingCamp.sqf
new file mode 100644
index 00000000..e69de29b
diff --git a/templates/military/trainingCamp.sqf b/templates/military/trainingCamp.sqf
new file mode 100644
index 00000000..5f83b5ac
--- /dev/null
+++ b/templates/military/trainingCamp.sqf
@@ -0,0 +1,24 @@
+
+[
+ ["Land_IRMaskingCover_02_F",[-0.039865,0.14918,0],0,1,0,[],"","",true,false],
+ ["Box_NATO_Grenades_F",[1.23933,-1.05774,0],93.4866,1,0,[],"","",true,false],
+ ["Land_CampingTable_F",[-0.0490456,-1.74478,0],0,1,0,[],"","",true,false],
+ ["Land_CampingChair_V2_F",[-1.44146,-1.7173,0],223.485,1,0,[],"","",true,false],
+ ["B_CargoNet_01_ammo_F",[2.59602,-1.49866,0],0,1,0,[],"","",true,false],
+ ["Box_NATO_Equip_F",[4.0512,-1.09256,0],90.3535,1,0,[],"","",true,false],
+ ["Box_T_NATO_Wps_F",[-4.59645,-1.78761,0],205.797,1,0,[],"","",true,false],
+ ["Land_ClutterCutter_large_F",[-0.694746,-6.60154,-7.9155e-005],0,1,0,[],"","",true,false],
+ ["Land_Obstacle_Pass_F",[1.7224,6.14434,0],90,1,0,[],"","",true,false],
+ ["Land_Obstacle_Crawl_F",[-3.78085,6.02422,0],90,1,0,[],"","",true,false],
+ ["Land_Portable_generator_F",[-5.7769,-4.06599,0],0,1,0,[],"","",true,false],
+ ["Land_SatelliteAntenna_01_F",[-6.41051,-3.00256,0],212.621,1,0,[],"","",true,false],
+ ["Target_F",[6.05507,-5.10407,0],90,1,0,[],"","",true,false],
+ ["Land_Obstacle_Saddle_F",[5.46514,6.16445,0],90,1,0,[],"","",true,false],
+ ["Target_F",[6.05507,-6.10407,0],90,1,0,[],"","",true,false],
+ ["Land_ClutterCutter_large_F",[2.68296,8.92177,0],0,1,0,[],"","",true,false],
+ ["Target_F",[6.05507,-7.10407,0],90,1,0,[],"","",true,false],
+ ["Land_ClutterCutter_large_F",[-4.15402,8.36712,0],0,1,0,[],"","",true,false],
+ ["Target_F",[6.05507,-8.10407,0],90,1,0,[],"","",true,false],
+ ["Land_Obstacle_RunAround_F",[-3.47784,10.3439,0],90,1,0,[],"","",true,false],
+ ["Land_Obstacle_Climb_F",[4.86212,10.1031,0],0,1,0,[],"","",true,false]
+]
\ No newline at end of file
diff --git a/virtualization.sqf b/virtualization.sqf
index 4b84816a..d311aefe 100644
--- a/virtualization.sqf
+++ b/virtualization.sqf
@@ -74,7 +74,6 @@ _last = time;
while{true} do {
if (time - _last >= 0.5) then {sleep 0.1} else {sleep 0.5 - (time - _last)};
diag_virt = time - _last;
- publicVariable "diag_virt";
_last = time;
{
_id = _x select 0;
diff --git a/virtualization/towns.sqf b/virtualization/towns.sqf
index b913085d..96ebce9d 100644
--- a/virtualization/towns.sqf
+++ b/virtualization/towns.sqf
@@ -1,18 +1,101 @@
-_civs = compileFinal preProcessFileLineNumbers "spawners\civ.sqf";
-_garrison = compileFinal preProcessFileLineNumbers "spawners\townGarrison.sqf";
-_cardealers = compileFinal preProcessFileLineNumbers "spawners\carDealer.sqf";
-_crims = compileFinal preProcessFileLineNumbers "spawners\criminal.sqf";
-_gundealer = compileFinal preProcessFileLineNumbers "spawners\gunDealer.sqf";
-_vehicles = compileFinal preProcessFileLineNumbers "spawners\ambientVehicles.sqf";
-{
- _pos = server getvariable _x;
- _population = server getvariable format["population%1",_x];
- _spawners = [_civs,_garrison,_cardealers,_crims,_gundealer,_vehicles];
-
- if(_population > 250) then {
- //too hot for dealers
- _spawners = [_civs,_garrison,_cardealers,_crims,_vehicles];
- };
-
- [_pos,_spawners,_x] call AIT_fnc_registerSpawner;
+private ["_pos"];
+
+AIT_townSpawners = [
+ compileFinal preProcessFileLineNumbers "spawners\civ.sqf",
+ compileFinal preProcessFileLineNumbers "spawners\townGarrison.sqf",
+ compileFinal preProcessFileLineNumbers "spawners\carDealer.sqf",
+ compileFinal preProcessFileLineNumbers "spawners\criminal.sqf",
+ compileFinal preProcessFileLineNumbers "spawners\gunDealer.sqf",
+ compileFinal preProcessFileLineNumbers "spawners\ambientVehicles.sqf"
+];
+{
+ _pos = server getVariable _x;
+ [_pos,{
+ private ["_active","_groups","_town","_id"];
+ _active = false;
+ _id = _this select 0;
+ _town = _this select 3;
+ _groups = [];
+ waitUntil{spawner getVariable _id};
+
+ while{true} do {
+ //Do any updates here that should happen whether spawned or not
+ //Main spawner
+ if !(_active) then {
+ if (spawner getVariable _id) then {
+ _active = true;
+ {
+ [_groups,_town call _x] call BIS_fnc_arrayPushStack;
+ }foreach(AIT_townSpawners);
+ }else{
+ //NATO
+ _need = server getVariable [format ["garrisonadd%1",_town],0];
+ if(_need > 1) then {
+ server setVariable[format ["garrisonadd%1",_town],_need-2,false];
+ server setVariable[format ["garrison%1",_town],_numNATO+2,false];
+ };
+
+ //CRIM
+ _newpos = server getVariable format["crimnew%1",_town];
+ _addnum = server getVariable format["crimadd%1",_town];
+ _current = server getVariable format["numcrims%1",_town];
+ if((typename "_newpos") == "ARRAY") then {
+ server setVariable [format["crimleader%1",_town],_newpos,false];
+ server setVariable [format["crimnew%1",_town],false,false];
+ };
+ server setVariable [format["numcrims%1",_town],_current+_addnum,false];
+ server setVariable [format["crimadd%1",_town],0,false];
+ };
+ }else{
+ if (spawner getVariable _id) then {
+ //Do updates here that should happen only while spawned
+
+ //NATO
+ _need = server getVariable [format ["garrisonadd%1",_town],0];
+ if(_need > 1) then {
+ _town spawn reGarrisonTown;
+ server setVariable[format ["garrisonadd%1",_town],_need-2,false];
+ };
+
+ //CRIM
+ _newpos = server getVariable [format["crimnew%1",_town],false];
+ _addnum = server getVariable [format["crimadd%1",_town],0];
+ if((typename _newpos) == "ARRAY") then {
+ server setVariable [format["crimleader%1",_town],_newpos,true];
+ _new = [_newpos,_addnum,_town] call newleader;
+ [_soldiers,_new] call BIS_fnc_arrayPushStack;
+ _groups pushback group(_new select 0);
+ }else{
+ if(_addnum > 0) then {
+ _new = [_addnum,_town] call sendCrims;
+ [_soldiers,_new] call BIS_fnc_arrayPushStack;
+ _groups pushback group(_new select 0);
+ };
+ };
+ server setVariable [format["crimnew%1",_town],false,false];
+ _current = server getVariable [format["numcrims%1",_town],0];
+ server setVariable [format["numcrims%1",_town],_current+_addnum,false];
+ server setVariable [format["crimadd%1",_town],0,false];
+ }else{
+ _active = false;
+ //Tear it all down
+ {
+ if(typename _x == "GROUP") then {
+ {
+ sleep 0.05;
+ if !(_x call hasOwner) then {
+ deleteVehicle _x;
+ };
+ }foreach(units _x);
+ deleteGroup _x;
+ }else{
+ deleteVehicle _x;
+ };
+ sleep 0.05;
+ }foreach(_groups);
+ _groups = [];
+ };
+ };
+ };
+ },_x] call AIT_fnc_registerSpawner;
}foreach(AIT_allTowns);
\ No newline at end of file
diff --git a/wantedSystem.sqf b/wantedSystem.sqf
index 2f56cd22..922cbbd7 100644
--- a/wantedSystem.sqf
+++ b/wantedSystem.sqf
@@ -8,16 +8,28 @@ _unit setVariable ["hiding",false,false];
_unit addEventHandler ["take", {
_me = _this select 0;
- if (captive _me) then {
- _container = _this select 1;
+ _container = _this select 1;
+
+ if (captive _me) then {
_type = typeof _container;
if(_container isKindOf "Man") then {
- if !(_container call hasOwner and (_me call unitSeen)) then {
+ if (!(_container call hasOwner) and (_me call unitSeen)) then {
//Looting dead bodies is illegal
_me setCaptive false;
}
};
};
+
+ if(_container isKindOf "Man" and !(_container call hasOwner)) then {
+ _container setVariable ["looted",true,true];
+ [_container] spawn {
+ sleep 300;
+ _n = _this select 0;
+ if!(isNil "_n") then {
+ deleteVehicle (_this select 0);
+ }
+ };
+ };
}];
_unit addEventHandler ["Fired", {
@@ -39,7 +51,7 @@ _unit addEventHandler ["Fired", {
}];
while {alive _unit} do {
- sleep 2;
+ sleep 3;
//check wanted status
if !(captive _unit) then {
@@ -71,56 +83,126 @@ while {alive _unit} do {
_unit setVariable ["hiding",0,false];
if(_unit call unitSeenCRIM) then {
+ sleep 0.05;
//chance they will just notice you if your global rep is very high or low
- _totalrep = abs(_unit getVariable ["rep",0]) * 0.5;
- if(random 10000 < _totalrep) then {
- _unit setCaptive false;
- hint "A gang has recognized you";
- }else{
- if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "") or ((headgear _unit) in AIT_illegalHeadgear) or ((vest _unit) in AIT_illegalVests)) then {
- hint "A gang spotted your weapon";
- _unit setCaptive false;
+ if(vehicle _unit != _unit) exitWith {
+ _bad = false;
+ call {
+ if !(typeof (vehicle _unit) in AIT_allVehicles) exitWith {
+ _bad = true; //They are driving or in a non-civilian vehicle including statics
+ };
+ //Check if unit is turned out and showing a weapon
+ if([_unit] call CBA_fnc_isTurnedOut) then {
+ if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "") or ((headgear _unit) in AIT_illegalHeadgear) or ((vest _unit) in AIT_illegalVests)) then {
+ _bad = true;
+ };
+ };
+ };
+
+ if(_bad) then {
+ _unit setCaptive false;
{
if(side _x == east) then {
- _x reveal [_unit,1.5];
- sleep 0.4;
+ _x reveal [_unit,1.5];
};
}foreach(player nearentities ["Man",200]);
};
};
- }else{
- //chance they will just notice you if your local or global rep is very low
- //The info you came here for is: Your global rep needs to be 4 x your local rep in order to cancel out this effect
+ _totalrep = abs(_unit getVariable ["rep",0]) * 0.5;
+ if((_totalrep > 50) and (random 10000 < _totalrep)) exitWith {
+ _unit setCaptive false;
+ if(isPlayer _unit) then {
+ hint "A gang has recognized you";
+ };
+ {
+ if(side _x == east) then {
+ _x reveal [_unit,1.5];
+ };
+ }foreach(player nearentities ["Man",200]);
+ };
+ if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "") or ((headgear _unit) in AIT_illegalHeadgear) or ((vest _unit) in AIT_illegalVests)) exitWith {
+ if(isPlayer _unit) then {
+ hint "A gang spotted your weapon";
+ };
+ _unit setCaptive false;
+ {
+ if(side _x == east) then {
+ _x reveal [_unit,1.5];
+ };
+ }foreach(player nearentities ["Man",200]);
+ };
+
+ }else{
if(_unit call unitSeenNATO) then {
+ sleep 0.05;
_town = (getpos _unit) call nearestTown;
- _totalrep = ((_unit getVariable ["rep",0]) * -0.25) + ((_unit getVariable format["rep%1",_town]) * -1);
- if(random 1500 < _totalrep) then {
+ _totalrep = ((_unit getVariable ["rep",0]) * -0.25) + ((_unit getVariable [format["rep%1",_town],0]) * -1);
+ if((_totalrep > 50) and (random 10000 < _totalrep)) exitWith {
_unit setCaptive false;
- hint "NATO has recognized you";
- }else{
- if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "")) then {
- hint "NATO has seen your weapon";
- _unit setCaptive false;
+ if(isPlayer _unit) then {
+ hint "NATO has recognized you";
+ };
+ {
+ if(side _x == west) then {
+ _x reveal [_unit,1.5];
+ };
+ sleep 0.05;
+ }foreach(player nearentities ["Man",200]);
+ };
+ if(((vehicle _unit) != _unit) or count attachedObjects _unit > 0) exitWith {
+ _bad = false;
+ call {
+ if(count attachedObjects _unit > 0) exitWith {
+ {
+ if(typeOf _x in AIT_staticMachineGuns) exitWith {_bad = true};
+ }foreach(attachedObjects _unit);
+ };
+ if !(typeof (vehicle _unit) in AIT_allVehicles) exitWith {
+ _bad = true; //They are driving or in a non-civilian vehicle including statics
+ };
+ //Check if unit is turned out and showing a weapon
+ if([_unit] call CBA_fnc_isTurnedOut) then {
+ if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "") or ((headgear _unit) in AIT_illegalHeadgear) or ((vest _unit) in AIT_illegalVests)) then {
+ _bad = true;
+ };
+ };
+ };
+
+ if(_bad) then {
+ _unit setCaptive false;
{
if(side _x == west) then {
- _x reveal [_unit,1.5];
- sleep 0.2;
+ _x reveal [_unit,1.5];
};
+ sleep 0.05;
}foreach(player nearentities ["Man",800]);
- }else{
- if ((headgear _unit in AIT_illegalHeadgear) or (vest _unit in AIT_illegalVests)) then {
- hint "You are wearing Gendarmerie gear";
- _unit setCaptive false;
- {
- if(side _x == west) then {
- _x reveal [_unit,1.5];
- sleep 0.2;
- };
- }foreach(player nearentities ["Man",200]);
+ };
+ };
+ if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "")) exitWith {
+ if(isPlayer _unit) then {
+ hint "NATO has seen your weapon";
+ };
+ _unit setCaptive false;
+ {
+ if(side _x == west) then {
+ _x reveal [_unit,1.5];
};
+ sleep 0.05;
+ }foreach(player nearentities ["Man",800]);
+ };
+ if ((headgear _unit in AIT_illegalHeadgear) or (vest _unit in AIT_illegalVests)) exitWith {
+ if(isPlayer _unit) then {
+ hint "You are wearing Gendarmerie gear";
};
+ _unit setCaptive false;
+ {
+ if(side _x == west) then {
+ _x reveal [_unit,1.5];
+ };
+ sleep 0.05;
+ }foreach(player nearentities ["Man",200]);
};
- };
+ };
};
};
};
\ No newline at end of file
diff --git a/weather.sqf b/weather.sqf
new file mode 100644
index 00000000..51b20f3e
--- /dev/null
+++ b/weather.sqf
@@ -0,0 +1,121 @@
+private [];
+_mode = "Clear";
+_forecast = "Clear";
+
+_raintarget = rain;
+_overtarget = overcast;
+_fogTarget = fog;
+_wavetarget = waves;
+
+_count = 0;
+_nextchange = 0;
+
+while {true} do {
+ _month = date select 1;
+
+ //This is a south pacific climate (or thereabouts)
+ //Dry season:
+ _stormchance = 3;
+ _rainchance = 8;
+ _cloudychance = 20;
+
+ if(_month < 5 or _month > 10) then {
+ //Wet season
+ _stormchance = 15;
+ _rainchance = 20;
+ _cloudychance = 50;
+ };
+ //Yeh thats about it..
+
+ if(_count >= _nextchange) then {
+ _mode = _forecast;
+ _forecast = "Clear";
+ _count = 0;
+ call {
+ if(_mode == "Clear") exitWith {
+ if((random 100) < _stormchance) exitWith {_forecast = "Storm"};
+ if((random 100) < _rainchance) exitWith {_forecast = "Rain"};
+ if((random 100) < _cloudychance) exitWith {_forecast = "Cloudy"};
+ };
+ if(_mode == "Storm") exitWith {
+ _forecast = "Rain";
+ };
+ if(_mode == "Rain") exitWith {
+ if((random 100) < _stormchance) exitWith {_forecast = "Storm"};
+ if((random 100) > _rainchance) exitWith {_forecast = "Clear"};
+ if((random 100) < 50) exitWith {_forecast = "Cloudy"};
+ };
+ if(_mode == "Cloudy") exitWith {
+ if((random 100) < _stormchance) exitWith {_forecast = "Storm"};
+ if((random 100) < _rainchance) exitWith {_forecast = "Rain"};
+ if((random 100) > _cloudychance) exitWith {_forecast = "Clear"};
+ };
+ };
+ _nextchange = 240 + random 480;
+ call {
+ if(_forecast == "Storm") exitWith {
+ _raintarget = 1;
+ _overtarget = 1;
+ _fogtarget = 0.005;
+ _wavetarget = 1;
+ 120 setRain 0.8;
+ };
+ if(_forecast == "Rain") exitWith {
+ _raintarget = 0.5;
+ _overtarget = 1;
+ _fogtarget = 0.002;
+ _wavetarget = 0.5;
+ 120 setRain 0.5;
+ };
+ if(_forecast == "Cloudy") exitWith {
+ _raintarget = 0;
+ _overtarget = 0.7;
+ _fogtarget = 0.001;
+ _wavetarget = 0.2;
+ 120 setRain 0;
+ };
+ if(_forecast == "Clear") exitWith {
+ _raintarget = 0;
+ _overtarget = random 0.2;
+ _fogtarget = 0;
+ _wavetarget = random 0.2;
+ 120 setRain 0;
+ };
+ };
+ server setVariable ["forecast",_forecast,true];
+ };
+
+ _rain = rain;
+ _over = overcast;
+ _fog = fog;
+ _waves = waves;
+
+ if(_raintarget > rain) then {_rain = _rain + 0.1};
+ if(_raintarget < rain) then {_rain = _rain - 0.1};
+ if(_overtarget > overcast) then {_over = _over + 0.3};
+ if(_overtarget < overcast) then {_over = _over - 0.3};
+ if(_fogTarget > fog) then {_fog = _fog + 0.0001};
+ if(_fogTarget < fog) then {_fog = _fog - 0.0001};
+ if(_wavetarget > waves) then {_waves = _waves + 0.1};
+ if(_wavetarget < waves) then {_waves = _waves - 0.1};
+
+ if(_rain > 1) then {_rain = 1};
+ if(_rain < 0) then {_rain = 0};
+ if(_over > 1) then {_over = 1};
+ if(_over < 0) then {_over = 0};
+ if(_fog < 0) then {_fog = 0};
+ if(_waves > 1) then {_waves = 1};
+ if(_waves < 0) then {_waves = 0};
+
+ if(overcast < 0.7) then {
+ _fog = 0;
+ _rain = 0;
+ };
+
+ 0 setOvercast _over;
+ 0 setFog _fog;
+ 0 setWaves _waves;
+ _count = _count + 1;
+ sleep 5;
+
+};
\ No newline at end of file