diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 60583e29..18627a00 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.3"; +OnLoadMission = "v0.7.3.4"; 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 01ebe470..c465df03 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -246,7 +246,7 @@ while {true} do { if !(_name in _abandoned) then { if(_pos call OT_fnc_inSpawnDistance) then { _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]); - _numres = {side _x == resistance} count (_pos nearObjects ["CAManBase",200]); + _numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",200]); if(_nummil < 3 and _numres > 0) then { _garrisoned = true; server setVariable ["NATOattacking",_name,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 641bb3c8..b49d475b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -38,6 +38,8 @@ if(isMultiplayer and (!isServer)) then { call compile preprocessFileLineNumbers "initFuncs.sqf"; call compile preprocessFileLineNumbers "initVar.sqf"; +}else{ + OT_varInitDone = true; }; _start = [1385.17,505.453,1.88826]; @@ -53,7 +55,7 @@ introcam = _introcam; if(player == bigboss and (server getVariable ["StartupType",""] == "")) then { - waitUntil {!(isnull (findDisplay 46))}; + waitUntil {!(isnull (findDisplay 46)) and OT_varInitDone}; sleep 1; _nul = createDialog "OT_dialog_start"; }else{ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf index 42790d67..c2a7d215 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf @@ -10,6 +10,8 @@ if (!isMultiplayer) exitWith {}; call compile preprocessFileLineNumbers "initFuncs.sqf"; call compile preprocessFileLineNumbers "initVar.sqf"; +OT_varInitDone = true; +publicVariable "OT_varInitDone"; if(OT_fastTime) then { setTimeMultiplier 4; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index c0c881f5..6c10029e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm @@ -16,7 +16,7 @@ class EditorData }; class LayerIndexProvider { - nextID=234; + nextID=239; }; class Camera { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf index bdb900e4..ff232980 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf @@ -3,53 +3,56 @@ _lasthour = 0; waitUntil {sleep 1;server getVariable ["StartupType",""] != ""}; sleep 20; while {true} do { + _numplayers = count([] call CBA_fnc_players); _lasthour = date select 3; - _totalStability = 0; - _totalPop = 0; - private _abandoned = server getVariable ["NATOabandoned",[]]; - { - private _town = _x; - private _townPos = server getVariable _town; - private _commsAbandoned = ((_townPos call OT_fnc_nearestComms) select 1) in _abandoned; - private _stability = server getVariable format["stability%1",_town]; - private _pop = server getVariable format["population%1",_town]; - _totalStability = _totalStability + _stability; - _totalPop = _totalPop + _pop; - if(_town in _abandoned) then { - if(_commsAbandoned) then { - //Resistance controls both, stability goes up if theres police - _police = server getVariable [format["police%1",_town],0]; - if (_police > 0) then { - [_town,floor(_police / 2)] call stability; - }; - }else{ - //NATO owns the tower but not the town, stability goes down - if((random 100) > 80) then { - [_town,-1] call stability; - }; - }; - }else{ - if(_commsAbandoned) then { - //Resistance controls tower but not town, stability goes down - _police = server getVariable [format["garrison%1",_town],0]; - _chance = 20; - if(_police < 4) then { - _chance = 50; - }; - if(_police < 2) then { - _chance = 80; - }; - if((random 100) < _chance) then { - [_town,-2] call stability; + if(_numplayers > 0) then { + _totalStability = 0; + _totalPop = 0; + private _abandoned = server getVariable ["NATOabandoned",[]]; + { + private _town = _x; + private _townPos = server getVariable _town; + private _commsAbandoned = ((_townPos call OT_fnc_nearestComms) select 1) in _abandoned; + private _stability = server getVariable format["stability%1",_town]; + private _pop = server getVariable format["population%1",_town]; + _totalStability = _totalStability + _stability; + _totalPop = _totalPop + _pop; + if(_town in _abandoned) then { + if(_commsAbandoned) then { + //Resistance controls both, stability goes up if theres police + _police = server getVariable [format["police%1",_town],0]; + if (_police > 0) then { + [_town,floor(_police / 2)] call stability; + }; }else{ - if((random 100) > 50) then { + //NATO owns the tower but not the town, stability goes down + if((random 100) > 80) then { [_town,-1] call stability; }; }; + }else{ + if(_commsAbandoned) then { + //Resistance controls tower but not town, stability goes down + _police = server getVariable [format["garrison%1",_town],0]; + _chance = 20; + if(_police < 4) then { + _chance = 50; + }; + if(_police < 2) then { + _chance = 80; + }; + if((random 100) < _chance) then { + [_town,-2] call stability; + }else{ + if((random 100) > 50) then { + [_town,-1] call stability; + }; + }; + }; }; - }; - }foreach(OT_allTowns); - server setVariable ["stabilityTanoa",_totalStability / (count OT_allTowns),true]; - server setVariable ["populationTanoa",_totalPop,true]; + }foreach(OT_allTowns); + server setVariable ["stabilityTanoa",_totalStability / (count OT_allTowns),true]; + server setVariable ["populationTanoa",_totalPop,true]; + }; waitUntil {sleep 5;(date select 3) != _lasthour}; //do actions on the hour }; diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf index 1e6d167e..bd6a30ae 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 < 3) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) 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 < 3) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 5) 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 < 3) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) 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 < 3) or (_timeOut < time)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) 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 < 2) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) or (_timeOut < time) or (unitReady _unit)}; if(alive _unit and (_timeOut > time)) then { _s = (weaponsItems _weapon) select 0; _cls = (_s select 0); @@ -153,7 +153,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 < 2) or (_timeOut < time) or (unitReady _unit)}; + waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time) or (unitReady _unit)}; if((!alive _unit) or (_timeOut < time)) exitWith {}; [_unit,_t] call dumpStuff;