diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf index 97b5ba50..e1148819 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf @@ -29,19 +29,6 @@ openMap true; if([_pos,"Misc"] call OT_fnc_canPlace) then { _handled = true; }; - - _ob = _pos call OT_fnc_nearestLocation; - - _ob params ["_obpos","_obtype","_data"]; - if (_obtype == "Business") then { - _p = _data select 0; - if(_pos distance _p < 50) then { - _name = _data select 1; - if(_name in (server getvariable ["GEURowned",[]])) then { - _handled = true; - }; - }; - }; }; @@ -53,9 +40,11 @@ openMap true; _validob = (_obpos distance _pos < 50) and (_obname in OT_allAirports); if !(_validob) then { if (!OT_adminMode and !(_pos inArea _region)) then { - _valid = false; - "You cannot fast travel between islands unless your destination is a controlled airfield" call notify_minor; - openMap false; + if !([_region,_pos] call OT_fnc_regionIsConnected) then { + _valid = false; + "You cannot fast travel between islands unless there is a bridge or your destination is a controlled airfield" call notify_minor; + openMap false; + }; }; }; if(!_valid) exitWith {}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf index d416c3ea..9eb63bff 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -209,6 +209,7 @@ if(_cost > 0) then { if(_typecls == "Camp") then { _mrkid = format["%1-camp",getplayeruid player]; createMarker [_mrkid,getpos modeTarget]; + _mrkid setMarkerPos (getpos modeTarget); _camp = player getVariable["camp",[]]; if(count _camp > 0) then { { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf index 86a9e67d..e00c4826 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf @@ -25,6 +25,7 @@ _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; _target = _sorted select 0; _doTransfer = { + private _veh = vehicle player; private _target = _this; private _toname = (typeof _target) call ISSE_Cfg_Vehicle_GetName; private _iswarehouse = (_target isKindOf "OT_warehouse"); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/economy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/economy.sqf index 3b4dd7dd..2ce82baf 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/economy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/economy.sqf @@ -12,7 +12,8 @@ OT_economicData = [ [[11921.1,10206.5,0],"Red Spring Surface Mine","","OT_Steel"], [[12383,14135.3,0],"Ravi-ta Island Resort"], [[4687.63,3590.75,0],"Katkoula Sugar Plantations","","OT_Sugarcane"], - [[8026.38,8946.16,0],"Lifou Sugar Plantations","","OT_Sugarcane"] + [[8026.38,8946.16,0],"Lifou Sugar Plantations","","OT_Sugarcane"], + [[12445.6,3982.46,0],"Saioko Lumberyard","","OT_Wood"] ]; OT_factoryPos = [4226.49,8370.82,0]; OT_factoryVehicleSpawn = [4265.64,8400.65,0]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 18627a00..0d948383 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext @@ -2,7 +2,7 @@ overviewPicture = "\ot\campaign\missions\Overthrow.Tanoa\overthrow_tanoa.jpg"; author="ARMAzac"; briefingName = "Overthrow Tanoa"; OnLoadName = "Overthrow Tanoa"; -OnLoadMission = "v0.7.3.4"; +OnLoadMission = "v0.7.3.5"; loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg"; onLoadMissionTime = 1; allowSubordinatesTakeWeapons= 1; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf index c465df03..1cc59746 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -217,8 +217,8 @@ while {true} do { { if(side _x == west) then { _lead = (units _x) select 0; - if(_lead getVariable ["garrison",""] == "HQ") then { - if(vehicle _lead != _lead) then { + if((_lead getVariable ["garrison",""]) == "HQ") then { + if((vehicle _lead) != _lead) then { [vehicle _lead] spawn OT_fnc_cleanup; }; [_x] spawn OT_fnc_cleanup; @@ -446,14 +446,17 @@ while {true} do { _pos = _x select 0; _name = _x select 1; if !(_name in _abandoned) then { - _garrison = server getvariable format["garrison%1",_name]; - if(_garrison < 2) then { - _abandoned pushback _name; - server setVariable ["NATOabandoned",_abandoned,true]; - _name setMarkerColor "ColorGUER"; - _t = _pos call OT_fnc_nearestTown; - format["We have captured the %1 tower",_name] remoteExec ["notify_good",0,false]; - _resources = _resources - 100; + if(_pos call OT_fnc_inSpawnDistance) then { + _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]); + _numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",100]); + if(_nummil < 3 and _numres > 0) then { + _abandoned pushback _name; + server setVariable ["NATOabandoned",_abandoned,true]; + _name setMarkerColor "ColorGUER"; + _t = _pos call OT_fnc_nearestTown; + format["Resistance has captured the %1 tower",_name] remoteExec ["notify_good",0,false]; + _resources = _resources - 100; + }; }; }; }foreach(OT_NATOcomms); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index c1f94067..280be8dd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -232,9 +232,13 @@ OT_fnc_regionIsConnected = { private _region = ""; if((typename _f) == "ARRAY") then { _por = _f call OT_fnc_getRegion; + }else{ + _por = _f; }; if((typename _t) == "ARRAY") then { _region = _t call OT_fnc_getRegion; + }else{ + _region = _t; }; if(_por == _region) exitWith {true}; private _ret = false; @@ -497,6 +501,7 @@ OT_fnc_initRecruit = { _civ setSkill 1.0; _civ setRank "PRIVATE"; + _civ setVariable ["NOAI",false,true]; _civ spawn wantedSystem; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index b49d475b..feecf11d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -189,12 +189,14 @@ if(isMultiplayer or _startup == "LOAD") then { _civ = group player createUnit [_type,_civ,[],0,"NONE"]; _civ setVariable ["owner",getplayeruid player,true]; _civ setVariable ["OT_xp",_xp,true]; + _civ setVariable ["NOAI",true,true]; _civ setRank _rank; [_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ]; [_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ]; _civ setUnitLoadout _loadout; _civ spawn wantedSystem; _civ setName _name; + [_civ] joinSilent grpNull; [_civ] joinSilent (group player); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 6e678848..8e650dd4 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -26,7 +26,7 @@ OT_currentMissionFaction = ""; OT_rankXP = [100,250,500,1000,4000,10000,100000]; //Used to control updates and persistent save compatability. When these numbers go up, that section will be reinitialized on load if required. (ie leave them alone) -OT_economyVersion = 11; +OT_economyVersion = 12; OT_NATOversion = 7; OT_CRIMversion = 1; OT_adminMode = false; @@ -55,10 +55,10 @@ OT_flag_CRIM = "Flag_Syndikat_F"; OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck_F","Land_Wreck_Car2_F","Land_Wreck_Car_F","Land_Wreck_Hunter_F","Land_Wreck_Offroad_F","Land_Wreck_Offroad2_F","Land_Wreck_UAZ_F","Land_Wreck_Truck_dropside_F"]; //rekt -OT_spawnTowns = ["Rautake","Tavu","Balavu","Muaceba","Katkoula","Savaka"]; //Towns where new players will spawn +OT_spawnTowns = ["Balavu","Katkoula","Savaka","Namuvaka","Katkoula","Lailai","Taga","Bua Bua","Blerick","Moddergat","Tobakoro"]; //Towns where new players will spawn OT_spawnHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Native_02_F"]; //Houses where new players will spawn -OT_NATOwait = 300; //Half the Average time between NATO orders +OT_NATOwait = 30; //Half the Average time between NATO orders OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 6c10029e..b9f2d0ab 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm @@ -16,14 +16,14 @@ class EditorData }; class LayerIndexProvider { - nextID=239; + nextID=244; }; class Camera { - pos[]={12818.754,4.0914273,1638.0454}; - dir[]={0.59407037,0.033020224,0.80378884}; - up[]={-0.019614713,0.99946028,-0.026539376}; - aside[]={0.80424064,1.7185812e-007,-0.59440583}; + pos[]={4243.1357,213.96484,8514.3701}; + dir[]={-0.18939824,-0.81224841,-0.55183423}; + up[]={-0.26368478,0.58325732,-0.7682761}; + aside[]={-0.94591063,4.8257789e-007,0.3246502}; }; }; binarizationWanted=0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf index a41d82a1..5e60f445 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf @@ -6,7 +6,7 @@ private _title = ""; //Here is where we might randomize the parameters a bit private _abandoned = server getVariable ["NATOabandoned",[]]; -_destinationName = selectRandom (OT_allTowns - _abandoned); +_destinationName = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]); private _posTown = server getVariable [_destinationName,[]]; _building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/informant.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/informant.sqf index 18b1b838..f59caf66 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/informant.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/informant.sqf @@ -6,7 +6,7 @@ private _title = ""; //Here is where we might randomize the parameters a bit private _abandoned = server getVariable ["NATOabandoned",[]]; -_destinationName = selectRandom (OT_allTowns - _abandoned); +_destinationName = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]); private _posTown = server getVariable [_destinationName,[]]; _building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/transportvip.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/transportvip.sqf index 1a0953ee..14e86fbb 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/transportvip.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/transportvip.sqf @@ -17,8 +17,8 @@ if((random 100) > 50) then { // 50/50 chance of either _pickup = [[[getMarkerPos format["port_%1", ceil(random 2)],80]]] call BIS_fnc_randomPos; _pickupTown = _pickup call OT_fnc_nearestTown; - //Destination is the town closest to the player right now - _destinationTown = (getpos player) call OT_fnc_nearestTown; + //Destination is a random town + _destinationTown = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]); _posTown = server getVariable _destinationTown; //Pick a random small house as the dropoff @@ -27,8 +27,8 @@ if((random 100) > 50) then { // 50/50 chance of either _type = "insertion"; }else{ //Extraction - //Pickup will be the closest town to the player right now - _pickupTown = (getpos player) call OT_fnc_nearestTown; + //Pickup will be a random town + _pickupTown = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]); _posTown = server getVariable _pickupTown; _pickup = [[[_posTown,200]]] call BIS_fnc_randomPos; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf index b3633e08..c4bd1ba8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf @@ -59,7 +59,12 @@ while {(_count < _numVeh)} do { _region = server getVariable format["region_%1",_town]; _dest = (server getVariable format["towns_%1",_region]) call BIS_fnc_selectRandom; - _moveto = getpos([server getvariable _dest,OT_allHouses + OT_allShops + OT_offices] call OT_fnc_getRandomBuilding); + _bdg = [server getvariable _dest,OT_allHouses + OT_allShops + OT_offices] call OT_fnc_getRandomBuilding; + if(typename _bdg == "BOOL") then { + _moveto = server getvariable _dest; + }else{ + _moveto = getpos(_bdg); + }; _wp = _group addWaypoint [_moveto,0]; _wp setWaypointType "MOVE"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf index 439ae075..32741247 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf @@ -2,7 +2,7 @@ private _town = _this; private _townPos = server getVariable _town; private _stability = server getVariable format["stability%1",_town]; -private _region = server getVariable format["region_%1",_town]; +private _region = server getVariable [format["region_%1",_town],"fake_region"]; private _police = []; private _support = []; @@ -30,6 +30,14 @@ private _attacking = server getVariable["NATOattacking",""]; }foreach(OT_NATOobjectives); if(!isNil "_close") then { + if((_close distance _townPos) > 2000) then { + _closestTown = [_townPos,true] call OT_fnc_nearestTown; + if !(_closestTown in _abandoned) then { + _close = server getVariable _closestTown; + _closest = _closestTown; + }; + }; + _current = server getVariable [format ["garrison%1",_town],0]; server setVariable [format ["garrison%1",_town],_current+4,true]; if !(_townPos call OT_fnc_inSpawnDistance) exitWith {}; @@ -65,7 +73,7 @@ if(!isNil "_close") then { [_civ,_town] call OT_fnc_initGendarm; _civ setBehaviour "SAFE"; - sleep 5; + sleep 1; _group call OT_fnc_initGendarmPatrol; _group call distributeAILoad; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf index 0cd60f25..3c66caa7 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf @@ -1,7 +1,7 @@ private _group = _this; private _garrison = ((units _group) select 0) getvariable ["garrison",""]; -private _start = position ((units _group) select 0); +private _start = server getVariable [_garrison,position ((units _group) select 0)]; if(isNil "_start") exitWith {}; diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf index bd6a30ae..b05c1df5 100644 --- a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf +++ b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf @@ -45,7 +45,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl _unit doMove getpos _t; _timeout = time + 120; - waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time) or (unitReady _unit)}; if(!alive _unit or (isNull _t) or (_timeOut < time)) exitWith {}; if !([_unit,_t] call dumpStuff) then { @@ -70,7 +70,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl _unit doMove getpos _deadguy; [_unit,1] call OT_fnc_experience; - waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 5) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 10) or (_timeOut < time)}; if((!alive _unit) or (_timeOut < time)) exitWith {}; [_deadguy,_unit] call takeStuff; @@ -92,7 +92,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl }foreach(_unit nearentities ["WeaponHolderSimulated",10]); if !(isNull _weapon) then { _unit doMove getpos _weapon; - waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 10) or (_timeOut < time)}; if(alive _unit and (_timeOut > time)) then { _s = (weaponsItems _weapon) select 0; @@ -111,7 +111,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl if(!alive _unit) exitWith {}; _timeout = time + 120; _unit doMove getpos _t; - waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time)}; if((!alive _unit) or (_timeOut < time)) exitWith {}; if !([_unit,_t] call dumpStuff) exitWith { @@ -136,7 +136,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl _timeout = time + 120; _unit doMove getpos _weapon; - waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 10) or (_timeOut < time) or (unitReady _unit)}; if(alive _unit and (_timeOut > time)) then { _s = (weaponsItems _weapon) select 0; _cls = (_s select 0); @@ -153,12 +153,12 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl if(!alive _unit) exitWith {}; _timeout = time + 120; _unit doMove getpos _t; - waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time) or (unitReady _unit)}; if((!alive _unit) or (_timeOut < time)) exitWith {}; [_unit,_t] call dumpStuff; }; - _unit setVariable ["NOAI",false,true]; + _unit setVariable ["NOAI",true,true]; if(_wasincar) then { _unit assignAsCargo _car; [_unit] orderGetIn true; diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf index 095899b4..9a328a86 100644 --- a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf +++ b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf @@ -25,7 +25,7 @@ if(((vehicle _unit) != _unit) and (vehicle _unit) != _target) then { }; if(vehicle _unit != _target) then { _unit doMove position _target; - waitUntil {sleep 1;!alive _unit or (_unit distance _target < 5)}; + waitUntil {sleep 1;!alive _unit or (_unit distance _target < 10)}; }; if(alive _unit) then { diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf index 9a67ebae..d1d9b0a7 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf @@ -21,5 +21,6 @@ _success = { _abandoned deleteAt (_abandoned find _objective); _count = {(_x getVariable ["garrison",""]) == _objective} count (allunits); server setVariable [format["garrison%1",_objective],_count,true]; + _objective setMarkerType "flag_NATO"; }; [_posObjective,_strength,_success,_fail,[_tskid,_objective],_objective] spawn OT_fnc_NATOQRF; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf index 8d625fae..7540d957 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf @@ -212,6 +212,7 @@ waitUntil { (_numalive < 4) or (time > _timeout) or (_numin > 4) }; +private _force = spawner getVariable["NATOattackforce",[]]; { _target = leader _x; { @@ -267,8 +268,8 @@ while {sleep 5;time < _timeout and !_won} do { if(side _x == west) then { if(count (units _x) > 0) then { _lead = (units _x) select 0; - if(_lead getVariable ["garrison",""] == "HQ") then { - if(vehicle _lead != _lead) then { + if((_lead getVariable ["garrison",""]) == "HQ") then { + if((vehicle _lead) != _lead) then { [vehicle _lead] spawn OT_fnc_cleanup; }else{ if((getpos _lead) call OT_fnc_inSpawnDistance) then { diff --git a/addons/overthrow_main/functions/fn_canPlace.sqf b/addons/overthrow_main/functions/fn_canPlace.sqf index df038b5d..7c7c826b 100644 --- a/addons/overthrow_main/functions/fn_canPlace.sqf +++ b/addons/overthrow_main/functions/fn_canPlace.sqf @@ -7,19 +7,41 @@ _isbase = false; _canplace = true; if(_typecls != "Base") then { - _base = _pos call OT_fnc_nearestBase; - if !(isNil "_base") then { - if((_base select 0) distance _pos < 100) then { - _isbase = true; + private _ob = (getpos player) call OT_fnc_nearestLocation; + if((_ob select 1) == "Business") then { + _obpos = (_ob select 2) select 0; + _obname = (_ob select 0); + + if(_obpos distance _pos < 250) then { + if(_obname in (server getVariable ["GEURowned",[]])) then { + _isbase = true; + _canplace = true; + }; }; }; - if(!_isbase) then { - _base = _pos call OT_fnc_nearestObjective; + if !(_canplace) then { + if(_pos distance OT_factoryPos < 250) then { + if("Factory" in (server getVariable ["GEURowned",[]])) then { + _isbase = true; + _canplace = true; + }; + }; + }; + if !(_canplace) then { + _base = _pos call OT_fnc_nearestBase; if !(isNil "_base") then { - if(((_base select 1) in (server getvariable "NATOabandoned")) and ((_base select 0) distance _pos) < 100) then { + if((_base select 0) distance _pos < 100) then { _isbase = true; }; }; + if(!_isbase) then { + _base = _pos call OT_fnc_nearestObjective; + if !(isNil "_base") then { + if(((_base select 1) in (server getvariable "NATOabandoned")) and ((_base select 0) distance _pos) < 100) then { + _isbase = true; + }; + }; + }; }; }else{ _base = _pos call OT_fnc_nearestBase; diff --git a/addons/overthrow_main/functions/geography/fn_nearestTown.sqf b/addons/overthrow_main/functions/geography/fn_nearestTown.sqf index 18cf97f8..717a8778 100644 --- a/addons/overthrow_main/functions/geography/fn_nearestTown.sqf +++ b/addons/overthrow_main/functions/geography/fn_nearestTown.sqf @@ -1 +1,11 @@ -text ((nearestLocations [ _this, ["NameCityCapital","NameCity","NameVillage","CityCenter"],2200]) select 0) +_ret = ""; +if(typename _this == "ARRAY") then { + if(count _this == 2) then { + _ret = text ((nearestLocations [ _this select 0, ["NameCityCapital","NameCity","NameVillage","CityCenter"],2200]) select 1); + }else{ + _ret = text ((nearestLocations [ _this, ["NameCityCapital","NameCity","NameVillage","CityCenter"],2200]) select 0); + } +}else{ + _ret = text ((nearestLocations [ _this, ["NameCityCapital","NameCity","NameVillage","CityCenter"],2200]) select 0); +}; +_ret