From fcf0d5c6532f94858f368a1ddc9f6a98da31e8af Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Thu, 4 May 2017 00:42:35 +1000 Subject: [PATCH 01/16] moving some functions to mod --- addons/overthrow_main/CfgFunctions.hpp | 57 ++++++++++++ .../missions/Overthrow.Tanoa/UI/buildMenu.sqf | 12 +-- .../Overthrow.Tanoa/UI/characterSheet.sqf | 2 +- .../Overthrow.Tanoa/UI/fn_optionsDialog.sqf | 2 +- .../Overthrow.Tanoa/UI/policeDialog.sqf | 2 +- .../Overthrow.Tanoa/UI/recruitDialog.sqf | 2 +- .../Overthrow.Tanoa/actions/addPolice.sqf | 4 +- .../Overthrow.Tanoa/actions/buyAmmobox.sqf | 49 ---------- .../Overthrow.Tanoa/actions/exportAll.sqf | 2 +- .../actions/fn_makeGeneral.sqf | 0 .../actions/fn_transferFunds.sqf | 0 .../Overthrow.Tanoa/actions/getIntel.sqf | 4 +- .../Overthrow.Tanoa/actions/giveMoney.sqf | 33 ------- .../Overthrow.Tanoa/actions/import.sqf | 2 +- .../Overthrow.Tanoa/actions/leaseBuilding.sqf | 6 +- .../missions/Overthrow.Tanoa/actions/move.sqf | 48 ---------- .../Overthrow.Tanoa/actions/placementMode.sqf | 20 ++--- .../Overthrow.Tanoa/actions/rearmGroup.sqf | 0 .../actions/recruitSoldier.sqf | 4 +- .../Overthrow.Tanoa/actions/recruitSquad.sqf | 4 +- .../Overthrow.Tanoa/actions/repairAll.sqf | 14 --- .../Overthrow.Tanoa/actions/setHome.sqf | 6 +- .../Overthrow.Tanoa/actions/takeMoney.sqf | 2 +- .../Overthrow.Tanoa/events/refuel.sqf | 2 +- .../Overthrow.Tanoa/events/somethingDied.sqf | 18 ++-- .../Overthrow.Tanoa/factions/GUER.sqf | 18 ++-- .../Overthrow.Tanoa/factions/NATO.sqf | 6 +- .../Overthrow.Tanoa/funcs/giveIntel.sqf | 8 +- .../missions/Overthrow.Tanoa/income.sqf | 2 +- .../missions/Overthrow.Tanoa/initFuncs.sqf | 89 +++---------------- .../Overthrow.Tanoa/initPlayerLocal.sqf | 6 +- .../interaction/initObjectLocal.sqf | 10 +-- .../interaction/initStaticMGLocal.sqf | 6 +- .../missions/Overthrow.Tanoa/keyHandler.sqf | 2 +- .../missions/Overthrow.Tanoa/mission.sqm | 2 +- .../Overthrow.Tanoa/missions/fugitive.sqf | 2 +- .../missions/medicalsupplies.sqf | 2 +- .../missions/Overthrow.Tanoa/wantedSystem.sqf | 18 ++-- .../AI/NPC/fn_initNATOCheckpoint.sqf | 4 +- .../functions/AI/orders/fn_orderLoot.sqf | 4 +- .../AI/orders/fn_orderOpenInventory.sqf | 2 +- .../functions/UI/fn_notifyBig.sqf | 2 + .../functions/UI/fn_notifyGood.sqf | 3 + .../functions/UI/fn_notifyLong.sqf | 2 + .../functions/UI/fn_notifyMinor.sqf | 2 + .../functions/UI/fn_notifyVehicle.sqf | 2 + .../buy.sqf => functions/actions/fn_buy.sqf} | 28 +++--- .../actions/fn_buyBuilding.sqf} | 16 ++-- .../actions/fn_factoryRefresh.sqf | 0 .../actions/fn_factorySet.sqf | 0 .../actions/fn_fastTravel.sqf} | 18 ++-- .../actions/fn_getLocalMission.sqf | 2 +- .../actions/fn_getMission.sqf | 4 +- .../UI => functions}/actions/fn_giveFunds.sqf | 2 +- .../actions/fn_makeGeneral.sqf | 0 .../actions/fn_recruitCiv.sqf} | 6 +- .../actions/fn_salvageWreck.sqf | 12 +-- .../actions/fn_sell.sqf} | 0 .../actions/fn_sellAll.sqf} | 0 .../actions/fn_showBusinessInfo.sqf | 0 .../actions/fn_showMemberInfo.sqf | 0 .../UI => functions}/actions/fn_takeFunds.sqf | 0 .../actions/fn_takeLegit.sqf} | 4 +- .../actions/fn_talkToCiv.sqf} | 8 +- .../actions/fn_transferFrom.sqf} | 9 +- .../actions/fn_transferFunds.sqf | 2 +- .../actions/fn_transferLegit.sqf} | 8 +- .../actions/fn_transferTo.sqf} | 10 +-- .../actions/fn_warehouseTake.sqf} | 2 +- .../actions/fn_workshopAdd.sqf} | 4 +- .../functions/events/fn_preInit.sqf | 2 + .../NATO/fn_NATOResponseObjective.sqf | 2 +- .../factions/NATO/fn_NATOResponseTown.sqf | 2 +- .../fn_loadGame.sqf} | 0 .../functions/fn_notifyMinor.sqf | 2 + .../fn_saveGame.sqf} | 8 +- addons/overthrow_main/ui/dialogs/main.hpp | 32 +++---- addons/overthrow_main/ui/dialogs/shop.hpp | 16 ++-- addons/overthrow_main/ui/dialogs/stats.hpp | 2 +- 79 files changed, 274 insertions(+), 414 deletions(-) delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_makeGeneral.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_transferFunds.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/rearmGroup.sqf delete mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf create mode 100644 addons/overthrow_main/functions/UI/fn_notifyBig.sqf create mode 100644 addons/overthrow_main/functions/UI/fn_notifyGood.sqf create mode 100644 addons/overthrow_main/functions/UI/fn_notifyLong.sqf create mode 100644 addons/overthrow_main/functions/UI/fn_notifyMinor.sqf create mode 100644 addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/buy.sqf => functions/actions/fn_buy.sqf} (89%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf => functions/actions/fn_buyBuilding.sqf} (88%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_factoryRefresh.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_factorySet.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf => functions/actions/fn_fastTravel.sqf} (82%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa => functions}/actions/fn_getLocalMission.sqf (97%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa => functions}/actions/fn_getMission.sqf (96%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_giveFunds.sqf (81%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_makeGeneral.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf => functions/actions/fn_recruitCiv.sqf} (82%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa => functions}/actions/fn_salvageWreck.sqf (85%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/sell.sqf => functions/actions/fn_sell.sqf} (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/sellall.sqf => functions/actions/fn_sellAll.sqf} (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_showBusinessInfo.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_showMemberInfo.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_takeFunds.sqf (100%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf => functions/actions/fn_takeLegit.sqf} (81%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf => functions/actions/fn_talkToCiv.sqf} (98%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf => functions/actions/fn_transferFrom.sqf} (92%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/UI => functions}/actions/fn_transferFunds.sqf (94%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf => functions/actions/fn_transferLegit.sqf} (91%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf => functions/actions/fn_transferTo.sqf} (93%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf => functions/actions/fn_warehouseTake.sqf} (96%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf => functions/actions/fn_workshopAdd.sqf} (92%) rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf => functions/fn_loadGame.sqf} (100%) create mode 100644 addons/overthrow_main/functions/fn_notifyMinor.sqf rename addons/overthrow_main/{campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf => functions/fn_saveGame.sqf} (92%) diff --git a/addons/overthrow_main/CfgFunctions.hpp b/addons/overthrow_main/CfgFunctions.hpp index 539cec1b..54edc8ef 100644 --- a/addons/overthrow_main/CfgFunctions.hpp +++ b/addons/overthrow_main/CfgFunctions.hpp @@ -12,6 +12,8 @@ class CfgFunctions class spawnTemplate {}; class spawnTemplateAttached {}; class unitStock {}; + class saveGame {}; + class loadGame {}; }; class Events @@ -21,6 +23,61 @@ class CfgFunctions class postInit {postInit = 1}; }; + class UI + { + file = "\ot\functions\UI"; + class notifyMinor {}; + class notifyBig {}; + class notifyGood {}; + class notifyVehicle {}; + }; + + /* + * User actions + */ + class Actions + { + file = "\ot\functions\actions"; + + /* Main Menu */ + class salvageWreck {}; + class buyBuilding {}; + class fastTravel {}; + class talkToCiv {}; + class recruitCiv {}; + + /* Vehicle */ + class transferTo {}; + class transferFrom {}; + class transferLegit {}; + class takeLegit {}; + class warehouseTake {}; + + /* Workshop */ + class workshopAdd {}; + + /* Shop */ + class buy {}; + class sell {}; + class sellAll {}; + + /* Gun Dealer */ + class getLocalMission {}; + class getMission {}; + + /* Factory */ + class factoryRefresh {}; + class factorySet {}; + + /* Resistance Screen */ + class showMemberInfo {}; + class showBusinessInfo {}; + class makeGeneral {}; + class giveFunds {}; + class takeFunds {}; + class transferFunds {}; + } + /* * Locations, positions etc. */ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf index eb7906b3..bcb26ecc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot build while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot build while wanted" call OT_fnc_notifyMinor}; _base = (getpos player) call OT_fnc_nearestBase; _closest = ""; _isbase = false; @@ -42,13 +42,13 @@ if(!_isBase) then { 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; + format ["NATO does not allow construction this close to %1.",_closest] call OT_fnc_notifyMinor; }else{ - format ["NATO is currently not allowing any construction in %1",_closest] call notify_minor; + format ["NATO is currently not allowing any construction in %1",_closest] call OT_fnc_notifyMinor; }; }; -if((player distance _center) > modeMax) exitWith {format ["You need to be within %1m of the %2.",modeMax,_buildlocation] call notify_minor}; +if((player distance _center) > modeMax) exitWith {format ["You need to be within %1m of the %2.",modeMax,_buildlocation] call OT_fnc_notifyMinor}; openMap false; _playerpos = (getpos player); @@ -271,7 +271,7 @@ buildOnMouseUp = { if(!isNull modeTarget and canBuildHere) then { _money = player getVariable "money"; if(_money < modePrice) then { - "You cannot afford that" call notify_minor; + "You cannot afford that" call OT_fnc_notifyMinor; }else{ _created = objNULL; playSound "3DEN_notificationDefault"; @@ -308,7 +308,7 @@ buildOnMouseUp = { }; }; if(!canBuildHere) then { - "You cannot build that there" call notify_minor; + "You cannot build that there" call OT_fnc_notifyMinor; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf index c5851ebe..c95ee982 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf @@ -62,7 +62,7 @@ buyPerk = { private _price = [_perk] call getPerkPrice; private _inf = player getVariable ["influence",0]; - if(_inf < _price) exitWith {"You do not have enough influence" call notify_minor}; + if(_inf < _price) exitWith {"You do not have enough influence" call OT_fnc_notifyMinor}; _fitness = _fitness + 1; player setVariable [format["OT_%1",_perk],_fitness,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf index fc936241..6e0959b1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf @@ -4,7 +4,7 @@ private _amgen = (getPlayerUID player) in (server getVariable ["generals",[]]); if(!isMultiplayer) then {_amgen = true}; if(!_amgen) then { - "You must be a General to change options" call notify_minor; + "You must be a General to change options" call OT_fnc_notifyMinor; }else{ createDialog 'OT_dialog_options'; if(!isMultiplayer) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf index a4f6379e..53fabae9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf @@ -1,7 +1,7 @@ disableSerialization; _town = (getpos player) call OT_fnc_nearestTown; -if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call notify_minor}; +if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call OT_fnc_notifyMinor}; _garrison = server getVariable [format['police%1',_town],0]; createDialog "OT_dialog_police"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf index d279d1f6..3d546767 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf @@ -2,7 +2,7 @@ disableSerialization; _base = (getpos player) call OT_fnc_nearestObjective; if (isNil "_base") exitWith {}; -if !((_base select 1) in (server getvariable "NATOabandoned")) exitWith {"This barracks is under NATO control" call notify_minor}; +if !((_base select 1) in (server getvariable "NATOabandoned")) exitWith {"This barracks is under NATO control" call OT_fnc_notifyMinor}; private _price = floor((["Tanoa","CIV",0] call OT_fnc_getPrice) * 1.5); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf index ca776e87..a87770ef 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf @@ -5,10 +5,10 @@ _town = (getpos player) call OT_fnc_nearestTown; _money = player getVariable ["money",0]; _price = ([_town,"CIV",-50] call OT_fnc_getPrice) + 250; -if(_money < (_amt * _price)) exitWith {"You cannot afford that" call notify_minor}; +if(_money < (_amt * _price)) exitWith {"You cannot afford that" call OT_fnc_notifyMinor}; -if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call notify_minor}; +if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call OT_fnc_notifyMinor}; _garrison = server getVariable [format['police%1',_town],0]; _garrison = _garrison + _amt; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf deleted file mode 100644 index f8684386..00000000 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf +++ /dev/null @@ -1,49 +0,0 @@ -if !(captive player) exitWith {"You cannot buy an ammobox while wanted" call notify_minor}; - -_price = 150; - -_money = player getVariable "money"; -if(_money < _price) exitWith {format["You need $%1",_price] call notify_minor}; - -_buildings = (getpos player) nearObjects 20; -_handled = false; -_building = objNULL; -{ - _owner = _x getVariable "owner"; - if(!isNil "_owner") then { - if ((typeof _x) in OT_allBuyableBuildings and _owner == getplayerUID player) exitWith { - _handled = true; - - playSound "ClickSoft"; - player setVariable ["money",_money-_price,true]; - - _cosa = OT_item_Storage createVehicle (getpos player); - - clearWeaponCargoGlobal _cosa; - clearMagazineCargoGlobal _cosa; - clearBackpackCargoGlobal _cosa; - clearItemCargoGlobal _cosa; - - _cosa enableSimulationGlobal false; - _cosa attachTo [player,[0,2,1]]; - _idx = player addAction ["Drop Here", {{detach _x} forEach attachedObjects player; removeAllActions player},nil,0,false,true,"",""]; - - waitUntil {sleep 0.05; (count attachedObjects player == 0) or (vehicle player != player) or (!alive player) or (!isPlayer player)}; - - {detach _x} forEach attachedObjects player; - player removeAction _idx; - - _cosa setPosATL [getPosATL _cosa select 0,getPosATL _cosa select 1,getPosATL player select 2]; - _cosa setVariable ["owner",getPlayerUID player,true]; - sleep 1; - _cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""]; - _cosa enableSimulationGlobal true; - }; - }; - -}foreach(_buildings); - -if !(_handled) then { - "You don't own any buildings nearby" call notify_minor; -}; - diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf index 5fee5cc1..51189ccc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf @@ -12,7 +12,7 @@ if(_town in (server getVariable ["NATOabandoned",[]])) then { hint format ["Only legal items may be exported while NATO controls %1",_town]; }; -"Exporting inventory" call notify_minor; +"Exporting inventory" call OT_fnc_notifyMinor; [5,false] call progressBar; sleep 5; _total = 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_makeGeneral.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_makeGeneral.sqf deleted file mode 100644 index e69de29b..00000000 diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_transferFunds.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_transferFunds.sqf deleted file mode 100644 index e69de29b..00000000 diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf index 63a01df0..e20967b8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf @@ -1,9 +1,9 @@ -if !(captive player) exitWith {"You cannot probe for intel while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot probe for intel while wanted" call OT_fnc_notifyMinor}; private _civ = OT_interactingWith; if(player getVariable ["influence",0] > 0) then { player globalchat (["So, how's things?","Hey! How's it going","So any news?","What's new?","Hey what's up?","sup?"] call BIS_fnc_selectRandom); [player,_civ] call giveIntel; }else{ - "You need 1 influence to probe for intel" call notify_minor; + "You need 1 influence to probe for intel" call OT_fnc_notifyMinor; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf deleted file mode 100644 index ce976b55..00000000 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf +++ /dev/null @@ -1,33 +0,0 @@ -_money = player getVariable "money"; - -if(_money < 100) exitWith {"You don't have $100 to give" call notify_minor}; - -_civ = player getvariable "hiringciv"; - -_handled = false; - -_town = (getpos player) call OT_fnc_nearestTown; -_rep = player getVariable format["rep%1",_town]; -if(_rep > 100) then {_rep = 100}; -if(_rep < -100) then {_rep = -100}; - -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]; -}; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf index 2be5cf7e..17577780 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf @@ -8,7 +8,7 @@ private _price = ["Tanoa",_cls,100] call OT_fnc_getPrice; _total = (_num * _price); private _veh = (vehicle player); -if((player getVariable ["money",0]) < _total) exitWith {format["You need $%1",[_total, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor;OT_taking = false}; +if((player getVariable ["money",0]) < _total) exitWith {format["You need $%1",[_total, 1, 0, true] call CBA_fnc_formatNumber] call OT_fnc_notifyMinor;OT_taking = false}; if ((!(_veh isKindOf "Truck_F")) and (!(_veh canAdd [_cls,_num]))) exitWith {hint "This vehicle cannot fit that, use a truck for more storage";OT_taking = false}; _count = 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf index 3a9d2dca..85a74a01 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf @@ -17,7 +17,7 @@ if(typename _b != "ARRAY") exitWith { }; }; -if !(captive player) exitWith {"You cannot lease buildings while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot lease buildings while wanted" call OT_fnc_notifyMinor}; _handled = false; @@ -32,7 +32,7 @@ if(typename _b == "ARRAY") then { _owner = _building getVariable "owner"; if(_owner == getplayeruid player) then { _home = player getVariable "home"; - if((_home distance _building) < 5) exitWith {"You cannot lease your home" call notify_minor;_err = true}; + if((_home distance _building) < 5) exitWith {"You cannot lease your home" call OT_fnc_notifyMinor;_err = true}; _handled = true; }; }; @@ -52,5 +52,5 @@ if(_handled) then { _mrkid = format["bdg-%1",_building]; _mrkid setMarkerAlphaLocal 0.3; playSound "3DEN_notificationDefault"; - "Building leased" call notify_minor; + "Building leased" call OT_fnc_notifyMinor; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf deleted file mode 100644 index a3a90888..00000000 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf +++ /dev/null @@ -1,48 +0,0 @@ -private ["_idx","_jugador","_cosa","_id"]; - -_cosa = _this select 0; -_jugador = _this select 1; -_id = _this select 2; -_cosa remoteExec ["enableSimulationGlobal false",2,false]; -_cosa enableSimulation false; -_cosa removeAction _id; - -_originalpos = getposATL _cosa; -_originaldir = getDir _cosa; -_mass = getMass _cosa; -_cosa setMass 0; -{ - _cosa disableCollisionWith _x; -}foreach(vehicles + allUnits); - -_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; - -OT_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 OT_moveIdx; - -if!([(getpos player),"Misc"] call OT_fnc_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; -}; - -_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 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/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf index 9eb63bff..c26dc2cd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot place objects while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot place objects while wanted" call OT_fnc_notifyMinor}; private ["_typecls","_types","_cost","_attach","_idx","_money"]; _typecls = _this; @@ -19,13 +19,13 @@ call { }; //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(_cost > _money) exitWith {format["You cannot afford that, you need $%1",_cost] call OT_fnc_notifyMinor}; if !([getpos player,_typecls] call OT_fnc_canPlace) exitWith { call { - if(_typecls == "Camp") exitWith {"Camps cannot be near another building" call notify_minor}; - if(_typecls == "Base") exitWith {"Bases cannot be too close to a town, NATO installation or existing base" call notify_minor}; - "You must be near a base or owned structure" call notify_minor + if(_typecls == "Camp") exitWith {"Camps cannot be near another building" call OT_fnc_notifyMinor}; + if(_typecls == "Base") exitWith {"Bases cannot be too close to a town, NATO installation or existing base" call OT_fnc_notifyMinor}; + "You must be near a base or owned structure" call OT_fnc_notifyMinor }; }; @@ -235,9 +235,9 @@ if(_cost > 0) then { }; }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 or owned building" call notify_minor + if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call OT_fnc_notifyMinor}; + if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call OT_fnc_notifyMinor}; + "You must be near a base or owned building" call OT_fnc_notifyMinor }; detach modeTarget; deleteVehicle modeTarget; @@ -245,9 +245,9 @@ if(_cost > 0) then { }; }else{ if(_typecls != "Camp" and _typecls != "Base") then { - "To place this item you must be near a base or a building that you own" call notify_minor; + "To place this item you must be near a base or a building that you own" call OT_fnc_notifyMinor; }else{ - "You cannot place a camp/base near a building you own. Bases must also be built away from towns." call notify_minor; + "You cannot place a camp/base near a building you own. Bases must also be built away from towns." call OT_fnc_notifyMinor; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/rearmGroup.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/rearmGroup.sqf deleted file mode 100644 index e69de29b..00000000 diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf index 10d4f114..ac973150 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor}; private _cls = _this select 0; private _pos = _this select 1; @@ -8,7 +8,7 @@ _soldier = _cls call OT_fnc_getSoldier; private _money = player getVariable ["money",0]; private _cost = _soldier select 0; -if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor}; +if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor}; [-_cost] call money; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf index 080fbac2..d3ac1d50 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor}; private _cls = _this select 0; private _pos = _this select 1; @@ -23,7 +23,7 @@ private _cost = 0; }foreach(_comp); private _money = player getVariable ["money",0]; -if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor}; +if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor}; [-_cost] call money; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf deleted file mode 100644 index 80bf489c..00000000 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf +++ /dev/null @@ -1,14 +0,0 @@ -private ["_pos"]; -_pos = getpos player; - -{ -if (_x distance _pos < 50) - then - { - _x setDamage 0; - //_x setVehicleAmmoDef 1; - [_x,1] remoteExec ["setVehicleAmmoDef",_x,false]; - }; -} forEach vehicles; - -"All vehicles within 50m have been repaired and rearmed." call notify_minor; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf index 1a7b9c0c..2cfc8ba9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot set home while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot set home while wanted" call OT_fnc_notifyMinor}; _buildings = (getpos player) nearObjects 15; _handled = false; @@ -9,13 +9,13 @@ _building = objNULL; if ((typeof _x) in OT_allBuyableBuildings and _owner == getplayerUID player) exitWith { _handled = true; player setVariable ["home",getpos _x,true]; - "This is now your home" call notify_minor; + "This is now your home" call OT_fnc_notifyMinor; }; }; }foreach(_buildings); if !(_handled) then { - "You don't own any buildings nearby" call notify_minor; + "You don't own any buildings nearby" call OT_fnc_notifyMinor; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf index 6a434a69..c246756e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf @@ -22,7 +22,7 @@ if(_password == "") exitWith { inputHandler = { private _password = OT_context getVariable ["password",""]; private _pw = ctrlText 1400; - if(_pw != _password) exitWith {"Wrong password" call notify_minor}; + if(_pw != _password) exitWith {"Wrong password" call OT_fnc_notifyMinor}; private _in = OT_context getVariable ["money",0]; inputHandler = { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf index ab7381b4..bd4527ce 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf @@ -27,7 +27,7 @@ if((typeof _source) in OT_fuelPumps) then { if(_money < _total) then { _nozzle setVariable ["ace_refuel_lastTickMissionTime", nil]; _nozzle setVariable ["ace_refuel_isRefueling", false, true]; - "You cannot afford fuel" remoteExec ["notify_minor",_player]; + "You cannot afford fuel" remoteExec ["OT_fnc_notifyMinor",_player]; _sink setFuel _last; }else{ [-_total] remoteExec ["money",_player]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf index 61c01702..75a457f0 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf @@ -38,7 +38,7 @@ call { _idx = _idx + 1; }foreach(OT_NATOhvts); OT_NATOhvts deleteAt _idx; - format["A high-ranking NATO officer has been killed"] remoteExec ["notify_minor",0,false]; + format["A high-ranking NATO officer has been killed"] remoteExec ["OT_fnc_notifyMinor",0,false]; server setvariable ["NATOresources",0,true]; [_killer,250] call OT_fnc_experience; }; @@ -59,7 +59,7 @@ call { [_killer,1500] call rewardMoney; [_killer,100] call OT_fnc_experience; - format["The crime leader %1 is dead, camp is cleared",(getpos _me) call BIS_fnc_locationDescription] remoteExec ["notify_minor",0,true]; + format["The crime leader %1 is dead, camp is cleared",(getpos _me) call BIS_fnc_locationDescription] remoteExec ["OT_fnc_notifyMinor",0,true]; deleteMarker format ["mobster%1",_mobsterid]; }; if(!isNil "_employee") exitWith { @@ -67,7 +67,7 @@ call { if(_pop > 0) then { server setVariable [format["employ%1",_mobsterid],_pop - 1,true]; }; - format["An employee of %1 has died",_employee] remoteExec ["notify_minor",0,false]; + format["An employee of %1 has died",_employee] remoteExec ["OT_fnc_notifyMinor",0,false]; }; if(!isNil "_mobster") exitWith { _killer setVariable ["OPFkills",(_killer getVariable ["BLUkills",0])+1,true]; @@ -88,7 +88,7 @@ call { }; if((random 100) > 50) then { [_town,1] call stability; - format["%1 (+1 Stability)",_town] remoteExec ["notify_minor",0,false]; + format["%1 (+1 Stability)",_town] remoteExec ["OT_fnc_notifyMinor",0,false]; }; _standingChange = 1; [_killer,10] call rewardMoney; @@ -97,7 +97,7 @@ call { if(!isNil "_crimleader") exitWith { _killer setVariable ["OPFkills",(_killer getVariable ["BLUkills",0])+1,true]; [_town,10] call stability; - format["%1 (+10 Stability)",_town] remoteExec ["notify_minor",0,false]; + format["%1 (+10 Stability)",_town] remoteExec ["OT_fnc_notifyMinor",0,false]; _standingChange = 10; _bounty = server getVariable [format["CRIMbounty%1",_town],0]; @@ -105,15 +105,15 @@ call { [_killer,_bounty] call rewardMoney; if(isPlayer _killer) then { if(isMultiplayer) then { - format["%1 has claimed the bounty in %2",name _killer,_town] remoteExec ["notify_minor",0,false]; + format["%1 has claimed the bounty in %2",name _killer,_town] remoteExec ["OT_fnc_notifyMinor",0,false]; }else{ - format["You claimed the bounty in %1",_town] call notify_minor; + format["You claimed the bounty in %1",_town] call OT_fnc_notifyMinor; }; }else{ if(side _killer == west) then { - format["NATO has removed the bounty in %1",_town] remoteExec ["notify_minor",0,true]; + format["NATO has removed the bounty in %1",_town] remoteExec ["OT_fnc_notifyMinor",0,true]; }else{ - format["The gang leader in %1 is dead",_town] remoteExec ["notify_minor",0,true]; + format["The gang leader in %1 is dead",_town] remoteExec ["OT_fnc_notifyMinor",0,true]; }; }; server setVariable [format["CRIMbounty%1",_town],0,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index 73d7b976..131e90b5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -24,7 +24,7 @@ while {true} do { spawner setVariable ["track",_track,false]; private _dead = count alldeadmen; if(_dead > 150) then { - format["There are %1 dead bodies, loot them or clean via options",_dead] remoteExec ["notify_minor",0,false]; + format["There are %1 dead bodies, loot them or clean via options",_dead] remoteExec ["OT_fnc_notifyMinor",0,false]; }; { @@ -221,7 +221,7 @@ while {true} do { clearBackpackCargoGlobal _veh; clearItemCargoGlobal _veh; }else{ - format["Factory has no room to place container, please clear marker area"] remoteExec["notify_minor",0,false]; + format["Factory has no room to place container, please clear marker area"] remoteExec["OT_fnc_notifyMinor",0,false]; }; }; _dowood = ["OT_wood",_wood,OT_factoryPos] call OT_fnc_hasFromContainers; @@ -251,9 +251,9 @@ while {true} do { clearBackpackCargoGlobal _veh; clearItemCargoGlobal _veh; _veh setDir OT_factoryVehicleDir; - format["Factory has produced %1 x %2",_numtoproduce,_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["notify_minor",0,false]; + format["Factory has produced %1 x %2",_numtoproduce,_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["OT_fnc_notifyMinor",0,false]; }else{ - format["Factory has no room to produce %1, please clear the road",_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["notify_minor",0,false]; + format["Factory has no room to produce %1, please clear the road",_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["OT_fnc_notifyMinor",0,false]; _timespent = _timetoproduce; }; }else{ @@ -301,27 +301,27 @@ while {true} do { if(_rank == "PRIVATE" and _xp > (OT_rankXP select 0)) then { _x set [3,"CORPORAL"]; _unit setRank "CORPORAL"; - format["%1 has been promoted to Corporal",_name select 0] remoteExec ["notify_minor",_player,false]; + format["%1 has been promoted to Corporal",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; }; if(_rank == "CORPORAL" and _xp > (OT_rankXP select 1)) then { _x set [3,"SERGEANT"]; _unit setRank "SERGEANT"; - format["%1 has been promoted to Sergeant",_name select 0] remoteExec ["notify_minor",_player,false]; + format["%1 has been promoted to Sergeant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; }; if(_rank == "SERGEANT" and _xp > (OT_rankXP select 2)) then { _x set [3,"LIEUTENANT"]; _unit setRank "LIEUTENANT"; - format["%1 has been promoted to Lieutenant",_name select 0] remoteExec ["notify_minor",_player,false]; + format["%1 has been promoted to Lieutenant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; }; if(_rank == "LIEUTENANT" and _xp > (OT_rankXP select 3)) then { _x set [3,"CAPTAIN"]; _unit setRank "CAPTAIN"; - format["%1 has been promoted to Captain",_name select 0] remoteExec ["notify_minor",_player,false]; + format["%1 has been promoted to Captain",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; }; if(_rank == "CAPTAIN" and _xp > (OT_rankXP select 4)) then { _x set [3,"MAJOR"]; _unit setRank "MAJOR"; - format["%1 has been promoted to Major",_name select 0] remoteExec ["notify_minor",_player,false]; + format["%1 has been promoted to Major",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; }; }; }foreach(server getVariable ["recruits",[]]); 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 1cc59746..d9cf19ab 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -293,7 +293,7 @@ while {true} do { if(_stability < 10 and !(_town in _abandoned)) then { _abandoned pushback _town; server setVariable [format ["garrison%1",_town],0,true]; - format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false]; + format["NATO has abandoned %1",_town] remoteExec ["OT_fnc_notifyGood",0,false]; [_town,15] call stability; }; }; @@ -419,7 +419,7 @@ while {true} do { }foreach(_pos nearEntities ["CAManBase",50]); if(_alive > 1 and _enemy == 0) then { _abandoned deleteAt (_abandoned find _name); - format["NATO has retaken control of the %1 tower",_name] remoteExec ["notify_good",0,false]; + format["NATO has retaken control of the %1 tower",_name] remoteExec ["OT_fnc_notifyGood",0,false]; _name setMarkerColor "ColorBLUFOR"; _resources = _resources + 50; server setVariable [format["garrison%1",_name],floor(4 + random(8)),true]; @@ -454,7 +454,7 @@ while {true} do { 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]; + format["Resistance has captured the %1 tower",_name] remoteExec ["OT_fnc_notifyGood",0,false]; _resources = _resources - 100; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf index 6a0918e2..df14ed00 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf @@ -28,7 +28,7 @@ private _mrkid = format["gundealer%1",_town]; if((markerType _mrkid == "") and (count(_gundealer) > 0) and (_rnd > 60)) exitWith { -1 call influence; [_civ,player,["Who are you? and what's with the outfit?","Never you mind","Whatever, I saw a guy wearing similar, he's over there"],{ - "Dealer added to map" call notify_minor; + "Dealer added to map" call OT_fnc_notifyMinor; private _town = player call OT_fnc_nearestTown; private _pos = server getvariable format["gundealer%1",_town]; _mrk = createMarkerLocal [format["gundealer%1",_town],_pos]; @@ -44,7 +44,7 @@ _mrkid = format["mobster%1",_nearestMobId]; if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (isNil "_mobboss") and (isNil "_mobster") and !(isNil "_crimleader") and (side _civ == east) and (_standing > 10)) exitWith { -1 call influence; [_civ,player,["This and that","Cool, I'm looking for a place to offload some... stuff","Go and speak to the boss I guess"],{ - "Bandit camp added to map" call notify_minor; + "Bandit camp added to map" call OT_fnc_notifyMinor; params ["_mobid","_mobpos"]; _mrk = createMarkerLocal [format["mobster%1",_mobid],_mobpos]; _mrk setMarkerType "ot_Camp"; @@ -57,7 +57,7 @@ if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (isNil "_mobboss" if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (side _civ == civilian) and (_standing >= 0)) exitWith { -1 call influence; [_civ,player,["I heard there were some bandits camping in the jungle","Really? Where, exactly?"],{ - "Bandit camp added to map" call notify_minor; + "Bandit camp added to map" call OT_fnc_notifyMinor; params ["_mobid","_mobpos"]; _mrk = createMarkerLocal [format["mobster%1",_mobid],_mobpos]; _mrk setMarkerType "ot_Camp"; @@ -68,5 +68,5 @@ if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (side _civ == civ }; [_civ,player,["Not much","Cool","k"],{ - "No intel available" call notify_minor; + "No intel available" call OT_fnc_notifyMinor; }] spawn doConversation; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf index 6c641db6..f41125a5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf @@ -70,7 +70,7 @@ while {true} do { _money = _x getVariable ["money",0]; _x setVariable ["money",_money+_perPlayer,true]; }foreach([] call CBA_fnc_players); - format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["notify_good",0,true]; + format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["OT_fnc_notifyGood",0,true]; }else{ _inf remoteExec ["influence",0,false]; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 280be8dd..570d6b52 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -37,13 +37,9 @@ gunDealerDialog = compileFinal preProcessFileLineNumbers "UI\gunDealerDialog.sqf resistanceScreen = compileFinal preprocessFileLineNumbers "UI\fn_resistanceDialog.sqf"; OT_fnc_resistanceDialog = resistanceScreen; OT_fnc_mapInfoDialog = compileFinal preprocessFileLineNumbers "actions\townInfo.sqf"; -OT_fnc_showMemberInfo = compileFinal preprocessFileLineNumbers "UI\actions\fn_showMemberInfo.sqf"; -OT_fnc_showBusinessInfo = compileFinal preprocessFileLineNumbers "UI\actions\fn_showBusinessInfo.sqf"; OT_fnc_factoryDialog = compileFinal preProcessFileLineNumbers "UI\fn_factoryDialog.sqf"; OT_fnc_reverseEngineerDialog = compileFinal preProcessFileLineNumbers "UI\fn_reverseEngineerDialog.sqf"; OT_fnc_vehicleDialog = compileFinal preProcessFileLineNumbers "UI\fn_vehicleDialog.sqf"; -OT_fnc_factoryRefresh = compileFinal preProcessFileLineNumbers "UI\actions\fn_factoryRefresh.sqf"; -OT_fnc_factorySet = compileFinal preProcessFileLineNumbers "UI\actions\fn_factorySet.sqf"; OT_fnc_newGameDialog = compileFinal preProcessFileLineNumbers "UI\fn_newGameDialog.sqf"; OT_fnc_optionsDialog = compileFinal preProcessFileLineNumbers "UI\fn_optionsDialog.sqf"; @@ -65,41 +61,16 @@ initObjectLocal = compileFinal preProcessFileLineNumbers "interaction\initObject initStaticMGLocal = compileFinal preProcessFileLineNumbers "interaction\initStaticMGLocal.sqf"; //Actions -buy = compileFinal preProcessFileLineNumbers "actions\buy.sqf"; -sell = compileFinal preProcessFileLineNumbers "actions\sell.sqf"; -sellall = compileFinal preProcessFileLineNumbers "actions\sellall.sqf"; -workshopAdd = compileFinal preProcessFileLineNumbers "actions\workshopAdd.sqf"; -buyBuilding = compileFinal preProcessFileLineNumbers "actions\buyBuilding.sqf"; leaseBuilding = compileFinal preProcessFileLineNumbers "actions\leaseBuilding.sqf"; -recruitCiv = compileFinal preProcessFileLineNumbers "actions\recruitCiv.sqf"; -rearmGroup = compileFinal preProcessFileLineNumbers "actions\rearmGroup.sqf"; recruitSoldier = compileFinal preProcessFileLineNumbers "actions\recruitSoldier.sqf"; recruitSquad = compileFinal preProcessFileLineNumbers "actions\recruitSquad.sqf"; -fastTravel = compileFinal preProcessFileLineNumbers "actions\fastTravel.sqf"; setHome = compileFinal preProcessFileLineNumbers "actions\setHome.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"; -transferFrom = compileFinal preProcessFileLineNumbers "actions\transferFrom.sqf"; -transferTo = compileFinal preProcessFileLineNumbers "actions\transferTo.sqf"; -transferLegit = compileFinal preProcessFileLineNumbers "actions\transferLegit.sqf"; -takeLegit = compileFinal preProcessFileLineNumbers "actions\takeLegit.sqf"; -talkToCiv = compileFinal preProcessFileLineNumbers "actions\talkToCiv.sqf"; addPolice = compileFinal preProcessFileLineNumbers "actions\addPolice.sqf"; -warehouseTake = compileFinal preProcessFileLineNumbers "actions\warehouseTake.sqf"; exportAll = compileFinal preProcessFileLineNumbers "actions\exportAll.sqf"; import = compileFinal preProcessFileLineNumbers "actions\import.sqf"; restoreLoadout = compileFinal preProcessFileLineNumbers "actions\restoreLoadout.sqf"; removeLoadout = compileFinal preProcessFileLineNumbers "actions\removeLoadout.sqf"; -OT_fnc_getMission = compileFinal preProcessFileLineNumbers "actions\fn_getMission.sqf"; -OT_fnc_getLocalMission = compileFinal preProcessFileLineNumbers "actions\fn_getLocalMission.sqf"; -OT_fnc_salvageWreck = compileFinal preProcessFileLineNumbers "actions\fn_salvageWreck.sqf"; - -OT_fnc_takeFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_takeFunds.sqf"; -OT_fnc_giveFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_giveFunds.sqf"; -OT_fnc_transferFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_transferFunds.sqf"; -OT_fnc_makeGeneral = compileFinal preProcessFileLineNumbers "UI\actions\fn_makeGeneral.sqf"; //Modes @@ -192,10 +163,10 @@ OT_fnc_lockVehicle = { if((_veh getVariable ["owner",""]) != (getplayeruid player)) exitWith {}; if(_veh getVariable ["OT_locked",false]) then { _veh setVariable ["OT_locked",false,true]; - "Vehicle unlocked" call notify_minor; + "Vehicle unlocked" call OT_fnc_notifyMinor; }else{ _veh setVariable ["OT_locked",true,true]; - "Vehicle locked" call notify_minor; + "Vehicle locked" call OT_fnc_notifyMinor; }; }; @@ -206,7 +177,7 @@ OT_fnc_squadAssignVehicle = { _squad addVehicle _veh; [] call OT_fnc_squadGetIn; player hcSelectGroup [_squad,false]; - format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call notify_minor; + format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call OT_fnc_notifyMinor; }; }; @@ -267,7 +238,7 @@ OT_fnc_increaseTax = { _rate = _rate + 5; if(_rate > 100) then {_rate = 100}; server setVariable ["taxrate",_rate,true]; - format["Tax rate is now %1%2",_rate,"%"] call notify_minor; + format["Tax rate is now %1%2",_rate,"%"] call OT_fnc_notifyMinor; }; OT_fnc_decreaseTax = { @@ -275,7 +246,7 @@ OT_fnc_decreaseTax = { _rate = _rate - 5; if(_rate < 0) then {_rate = 0}; server setVariable ["taxrate",_rate,true]; - format["Tax rate is now %1%2",_rate,"%"] call notify_minor; + format["Tax rate is now %1%2",_rate,"%"] call OT_fnc_notifyMinor; }; OT_fnc_hireEmployee = { @@ -366,7 +337,7 @@ OT_fnc_reverseEngineer = { _blueprints pushBack _cls; server setVariable ["GEURblueprints",_blueprints,true]; closeDialog 0; - "Item is now available for production" call notify_minor; + "Item is now available for production" call OT_fnc_notifyMinor; if(!(_cls isKindOf "Bag_Base") and _cls isKindOf "AllVehicles") then { private _veh = OT_factoryPos nearestObject _cls; @@ -375,7 +346,7 @@ OT_fnc_reverseEngineer = { player removeItem _cls; }; }else{ - "Cannot reverse-engineer this item, please contact Overthrow Devs on Discord" call notify_minor; + "Cannot reverse-engineer this item, please contact Overthrow Devs on Discord" call OT_fnc_notifyMinor; }; }; @@ -640,7 +611,7 @@ standing = { player setVariable ["rep",_totalrep,true]; if(count _this > 2) then { - format["%1 (%2 %3)",_this select 2,_this select 1,_town] call notify_minor; + format["%1 (%2 %3)",_this select 2,_this select 1,_town] call OT_fnc_notifyMinor; }; }; @@ -683,7 +654,7 @@ influence = { if(_this > 0) then { _plusmin = "+"; }; - format["%1%2 Influence",_plusmin,_this] call notify_minor; + format["%1%2 Influence",_plusmin,_this] call OT_fnc_notifyMinor; }; influenceSilent = { @@ -749,9 +720,9 @@ money = { _plusmin = "+"; }; if(count _this > 1) then { - format["%3: %1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber,_this select 1] call notify_minor; + format["%3: %1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber,_this select 1] call OT_fnc_notifyMinor; }else{ - format["%1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor; + format["%1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber] call OT_fnc_notifyMinor; }; }; @@ -803,42 +774,4 @@ stability = { }; }; -OT_notifies = []; - -notify = { - _txt = format ["%1",_this]; - OT_notifies pushback _txt; -}; - -notify_good = { - playSound "3DEN_notificationDefault"; - _txt = format ["%1",_this]; - OT_notifies pushback _txt; -}; - -notify_big = { - _txt = format ["%1",_this]; - OT_notifies pushback _txt; -}; - -notify_minor = { - _txt = format ["%1",_this]; - OT_notifies pushback _txt; -}; - -notify_vehicle = { - _txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) getVariable ["owner",""])]; - [_txt, -0.5, 1, 5, 1, 0, 5] spawn bis_fnc_dynamicText; -}; - -notify_long = { - _txt = format ["%1",_this]; - [_txt, 0, -0.136, 30, 1, 0, 2] spawn bis_fnc_dynamicText; -}; - -notify_talk = { - _txt = format ["%1",_this]; - OT_notifies pushback _txt; -}; - [] execVM "funcs\info.sqf"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index feecf11d..431e6fd3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -368,7 +368,7 @@ player addEventHandler ["InventoryOpened", { if((_veh getVariable ["owner",""]) != (getplayeruid player)) then { if(_veh getVariable ["OT_locked",false]) then { _ret = true; - format["This inventory has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call notify_minor; + format["This inventory has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call OT_fnc_notifyMinor; }; }; _ret; @@ -380,7 +380,7 @@ player addEventHandler ["GetInMan",{ _veh = _this select 2; _notified = false; - call notify_vehicle; + call OT_fnc_notifyVehicle; private _isgen = call OT_fnc_playerIsGeneral; if(_position == "driver") then { @@ -392,7 +392,7 @@ player addEventHandler ["GetInMan",{ if((_veh getVariable ["owner",""]) != (getplayeruid player)) then { if(!_isgen and (_veh getVariable ["OT_locked",false])) then { moveOut player; - format["This vehicle has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call notify_minor; + format["This vehicle has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call OT_fnc_notifyMinor; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf index feea4b6a..99f0db07 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf @@ -20,7 +20,7 @@ if(typeof _this == OT_item_Storage) then { private _iswarehouse = call OT_fnc_playerAtWarehouse; if !(_iswarehouse) exitWith { - "No warehouse within range" call notify_minor; + "No warehouse within range" call OT_fnc_notifyMinor; }; OT_warehouseTarget = _this select 0; @@ -30,16 +30,16 @@ if(typeof _this == OT_item_Storage) then { },nil,0,false,true,"","call OT_fnc_playerAtWarehouse"]; _this addAction ["Store In Warehouse", { OT_warehouseTarget = _this select 0; - [] spawn transferTo; + [] spawn OT_fnc_transferTo; },nil,0,false,true,"","call OT_fnc_playerAtWarehouse"]; if(_this call OT_fnc_playerIsOwner) then { _this addAction ["Lock", { (_this select 0) setVariable ["OT_locked",true,true]; - "Ammobox locked" call notify_minor; + "Ammobox locked" call OT_fnc_notifyMinor; },nil,0,false,true,"","!(_target getVariable ['OT_locked',false])"]; _this addAction ["Unlock", { (_this select 0) setVariable ["OT_locked",false,true]; - "Ammobox unlocked" call notify_minor; + "Ammobox unlocked" call OT_fnc_notifyMinor; },nil,0,false,true,"","(_target getVariable ['OT_locked',false])"]; }; }; @@ -63,6 +63,4 @@ if(OT_hasACE) 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/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf index 51320ba7..5ad74375 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf @@ -15,15 +15,15 @@ if !(_wpn getVariable ["actioned",false]) then { _p removeMagazineGlobal OT_ammo_50cal; _p removeMagazineGlobal OT_ammo_50cal; _w spawn { - "Rearming MG..." call notify_minor; + "Rearming MG..." call OT_fnc_notifyMinor; [15,false] call progressBar; sleep 15; [_this,1] remoteExec ["setVehicleAmmoDef",_this,_this]; - "MG rearmed" call notify_minor; + "MG rearmed" call OT_fnc_notifyMinor; disableUserInput false; }; }else{ - "You need 4 x 12.7mm M2 HMG Belts to rearm this MG" call notify_minor; + "You need 4 x 12.7mm M2 HMG Belts to rearm this MG" call OT_fnc_notifyMinor; }; },[],1.5,false,true,"","(alive _target)",5]; _wpn setVariable ["actioned",true,false]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf index 8443129e..ac07a1d5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf @@ -34,7 +34,7 @@ if (_key == 21) then private _cost = player getVariable ["OT_ferryCost",0]; if((player getVariable "money") < _cost) exitWith { - "You cannot afford that!" call notify_minor; + "You cannot afford that!" call OT_fnc_notifyMinor; }; [-_cost] call money; cutText [format["Skipping ferry to %1",_town],"BLACK",2]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index b9f2d0ab..8a4a0c53 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=244; + nextID=249; }; class Camera { 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 5e60f445..05b69479 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf @@ -77,7 +77,7 @@ _difficulty = 1.8; //If mission was not a success if !(_wassuccess) then { - format ["Incoming message from %1: 'Abort mission. You have been spotted.'",_factionName] call notify_minor; + format ["Incoming message from %1: 'Abort mission. You have been spotted.'",_factionName] call OT_fnc_notifyMinor; //Get outta here _group = group (player getVariable [format["fugitive%1",_faction],objNull]); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf index 79690b53..27f7a69e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf @@ -51,7 +51,7 @@ _difficulty = 0.5; if((time - _lastwarning) > 5) then { if((_numavailable > 0) and _numavailable < _threshold) then { - "At least 10 bandages required to complete mission" call notify_minor; + "At least 10 bandages required to complete mission" call OT_fnc_notifyMinor; }; _p set [2,time]; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf index 91b220e3..21f46584 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf @@ -78,7 +78,7 @@ while {alive _unit} do { format["%1 is unconscious",name player] remoteExec ["systemChat",0,false]; _unit setVariable ["OT_healed",true,true]; }else{ - "You are unconscious, there is no one nearby with Epinephrine to revive you" call notify_minor; + "You are unconscious, there is no one nearby with Epinephrine to revive you" call OT_fnc_notifyMinor; sleep 5; _unit setDamage 1; //rip } @@ -160,7 +160,7 @@ while {alive _unit} do { if !(_obname in (server getVariable ["NATOabandoned",[]])) then { if(_obpos distance _playerpos < 2000) exitWith { if(isPlayer _unit) then { - "This is a no-fly zone" call notify_minor; + "This is a no-fly zone" call OT_fnc_notifyMinor; }; _unit setCaptive false; (vehicle _unit) spawn revealToNATO; @@ -180,7 +180,7 @@ while {alive _unit} do { _unit setCaptive false; _unit spawn revealToNATO; if(isPlayer _unit) then { - "A gang has seen the static weapon" call notify_minor; + "A gang has seen the static weapon" call OT_fnc_notifyMinor; }; }; }foreach(attachedObjects _unit); @@ -207,7 +207,7 @@ while {alive _unit} do { }; if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "")) exitWith { if(isPlayer _unit) then { - "A gang has seen your weapon" call notify_minor; + "A gang has seen your weapon" call OT_fnc_notifyMinor; }; _unit setCaptive false; _unit spawn revealToNATO; @@ -223,7 +223,7 @@ while {alive _unit} do { if((_totalrep > _replim) and (random 1000 < _totalrep)) exitWith { _unit setCaptive false; if(isPlayer _unit) then { - "A gang has recognized you" call notify_minor; + "A gang has recognized you" call OT_fnc_notifyMinor; }; _unit spawn revealToCRIM; }; @@ -245,7 +245,7 @@ while {alive _unit} do { if((_totalrep > _replim) and (random 1000 < _totalrep)) exitWith { _unit setCaptive false; if(isPlayer _unit) then { - "NATO has recognized you" call notify_minor; + "NATO has recognized you" call OT_fnc_notifyMinor; }; _unit spawn revealToNATO; } @@ -256,7 +256,7 @@ while {alive _unit} do { _unit setCaptive false; _unit spawn revealToNATO; if(isPlayer _unit) then { - "NATO has seen the static weapon" call notify_minor; + "NATO has seen the static weapon" call OT_fnc_notifyMinor; }; }; }foreach(attachedObjects _unit); @@ -294,7 +294,7 @@ while {alive _unit} do { }; if ((headgear _unit in OT_illegalHeadgear) or (vest _unit in OT_illegalVests)) exitWith { if(isPlayer _unit) then { - "You are wearing Gendarmerie gear" call notify_minor; + "You are wearing Gendarmerie gear" call OT_fnc_notifyMinor; }; _unit setCaptive false; _unit spawn revealToNATO; @@ -312,7 +312,7 @@ while {alive _unit} do { }; if(_obpos distance (getpos player) < _dist) exitWith { if(isPlayer _unit) then { - "You are in a restricted area" call notify_minor; + "You are in a restricted area" call OT_fnc_notifyMinor; }; _unit setCaptive false; _unit spawn revealToNATO; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf index 4a9b7535..60e5ca2f 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf @@ -131,14 +131,14 @@ while {!(isNil "_group") and count (units _group) > 0} do { _msg = "We found some illegal items and confiscated them, be on your way"; }; }; - _msg remoteExec ["notify_talk",_x,true]; + _msg remoteExec ["OT_fnc_notifyMinor",_x,true]; _searched pushback _x; _searching deleteAt(_searching find _x); }; }; }else{ if (_x in _searching and isPlayer _x) then { - "Return to the checkpoint immediately and wait while you are searched" remoteExec ["notify_talk",_x,true]; + "Return to the checkpoint immediately and wait while you are searched" remoteExec ["OT_fnc_notifyMinor",_x,true]; _searching deleteAt(_searching find _x); } }; diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf index b05c1df5..7ae1294c 100644 --- a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf +++ b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf @@ -13,7 +13,7 @@ if(vehicle _tt != _tt) then { }else{ _objects = _tt nearEntities [["Car","ReammoBox_F","Air","Ship"],20]; if(count _objects == 0) exitWith { - "Cannot find any containers or vehicles within 20m of first selected unit" call notify_minor; + "Cannot find any containers or vehicles within 20m of first selected unit" call OT_fnc_notifyMinor; }; _sorted = [_objects,[],{_x distance _tt},"ASCEND"] call BIS_fnc_SortBy; }; @@ -21,7 +21,7 @@ if(vehicle _tt != _tt) then { if(count _sorted == 0) exitWith {}; private _target = _sorted select 0; -format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor; +format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor; { [_x,_target] spawn { diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf index 9a328a86..548cb68a 100644 --- a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf +++ b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf @@ -10,7 +10,7 @@ if((vehicle _unit) != _unit) then { }else{ _objects = _unit nearEntities [["LandVehicle",OT_item_Storage],20]; if(count _objects == 0) exitWith { - "Cannot find any containers or vehicles within 20m of first selected unit" call notify_minor; + "Cannot find any containers or vehicles within 20m of first selected unit" call OT_fnc_notifyMinor; }; _sorted = [_objects,[],{_x distance _unit},"ASCEND"] call BIS_fnc_SortBy; }; diff --git a/addons/overthrow_main/functions/UI/fn_notifyBig.sqf b/addons/overthrow_main/functions/UI/fn_notifyBig.sqf new file mode 100644 index 00000000..61788cf0 --- /dev/null +++ b/addons/overthrow_main/functions/UI/fn_notifyBig.sqf @@ -0,0 +1,2 @@ +_txt = format ["%1",_this]; +OT_notifies pushback _txt; diff --git a/addons/overthrow_main/functions/UI/fn_notifyGood.sqf b/addons/overthrow_main/functions/UI/fn_notifyGood.sqf new file mode 100644 index 00000000..d637b7de --- /dev/null +++ b/addons/overthrow_main/functions/UI/fn_notifyGood.sqf @@ -0,0 +1,3 @@ +playSound "3DEN_notificationDefault"; +_txt = format ["%1",_this]; +OT_notifies pushback _txt; diff --git a/addons/overthrow_main/functions/UI/fn_notifyLong.sqf b/addons/overthrow_main/functions/UI/fn_notifyLong.sqf new file mode 100644 index 00000000..02742d63 --- /dev/null +++ b/addons/overthrow_main/functions/UI/fn_notifyLong.sqf @@ -0,0 +1,2 @@ +_txt = format ["%1",_this]; +[_txt, 0, -0.136, 30, 1, 0, 2] spawn bis_fnc_dynamicText; diff --git a/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf b/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf new file mode 100644 index 00000000..af2d1279 --- /dev/null +++ b/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf @@ -0,0 +1,2 @@ +_txt = format ["%1",_this]; +OT_notifies pushback _txt; diff --git a/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf new file mode 100644 index 00000000..7a2bb948 --- /dev/null +++ b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf @@ -0,0 +1,2 @@ +_txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) getVariable ["owner",""])]; +[_txt, -0.5, 1, 5, 1, 0, 5] spawn bis_fnc_dynamicText; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf similarity index 89% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf rename to addons/overthrow_main/functions/actions/fn_buy.sqf index 5c545d3c..dfa2e1e2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -9,12 +9,12 @@ _price = lbValue [1500,_idx]; if(_price == -1) exitWith {}; _money = player getVariable "money"; -if(_money < _price) exitWith {"You cannot afford that!" call notify_minor}; +if(_money < _price) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor}; call { if(_cls == "Set_HMG") exitWith { _pos = (getpos player) findEmptyPosition [5,100,"C_Quadbike_01_F"]; - if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; + if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor}; player setVariable ["money",_money-_price,true]; _veh = "C_Quadbike_01_F" createVehicle _pos; @@ -27,7 +27,7 @@ call { _veh addBackpackCargoGlobal ["I_HMG_01_support_high_F", 1]; player reveal _veh; - format["You bought a Quad Bike w/ HMG for $%1",_price] call notify_minor; + format["You bought a Quad Bike w/ HMG for $%1",_price] call OT_fnc_notifyMinor; playSound "3DEN_notificationDefault"; }; if(OT_interactingWith getVariable ["factionrep",false] and ((_cls isKindOf "Land") or (_cls isKindOf "Air"))) exitWith { @@ -36,7 +36,7 @@ call { _blueprints pushback _cls; server setVariable ["GEURblueprints",_blueprints,true]; _factionName = OT_interactingWith getVariable ["factionrepname",""]; - format["%1 has bought %2 blueprint from %3",name player,_cls call ISSE_Cfg_Vehicle_GetName,_factionName] remoteExec ["notify_minor",0,false]; + format["%1 has bought %2 blueprint from %3",name player,_cls call ISSE_Cfg_Vehicle_GetName,_factionName] remoteExec ["OT_fnc_notifyMinor",0,false]; closeDialog 0; }; }; @@ -48,7 +48,7 @@ call { }; if(_cls == OT_item_UAV) exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; - if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; + if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor}; player setVariable ["money",_money-_price,true]; @@ -71,13 +71,13 @@ call { player connectTerminalToUAV _veh; player reveal _veh; - format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor; + format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor; playSound "3DEN_notificationDefault"; hint "To use a UAV, scroll your mouse wheel to 'Open UAV Terminal' then right click your green copter on the ground and 'Connect terminal to UAV'"; }; if(_cls in OT_allVehicles) exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; - if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; + if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor}; player setVariable ["money",_money-_price,true]; _veh = _cls createVehicle _pos; @@ -88,12 +88,12 @@ call { clearItemCargoGlobal _veh; player reveal _veh; - format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call notify_minor; + format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call OT_fnc_notifyMinor; playSound "3DEN_notificationDefault"; }; if(_cls isKindOf "Ship") exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; - if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; + if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor}; player setVariable ["money",_money-_price,true]; _veh = _cls createVehicle _pos; @@ -104,7 +104,7 @@ call { clearItemCargoGlobal _veh; player reveal _veh; - format["You bought a %1",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor; + format["You bought a %1",_cls call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor; playSound "3DEN_notificationDefault"; }; if(_cls in OT_allClothing) exitWith { @@ -112,7 +112,7 @@ call { if((backpack player != "") and (player canAdd _cls)) then { player addItemToBackpack _cls; - "Clothing added to your backpack" call notify_minor; + "Clothing added to your backpack" call OT_fnc_notifyMinor; }else{ player forceAddUniform _cls; }; @@ -123,7 +123,7 @@ call { if((backpack player != "") and (player canAdd _cls)) then { player addItemToBackpack _cls; - "Rebreather added to your backpack" call notify_minor; + "Rebreather added to your backpack" call OT_fnc_notifyMinor; }else{ player addVest _cls; }; @@ -151,9 +151,9 @@ call { }; _handled = true; if(_cls isKindOf "Bag_Base") then { - if(backpack player != "") exitWith {"You already have a backpack" call notify_minor;_handled = false}; + if(backpack player != "") exitWith {"You already have a backpack" call OT_fnc_notifyMinor;_handled = false}; }else{ - if !(player canAdd [_cls,1]) exitWith {"There is not enough room in your inventory" call notify_minor;_handled = false}; + if !(player canAdd [_cls,1]) exitWith {"There is not enough room in your inventory" call OT_fnc_notifyMinor;_handled = false}; }; if(_handled) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf similarity index 88% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf rename to addons/overthrow_main/functions/actions/fn_buyBuilding.sqf index ca538424..ce7e47e1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf +++ b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot buy or manage real estate while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot buy or manage real estate while wanted" call OT_fnc_notifyMinor}; _b = player call OT_fnc_nearestRealEstate; private _handled = false; @@ -13,7 +13,7 @@ if(typename _b == "ARRAY") then { _owner = _building getVariable "owner"; if(_owner == getplayeruid player) then { _home = player getVariable "home"; - if(_home distance _building < 5) exitWith {"You cannot sell your home" call notify_minor;_err = true}; + if(_home distance _building < 5) exitWith {"You cannot sell your home" call OT_fnc_notifyMinor;_err = true}; _type = "sell"; _handled = true; }; @@ -34,11 +34,11 @@ if(typename _b == "ARRAY") then { server setVariable ["GEURowned",_owned + [_name],true]; server setVariable [format["%1employ",_name],2]; _pos remoteExec ["OT_fnc_resetSpawn",2,false]; - format["%1 is now operational",_name] remoteExec ["notify_minor",0,true]; + format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true]; _name setMarkerColor "ColorGUER"; }; }else{ - "The resistance cannot afford this" call notify_minor; + "The resistance cannot afford this" call OT_fnc_notifyMinor; }; }; }else{ @@ -57,10 +57,10 @@ if(typename _b == "ARRAY") then { server setVariable ["GEURowned",_owned + [_name],true]; server setVariable [format["%1employ",_name],2]; _pos remoteExec ["OT_fnc_resetSpawn",2,false]; - format["%1 is now operational",_name] remoteExec ["notify_minor",0,true]; + format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true]; _name setMarkerColor "ColorGUER"; }else{ - "The resistance cannot afford this" call notify_minor; + "The resistance cannot afford this" call OT_fnc_notifyMinor; }; }else{ //Manage @@ -82,7 +82,7 @@ if(_handled) then { _money = player getVariable "money"; - if(_type == "buy" and _money < _price) exitWith {"You cannot afford that" call notify_minor}; + if(_type == "buy" and _money < _price) exitWith {"You cannot afford that" call OT_fnc_notifyMinor}; _mrkid = format["bdg-%1",_building]; @@ -127,6 +127,6 @@ if(_handled) then { }else{ if !(_isfactory) then { - "There are no buildings for sale nearby" call notify_minor; + "There are no buildings for sale nearby" call OT_fnc_notifyMinor; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factoryRefresh.sqf b/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factoryRefresh.sqf rename to addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factorySet.sqf b/addons/overthrow_main/functions/actions/fn_factorySet.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factorySet.sqf rename to addons/overthrow_main/functions/actions/fn_factorySet.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf b/addons/overthrow_main/functions/actions/fn_fastTravel.sqf similarity index 82% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf rename to addons/overthrow_main/functions/actions/fn_fastTravel.sqf index e1148819..b48f63db 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf +++ b/addons/overthrow_main/functions/actions/fn_fastTravel.sqf @@ -1,15 +1,15 @@ -if !(captive player) exitWith {"You cannot fast travel while wanted" call notify_minor}; -if !("ItemMap" in assignedItems player) exitWith {"You need a map to fast travel" call notify_minor}; +if !(captive player) exitWith {"You cannot fast travel while wanted" call OT_fnc_notifyMinor}; +if !("ItemMap" in assignedItems player) exitWith {"You need a map to fast travel" call OT_fnc_notifyMinor}; if((vehicle player) != player) then { - if (driver (vehicle player) != player) exitWith {"You are not the driver of this vehicle" call notify_minor}; - if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call notify_minor}; + if (driver (vehicle player) != player) exitWith {"You are not the driver of this vehicle" call OT_fnc_notifyMinor}; + if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call OT_fnc_notifyMinor}; }; -if(((vehicle player) != player) and (vehicle player) isKindOf "Ship") exitWith {"You cannot fast travel in a boat" call notify_minor}; +if(((vehicle player) != player) and (vehicle player) isKindOf "Ship") exitWith {"You cannot fast travel in a boat" call OT_fnc_notifyMinor}; -"Click near a friendly base/camp or a building you own" call notify_minor; +"Click near a friendly base/camp or a building you own" call OT_fnc_notifyMinor; openMap true; ["fastTravel", "onMapSingleClick", { @@ -42,14 +42,14 @@ openMap true; if (!OT_adminMode and !(_pos inArea _region)) then { 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; + "You cannot fast travel between islands unless there is a bridge or your destination is a controlled airfield" call OT_fnc_notifyMinor; openMap false; }; }; }; if(!_valid) exitWith {}; if(_pos distance player < 150) exitWith { - "You cannot fast travel less than 150m. Just walk!" call notify_minor; + "You cannot fast travel less than 150m. Just walk!" call OT_fnc_notifyMinor; openMap false; }; @@ -57,7 +57,7 @@ openMap true; if !(_handled) then { - "You must click near a friendly base/camp or a building you own" call notify_minor; + "You must click near a friendly base/camp or a building you own" call OT_fnc_notifyMinor; openMap false; }else{ player allowDamage false; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf b/addons/overthrow_main/functions/actions/fn_getLocalMission.sqf similarity index 97% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf rename to addons/overthrow_main/functions/actions/fn_getLocalMission.sqf index 1035c0d5..b0f8b147 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf +++ b/addons/overthrow_main/functions/actions/fn_getLocalMission.sqf @@ -1,7 +1,7 @@ private _faction = "PLAYER"; private _factionName = "Tanoa"; private _haveMission = player getVariable [format["MissionData%1",_faction],[]]; -if(count _haveMission > 0) exitWith {"You already have an active mission for the resistance" call notify_minor}; +if(count _haveMission > 0) exitWith {"You already have an active mission for the resistance" call OT_fnc_notifyMinor}; private _standing = 1; if(_faction != OT_currentMissionFaction) then {OT_currentMissionData = nil}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf b/addons/overthrow_main/functions/actions/fn_getMission.sqf similarity index 96% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf rename to addons/overthrow_main/functions/actions/fn_getMission.sqf index f4b1f3e7..90571882 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf +++ b/addons/overthrow_main/functions/actions/fn_getMission.sqf @@ -1,7 +1,7 @@ params ["_faction","_factionName"]; private _haveMission = player getVariable [format["MissionData%1",_faction],[]]; -if(count _haveMission > 0) exitWith {"You already have an active mission for this faction" call notify_minor}; +if(count _haveMission > 0) exitWith {"You already have an active mission for this faction" call OT_fnc_notifyMinor}; private _standing = server getvariable [format["standing%1",_faction],0]; if(_faction != OT_currentMissionFaction) then {OT_currentMissionData = nil}; @@ -46,7 +46,7 @@ _options pushback ["Accept",{ _rewardStanding = _rewards select 0; _standing = server getvariable [format["standing%1",_faction],0]; server setvariable [format["standing%1",_faction],_standing+_rewardStanding,true]; - format["%1 completed a mission (+%2 %3)",name player,_rewardStanding,_factionName] remoteExec ["notify_minor",0,false]; + format["%1 completed a mission (+%2 %3)",name player,_rewardStanding,_factionName] remoteExec ["OT_fnc_notifyMinor",0,false]; }; OT_currentMissionData = nil; },_success,OT_currentMissionRewards select 1,0,_fail,[OT_currentMissionData select 6,OT_currentMissionFaction,OT_currentMissionFactionName,OT_currentMissionData select 5,OT_currentMissionRewards]] spawn OT_fnc_assignMission; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf b/addons/overthrow_main/functions/actions/fn_giveFunds.sqf similarity index 81% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf rename to addons/overthrow_main/functions/actions/fn_giveFunds.sqf index 5145a7d8..2c57b681 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf +++ b/addons/overthrow_main/functions/actions/fn_giveFunds.sqf @@ -6,7 +6,7 @@ inputHandler = { if(_val > 0) then { [_val] call OT_fnc_resistanceFunds; [-_val] call money; - format ["%1 donated $%2 to the resistance",name player,[_val, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["notify_minor",0,false]; + format ["%1 donated $%2 to the resistance",name player,[_val, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["OT_fnc_notifyMinor",0,false]; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_makeGeneral.sqf b/addons/overthrow_main/functions/actions/fn_makeGeneral.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_makeGeneral.sqf rename to addons/overthrow_main/functions/actions/fn_makeGeneral.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf similarity index 82% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf rename to addons/overthrow_main/functions/actions/fn_recruitCiv.sqf index 7a6cade2..b9562788 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf @@ -1,4 +1,4 @@ -if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; +if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor}; _town = (getpos player) call OT_fnc_nearestTown; _standing = player getVariable format['rep%1',_town]; @@ -6,7 +6,7 @@ _standing = player getVariable format['rep%1',_town]; _price = [_town,"CIV",_standing] call OT_fnc_getPrice; _money = player getVariable ["money",0]; -if(_money < _price) exitWith {"You cannot afford that" call notify_minor}; +if(_money < _price) exitWith {"You cannot afford that" call OT_fnc_notifyMinor}; playSound "3DEN_notificationDefault"; player setVariable ["money",_money-_price,true]; @@ -22,7 +22,7 @@ _civ removeAllEventHandlers "FiredNear"; [_civ] spawn OT_fnc_initRecruit; [player,format["New Recruit: %1",name _civ],format["Recruited: %1 for $%2",name _civ,_price]] call BIS_fnc_createLogRecord; -format["%1 has been recruited",name _civ] call notify_minor; +format["%1 has been recruited",name _civ] call OT_fnc_notifyMinor; _civ setBehaviour "SAFE"; [[_civ,""],"switchMove",TRUE,FALSE] spawn BIS_fnc_MP; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf b/addons/overthrow_main/functions/actions/fn_salvageWreck.sqf similarity index 85% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf rename to addons/overthrow_main/functions/actions/fn_salvageWreck.sqf index aaa60f0c..f2a1e7c8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf +++ b/addons/overthrow_main/functions/actions/fn_salvageWreck.sqf @@ -20,11 +20,11 @@ private _doSalvage = { private _veh = _this; if(!(_veh isKindOf "Truck_F" or _veh isKindOf "ReammoBox_F") and !(_veh canAdd "OT_Steel")) exitWith { - "Vehicle is full, use a truck or ammobox for more storage" call notify_minor; + "Vehicle is full, use a truck or ammobox for more storage" call OT_fnc_notifyMinor; }; private _toname = (typeof _veh) call ISSE_Cfg_Vehicle_GetName; - format["Salvaging wreck into %1",_toname] call notify_minor; + format["Salvaging wreck into %1",_toname] call OT_fnc_notifyMinor; player playMove "AinvPknlMstpSnonWnonDnon_medic_1"; [14,false] call progressBar; sleep 7; @@ -33,9 +33,9 @@ private _doSalvage = { _veh addItemCargoGlobal ["OT_Steel", _steel]; if(_plastic > 0) then { _veh addItemCargoGlobal ["OT_Plastic", _plastic]; - format["Salvaged: %1 x Steel, %1 x Plastic",_steel,_plastic] call notify_minor; + format["Salvaged: %1 x Steel, %1 x Plastic",_steel,_plastic] call OT_fnc_notifyMinor; }else{ - format["Salvaged: %1 x Steel",_steel] call notify_minor; + format["Salvaged: %1 x Steel",_steel] call OT_fnc_notifyMinor; }; deleteVehicle _wreck; }; @@ -50,9 +50,9 @@ if(count _objects == 1) then { { _options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doSalvage,_x]; }foreach(_objects); - "Salvage to which container?" call notify_big; + "Salvage to which container?" call OT_fnc_notifyBig; _options spawn playerDecision; }else{ - "No nearby containers or vehicles to put salvaged items" call notify_minor; + "No nearby containers or vehicles to put salvaged items" call OT_fnc_notifyMinor; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf b/addons/overthrow_main/functions/actions/fn_sell.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf rename to addons/overthrow_main/functions/actions/fn_sell.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf b/addons/overthrow_main/functions/actions/fn_sellAll.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf rename to addons/overthrow_main/functions/actions/fn_sellAll.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showBusinessInfo.sqf b/addons/overthrow_main/functions/actions/fn_showBusinessInfo.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showBusinessInfo.sqf rename to addons/overthrow_main/functions/actions/fn_showBusinessInfo.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showMemberInfo.sqf b/addons/overthrow_main/functions/actions/fn_showMemberInfo.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showMemberInfo.sqf rename to addons/overthrow_main/functions/actions/fn_showMemberInfo.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_takeFunds.sqf b/addons/overthrow_main/functions/actions/fn_takeFunds.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_takeFunds.sqf rename to addons/overthrow_main/functions/actions/fn_takeFunds.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf b/addons/overthrow_main/functions/actions/fn_takeLegit.sqf similarity index 81% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf rename to addons/overthrow_main/functions/actions/fn_takeLegit.sqf index 7cb5b415..819c3abc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf +++ b/addons/overthrow_main/functions/actions/fn_takeLegit.sqf @@ -2,7 +2,7 @@ _veh = vehicle player; if(_veh == player) exitWith {}; -format["Taking legal inventory from vehicle"] call notify_minor; +format["Taking legal inventory from vehicle"] call OT_fnc_notifyMinor; [5,false] call progressBar; sleep 5; @@ -25,4 +25,4 @@ sleep 5; }; }foreach(_veh call OT_fnc_unitStock); -"Inventory Transfer done" call notify_minor; +"Inventory Transfer done" call OT_fnc_notifyMinor; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf b/addons/overthrow_main/functions/actions/fn_talkToCiv.sqf similarity index 98% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf rename to addons/overthrow_main/functions/actions/fn_talkToCiv.sqf index c46dc027..be5d2487 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_talkToCiv.sqf @@ -40,7 +40,7 @@ if !((_civ getvariable ["garrison",""]) isEqualTo "") then {_canRecruit = false; if (_canRecruit) then { _options pushBack [ - format["Recruit Civilian (-$%1)",_civprice],recruitCiv + format["Recruit Civilian (-$%1)",_civprice],OT_fnc_recruitCiv ]; }; @@ -180,7 +180,7 @@ if (_canBuyBoats) then { ]; _options pushBack [ "Ferry Service",{ - "Where do you want to go?" call notify_minor; + "Where do you want to go?" call OT_fnc_notifyMinor; _ferryoptions = []; { private _p = markerPos(_x); @@ -192,11 +192,11 @@ if (_canBuyBoats) then { player setVariable ["OT_ferryDestination",_destpos,false]; private _desttown = _destpos call OT_fnc_nearestTown; private _pos = (getpos player) findEmptyPosition [10,100,OT_vehType_ferry]; - if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; + if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor}; private _cost = floor((player distance _destpos) * 0.005); player setVariable ["OT_ferryCost",_cost,false]; _money = player getVariable "money"; - if(_money < _cost) exitWith {"You cannot afford that!" call notify_minor}; + if(_money < _cost) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor}; [-_cost] call money; _veh = OT_vehType_ferry createVehicle _pos; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf similarity index 92% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf rename to addons/overthrow_main/functions/actions/fn_transferFrom.sqf index 5fcc8a5b..49fbf81b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf +++ b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf @@ -8,7 +8,7 @@ _objects = []; }foreach(player nearEntities [["Car","ReammoBox_F","Air","Ship"],20]); if(count _objects == 0) exitWith { - "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; + "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor; }; _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; _target = _sorted select 0; @@ -25,9 +25,10 @@ if(_veh call unitSeen) then { _doTransfer = { private _target = _this; + private _veh = vehicle player; disableUserInput true; - format["Transferring inventory from %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor; + format["Transferring inventory from %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor; [5,false] call progressBar; _end = time + 5; { @@ -80,7 +81,7 @@ _doTransfer = { if(_full) exitWith {hint "This vehicle is full, use a truck for more storage"}; }foreach(_target call OT_fnc_unitStock); waitUntil {time > _end}; - "Inventory Transfer done" call notify_minor; + "Inventory Transfer done" call OT_fnc_notifyMinor; disableUserInput false; }; @@ -92,6 +93,6 @@ if(count _objects == 1) then { { _options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x]; }foreach(_objects); - "Transfer from which container?" call notify_big; + "Transfer from which container?" call OT_fnc_notifyBig; _options spawn playerDecision; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf b/addons/overthrow_main/functions/actions/fn_transferFunds.sqf similarity index 94% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf rename to addons/overthrow_main/functions/actions/fn_transferFunds.sqf index 502f078b..bd9e3a1c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf +++ b/addons/overthrow_main/functions/actions/fn_transferFunds.sqf @@ -18,7 +18,7 @@ inputHandler = { private _money = [_uid,"money"] call OT_fnc_getOfflinePlayerAttribute; [_uid,"money",_money+_val] call OT_fnc_setOfflinePlayerAttribute; }; - format["Transferred $%1 resistance funds to %2",[_val, 1, 0, true] call CBA_fnc_formatNumber,server getvariable [format["name%1",_uid],"player"]] call notify_minor; + format["Transferred $%1 resistance funds to %2",[_val, 1, 0, true] call CBA_fnc_formatNumber,server getvariable [format["name%1",_uid],"player"]] call OT_fnc_notifyMinor; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf b/addons/overthrow_main/functions/actions/fn_transferLegit.sqf similarity index 91% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf rename to addons/overthrow_main/functions/actions/fn_transferLegit.sqf index e00c4826..7adbc63b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf +++ b/addons/overthrow_main/functions/actions/fn_transferLegit.sqf @@ -19,7 +19,7 @@ if(typename _b == "ARRAY") then { }foreach(player nearEntities [["Car","ReammoBox_F","Air","Ship"],20]); if(count _objects == 0) exitWith { - "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; + "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor; }; _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; _target = _sorted select 0; @@ -30,7 +30,7 @@ _doTransfer = { private _toname = (typeof _target) call ISSE_Cfg_Vehicle_GetName; private _iswarehouse = (_target isKindOf "OT_warehouse"); if(_iswarehouse) then {_toname = "Warehouse"}; - format["Transferring legal inventory from %1",_toname] call notify_minor; + format["Transferring legal inventory from %1",_toname] call OT_fnc_notifyMinor; [5,false] call progressBar; @@ -76,7 +76,7 @@ _doTransfer = { }foreach(_target call OT_fnc_unitStock); }; if(_full) then {hint "This vehicle is full, use a truck for more storage"}; - "Inventory Transfer done" call notify_minor; + "Inventory Transfer done" call OT_fnc_notifyMinor; }; if(count _objects == 1) then { @@ -86,6 +86,6 @@ if(count _objects == 1) then { { _options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x]; }foreach(_objects); - "Transfer legal items from which container?" call notify_big; + "Transfer legal items from which container?" call OT_fnc_notifyBig; _options spawn playerDecision; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf b/addons/overthrow_main/functions/actions/fn_transferTo.sqf similarity index 93% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf rename to addons/overthrow_main/functions/actions/fn_transferTo.sqf index 3db49248..be7ee3e5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf +++ b/addons/overthrow_main/functions/actions/fn_transferTo.sqf @@ -28,11 +28,11 @@ if(!_iswarehouse and !_notvehicle) then { if(!_notvehicle and count _objects == 0) exitWith { - "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; + "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor; }; if(_notvehicle and count _objects == 0) exitWith { - "No warehouse within range" call notify_minor; + "No warehouse within range" call OT_fnc_notifyMinor; }; private _doTransfer = { @@ -49,7 +49,7 @@ private _doTransfer = { _target = OT_warehouseTarget; }; - format["Transferring inventory to %1",_toname] call notify_minor; + format["Transferring inventory to %1",_toname] call OT_fnc_notifyMinor; [5,false] call progressBar; sleep 5; if(_iswarehouse) then { @@ -116,7 +116,7 @@ private _doTransfer = { }foreach(_target call OT_fnc_unitStock); }; - "Inventory Transfer done" call notify_minor; + "Inventory Transfer done" call OT_fnc_notifyMinor; }; @@ -129,6 +129,6 @@ if(count _objects == 1) then { { _options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x]; }foreach(_objects); - "Transfer to which container?" call notify_big; + "Transfer to which container?" call OT_fnc_notifyBig; _options spawn playerDecision; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf b/addons/overthrow_main/functions/actions/fn_warehouseTake.sqf similarity index 96% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf rename to addons/overthrow_main/functions/actions/fn_warehouseTake.sqf index 7c03618b..342d43cd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf +++ b/addons/overthrow_main/functions/actions/fn_warehouseTake.sqf @@ -25,7 +25,7 @@ if(_veh == player) then { }; }; if(_veh == player) exitWith { - "No warehouse within range" call notify_minor; + "No warehouse within range" call OT_fnc_notifyMinor; }; while {_count < _num} do { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf b/addons/overthrow_main/functions/actions/fn_workshopAdd.sqf similarity index 92% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf rename to addons/overthrow_main/functions/actions/fn_workshopAdd.sqf index cdd2409c..e45e3b59 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf +++ b/addons/overthrow_main/functions/actions/fn_workshopAdd.sqf @@ -3,7 +3,7 @@ private _cls = lbData [1500,_idx]; private _price = lbValue [1500,_idx]; private _money = player getVariable "money"; -if(_money < _price) exitWith {"You cannot afford that!" call notify_minor}; +if(_money < _price) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor}; _veh = cursorTarget; if(_veh getVariable ["OT_attached",""] != "") exitWith {hint "This vehicle already has a weapon attached"}; @@ -33,7 +33,7 @@ if(!alive _veh) exitWith {}; disableUserInput true; - "Attaching weapon to vehicle" call notify_minor; + "Attaching weapon to vehicle" call OT_fnc_notifyMinor; [30,false] call progressBar; sleep 30; disableUserInput false; diff --git a/addons/overthrow_main/functions/events/fn_preInit.sqf b/addons/overthrow_main/functions/events/fn_preInit.sqf index a21fcb99..09606ab7 100644 --- a/addons/overthrow_main/functions/events/fn_preInit.sqf +++ b/addons/overthrow_main/functions/events/fn_preInit.sqf @@ -28,3 +28,5 @@ if(isServer) then { server setVariable ["StartupType","",true]; call OT_fnc_initVirtualization; }; + +OT_notifies = []; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf index 4fa334a4..06d0c846 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf @@ -14,7 +14,7 @@ _fail = { if(_objective == "The Fuel Depot") then { _effect = "(Vehicles are now cheaper)"; }; - format["Resistance has captured %1 (+100 Influence) %2",_objective,_effect] remoteExec ["notify_good",0,false]; + format["Resistance has captured %1 (+100 Influence) %2",_objective,_effect] remoteExec ["OT_fnc_notifyGood",0,false]; 100 remoteExec ["influenceSilent",0,false]; private _posTown = getMarkerPos _objective; _flag = _posTown nearobjects [OT_flag_NATO,500]; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf index 0787d743..1e60c43f 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf @@ -16,7 +16,7 @@ private _fail = { params ["_tskid","_town"]; private _townpop = server getVariable format["population%1",_town]; _townpop remoteExec ["influenceSilent",0,false]; - format["NATO has abandoned %1 (+%2 Influence)",_town,_townpop] remoteExec ["notify_good",0,false]; + format["NATO has abandoned %1 (+%2 Influence)",_town,_townpop] remoteExec ["OT_fnc_notifyGood",0,false]; [_tskid, "SUCCEEDED",true] spawn BIS_fnc_taskSetState; _abandoned = server getVariable "NATOabandoned"; _abandoned pushback _town; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf similarity index 100% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf rename to addons/overthrow_main/functions/fn_loadGame.sqf diff --git a/addons/overthrow_main/functions/fn_notifyMinor.sqf b/addons/overthrow_main/functions/fn_notifyMinor.sqf new file mode 100644 index 00000000..af2d1279 --- /dev/null +++ b/addons/overthrow_main/functions/fn_notifyMinor.sqf @@ -0,0 +1,2 @@ +_txt = format ["%1",_this]; +OT_notifies pushback _txt; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf similarity index 92% rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf rename to addons/overthrow_main/functions/fn_saveGame.sqf index cf04a8d5..084379a9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -2,7 +2,7 @@ if(OT_saving) exitWith {"Please wait, save still in progress" remoteExec ["hint" OT_saving = true; publicVariable "OT_saving"; -"Persistent Saving..." remoteExec ["notify_long",0,true]; +"Persistent Saving..." remoteExec ["OT_fnc_notifyLong",0,true]; sleep 0.1; waitUntil {!isNil "OT_NATOInitDone"}; @@ -65,7 +65,7 @@ _count = 10001; _vehicles pushback _params; }; if(_count > 2000) then { - "Still persistent Saving... please wait" remoteExec ["notify_long",0,true]; + "Still persistent Saving... please wait" remoteExec ["OT_fnc_notifyLong",0,true]; _count = 0; sleep 0.01; }; @@ -139,12 +139,12 @@ _data pushback ["timedate",date]; profileNameSpace setVariable ["Overthrow.save.001",_data]; if (isDedicated) then { - "Saving to dedicated server.. not long now" remoteExec ["notify_long",0,true]; + "Saving to dedicated server.. not long now" remoteExec ["OT_fnc_notifyLong",0,true]; sleep 0.01; saveProfileNamespace }; -"Persistent Save Completed" remoteExec ["notify_minor",0,true]; +"Persistent Save Completed" remoteExec ["OT_fnc_notifyMinor",0,true]; OT_saving = false; publicVariable "OT_saving"; diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp index 7a39ef29..726e9218 100644 --- a/addons/overthrow_main/ui/dialogs/main.hpp +++ b/addons/overthrow_main/ui/dialogs/main.hpp @@ -25,7 +25,7 @@ class OT_dialog_start class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "closeDialog 0;'actions\loadGame.sqf' remoteExec ['execVM',2,false];"; + action = "closeDialog 0;[] remoteExec ['OT_fnc_loadGame',2,false];"; text = "Load Persistent Save"; //--- ToDo: Localize; x = 0.448438 * safezoneW + safezoneX; @@ -94,7 +94,7 @@ class OT_dialog_vehicle y = 0.302 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; - action = "closeDialog 0;[] spawn fastTravel;"; + action = "closeDialog 0;[] spawn OT_fnc_fastTravel;"; tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize; }; class RscButton_1601: RscOverthrowButton @@ -106,7 +106,7 @@ class OT_dialog_vehicle w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Transfers the contents of the closest container into this vehicle"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn transferFrom;"; + action = "closeDialog 0;[] spawn OT_fnc_transferFrom;"; }; class RscButton_1602: RscOverthrowButton { @@ -117,7 +117,7 @@ class OT_dialog_vehicle w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Transfers the contents of this vehicle into the closest container"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn transferTo;"; + action = "closeDialog 0;[] spawn OT_fnc_transferTo;"; }; class RscButton_1603: RscOverthrowButton { @@ -128,7 +128,7 @@ class OT_dialog_vehicle w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Transfers only legal (sellable) items from the closest container into this vehicle"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn transferLegit;"; + action = "closeDialog 0;[] spawn OT_fnc_transferLegit;"; }; class RscButton_1604: RscOverthrowButton { @@ -139,7 +139,7 @@ class OT_dialog_vehicle w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Takes legal (sellable) items from the vehicle into your inventory"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn takeLegit;"; + action = "closeDialog 0;[] spawn OT_fnc_takeLegit;"; }; class RscButton_1605: RscOverthrowButton { @@ -203,7 +203,7 @@ class OT_dialog_vehiclewarehouse y = 0.39 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; - action = "closeDialog 0;[] spawn fastTravel;"; + action = "closeDialog 0;[] spawn OT_fnc_fastTravel;"; tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize; }; class RscButton_1601: RscOverthrowButton @@ -226,7 +226,7 @@ class OT_dialog_vehiclewarehouse w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Stores the contents of this vehicle in the warehouse"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn transferTo;"; + action = "closeDialog 0;[] spawn OT_fnc_transferTo;"; }; class RscButton_1603: RscOverthrowButton { @@ -237,7 +237,7 @@ class OT_dialog_vehiclewarehouse w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Takes all legal (sellable) items from the warehouse"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn transferLegit;"; + action = "closeDialog 0;[] spawn OT_fnc_transferLegit;"; }; class RscButton_1612: RscOverthrowButton { @@ -290,7 +290,7 @@ class OT_dialog_vehicleport y = 0.39 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; - action = "closeDialog 0;[] spawn fastTravel;"; + action = "closeDialog 0;[] spawn OT_fnc_fastTravel;"; tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize; }; class RscButton_1601: RscOverthrowButton @@ -488,7 +488,7 @@ class OT_dialog_options class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "closeDialog 0;'actions\saveGame.sqf' remoteExec ['execVM',2];"; + action = "closeDialog 0;[] remoteExec ['OT_fnc_saveGame',2,false];"; text = "Persistent Save"; //--- ToDo: Localize; x = 0.448438 * safezoneW + safezoneX; @@ -548,7 +548,7 @@ class OT_dialog_options class RscButton_1605: RscOverthrowButton { idc = 1605; - action = "{if !(alive _x) then {deletevehicle _x}} foreach(vehicles);{if !(_x call canDrive) then {deletevehicle _x}} foreach(vehicles);{deleteVehicle _x} foreach(alldeadmen);""Cleaned bodies/wrecks"" remoteExec [""notify_minor"",0,false];"; + action = "{if !(alive _x) then {deletevehicle _x}} foreach(vehicles);{if !(_x call canDrive) then {deletevehicle _x}} foreach(vehicles);{deleteVehicle _x} foreach(alldeadmen);""Cleaned bodies/wrecks"" remoteExec [""OT_fnc_notifyMinor"",0,false];"; text = "Clean bodies/wrecks"; //--- ToDo: Localize; x = 0.386562 * safezoneW + safezoneX; @@ -560,7 +560,7 @@ class OT_dialog_options class RscButton_1606: RscOverthrowButton { idc = 1606; - action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and (_x getvariable [""owner"",""""] != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""notify_minor"",0,false];"; + action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and (_x getvariable [""owner"",""""] != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""OT_fnc_notifyMinor"",0,false];"; text = "Clean other"; //--- ToDo: Localize; x = 0.515469 * safezoneW + safezoneX; @@ -624,7 +624,7 @@ class OT_dialog_main class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "closeDialog 0;[] spawn fastTravel"; + action = "closeDialog 0;[] spawn OT_fnc_fastTravel"; text = "Fast Travel"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; @@ -691,7 +691,7 @@ class OT_dialog_main class RscButton_1605: RscOverthrowButton { idc = 1605; - action = "closeDialog 0;[] spawn talkToCiv"; + action = "closeDialog 0;[] spawn OT_fnc_talkToCiv"; text = "Talk"; //--- ToDo: Localize; x = 0.881562 * safezoneW + safezoneX; @@ -712,7 +712,7 @@ class OT_dialog_main class RscButton_1608: RscOverthrowButton { idc = 1608; - action = "closeDialog 0;[] call buyBuilding"; + action = "closeDialog 0;[] call OT_fnc_buyBuilding"; text = "Buy"; //--- ToDo: Localize; x = 0.881562 * safezoneW + safezoneX; diff --git a/addons/overthrow_main/ui/dialogs/shop.hpp b/addons/overthrow_main/ui/dialogs/shop.hpp index 3a274bc1..dac23962 100644 --- a/addons/overthrow_main/ui/dialogs/shop.hpp +++ b/addons/overthrow_main/ui/dialogs/shop.hpp @@ -51,7 +51,7 @@ class OT_dialog_buy w = 0.139219 * safezoneW; h = 0.099 * safezoneH; colorBackground[] = {0,0,0,0.8}; - action = "[] call buy;"; + action = "[] call OT_fnc_buy;"; }; class RscStructuredText_1100: RscOverthrowStructuredText { @@ -105,7 +105,7 @@ class OT_dialog_sell class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "[] call sell;"; + action = "[] call OT_fnc_sell;"; text = "Sell 1"; //--- ToDo: Localize; x = 0.515469 * safezoneW + safezoneX; @@ -127,7 +127,7 @@ class OT_dialog_sell class RscButton_1602: RscOverthrowButton { idc = 1600; - action = "[] call sellall;"; + action = "[] call OT_fnc_sellAll;"; text = "Sell All"; //--- ToDo: Localize; x = 0.613437 * safezoneW + safezoneX; @@ -189,7 +189,7 @@ class OT_dialog_workshop class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "[] call workshopAdd;"; + action = "[] call OT_fnc_workshopAdd;"; text = "Add"; //--- ToDo: Localize; x = 0.752656 * safezoneW + safezoneX; @@ -293,7 +293,7 @@ class OT_dialog_warehouse class RscButton_1600: RscOverthrowButton { idc = 1600; - action = "[-1] call warehouseTake;"; + action = "[-1] call OT_fnc_warehouseTake;"; text = "Take All"; //--- ToDo: Localize; x = 0.840312 * safezoneW + safezoneX; @@ -315,7 +315,7 @@ class OT_dialog_warehouse class RscButton_1601: RscOverthrowButton { idc = 1600; - action = "[100] call warehouseTake;"; + action = "[100] call OT_fnc_warehouseTake;"; text = "Take 100"; //--- ToDo: Localize; x = 0.778437 * safezoneW + safezoneX; @@ -327,7 +327,7 @@ class OT_dialog_warehouse class RscButton_1602: RscOverthrowButton { idc = 1600; - action = "[10] call warehouseTake;"; + action = "[10] call OT_fnc_warehouseTake;"; text = "Take 10"; //--- ToDo: Localize; x = 0.716563 * safezoneW + safezoneX; @@ -339,7 +339,7 @@ class OT_dialog_warehouse class RscButton_1603: RscOverthrowButton { idc = 1600; - action = "[1] call warehouseTake;"; + action = "[1] call OT_fnc_warehouseTake;"; text = "Take 1"; //--- ToDo: Localize; x = 0.654688 * safezoneW + safezoneX; diff --git a/addons/overthrow_main/ui/dialogs/stats.hpp b/addons/overthrow_main/ui/dialogs/stats.hpp index 38b8c207..a1729595 100644 --- a/addons/overthrow_main/ui/dialogs/stats.hpp +++ b/addons/overthrow_main/ui/dialogs/stats.hpp @@ -52,7 +52,7 @@ class RscTitles { w = 0.139219 * safezoneW; h = 0.099 * safezoneH; colorBackground[] = {0,0,0,0.8}; - action = "[] call buy;"; + action = "[] call OT_fnc_buy;"; }; class RscStructuredText_1100: RscOverthrowStructuredText { From 53176c24845f3ea9ab3acf72f773828062282fee Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Thu, 4 May 2017 12:25:20 +1000 Subject: [PATCH 02/16] Some small improvements to NATO --- addons/overthrow_main/CfgFunctions.hpp | 2 + .../Overthrow.Tanoa/data/airports.sqf | 10 +- .../Overthrow.Tanoa/data/objectives.sqf | 14 +- .../missions/Overthrow.Tanoa/description.ext | 2 +- .../Overthrow.Tanoa/factions/NATO.sqf | 514 +++--------------- .../missions/Overthrow.Tanoa/init.sqf | 1 + .../missions/Overthrow.Tanoa/initServer.sqf | 1 + .../missions/Overthrow.Tanoa/initVar.sqf | 10 +- .../functions/AI/fn_parachuteAll.sqf | 21 +- .../functions/factions/NATO/fn_NATOQRF.sqf | 12 +- .../functions/factions/NATO/fn_initNATO.sqf | 230 ++++++++ mod.cpp | 4 +- 12 files changed, 363 insertions(+), 458 deletions(-) create mode 100644 addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf diff --git a/addons/overthrow_main/CfgFunctions.hpp b/addons/overthrow_main/CfgFunctions.hpp index 54edc8ef..203c52dd 100644 --- a/addons/overthrow_main/CfgFunctions.hpp +++ b/addons/overthrow_main/CfgFunctions.hpp @@ -208,6 +208,8 @@ class CfgFunctions class NATO { file = "\ot\functions\factions\NATO"; + class initNATO {}; + class NATOQRF {}; class NATOGroundForces {}; class CTRGSupport {}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf index 9a963249..fda78ce7 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf @@ -1,7 +1,7 @@ OT_airportData = [ - [[7083.24,7393.07,0],"Aéroport de Tanoa"], - [[11709,3150.79,0],"Saint-George Airstrip"], - [[2144.06,3462.68,0],"Bala Airstrip"], - [[11685.5,13134.1,0],"La Rochelle Aerodrome"], - [[2430.34,13330.8,0],"Tuvanaka Airbase"] + [[7083.24,7393.07,0],"Aéroport de Tanoa",1500], + [[11709,3150.79,0],"Saint-George Airstrip",1000], + [[2144.06,3462.68,0],"Bala Airstrip",900], + [[11685.5,13134.1,0],"La Rochelle Aerodrome",900], + [[2430.34,13330.8,0],"Tuvanaka Airbase",3000] ]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf index af0c7b29..b86e28f1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf @@ -1,11 +1,11 @@ OT_objectiveData = [ - [[10098.7,11818.1,0],"Comms Alpha"], - [[2271.72,6331.39,0],"fuel depot"], - [[4166.48,11723.6,0],"The Harbor Remnants"], - [[3432.65,12893.3,0],"The Firing Range"], - [[3870.23,13412.4,0],"The Vehicle Range"], - [[3939.27,13915,0],"The Camp Remnants"], - [[3166.18,11038.8,0],"Belfort Naval Base"] + [[10098.7,11818.1,0],"Comms Alpha",400], + [[2271.72,6331.39,0],"fuel depot",250], + [[4166.48,11723.6,0],"The Harbor Remnants",250], + [[3432.65,12893.3,0],"The Firing Range",250], + [[3870.23,13412.4,0],"The Vehicle Range",300], + [[3939.27,13915,0],"The Camp Remnants",250], + [[3166.18,11038.8,0],"Belfort Naval Base",500] ]; OT_NATOregion = "island_5"; OT_NATO_HQ = "Tuvanaka Airbase"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 0d948383..12d3049f 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.5"; +OnLoadMission = "v0.7.4.0-DEV"; 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 d9cf19ab..ff6c0d47 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -1,474 +1,134 @@ if (!isServer) exitwith {}; -private ["_name","_pos","_garrison","_need","_townPos","_current","_stability","_police","_civ","_units","_move","_NATObusy","_abandoned"]; - -OT_NATOobjectives = []; -OT_NATOcomms = []; - - -private _NATObusy = false; private _abandoned = []; +private _resources = 0; private _diff = server getVariable ["OT_difficulty",1]; -OT_NATOobjectives = server getVariable ["NATOobjectives",[]]; -OT_NATOcomms = server getVariable ["NATOcomms",[]]; -OT_NATOhvts = server getVariable ["NATOhvts",[]]; -OT_allObjectives = []; -OT_allComms = []; - -if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOversion",0]) < OT_NATOversion) then { - diag_log "Overthrow: Generating NATO"; - server setVariable ["NATOversion",OT_NATOversion,false]; - _abandoned = server getVariable ["NATOabandoned",[]]; - - (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0,false]; - sleep 0.1; - { - _stability = server getVariable format ["stability%1",_x]; - if(_stability < 11 and !(_x in _abandoned)) then { - _abandoned pushback _x; - }; - }foreach (OT_allTowns); - server setVariable ["NATOabandoned",_abandoned,true]; - server setVariable ["garrisonHQ",1000,false]; - OT_NATOobjectives = []; - OT_NATOcomms = []; - OT_NATOhvts = []; - server setVariable ["NATOobjectives",OT_NATOobjectives,false]; - server setVariable ["NATOcomms",OT_NATOcomms,false]; - server setVariable ["NATOhvts",OT_NATOhvts,false]; - - _numHVTs = 6; - if(_diff == 0) then {_numHVTs = 4}; - if(_diff == 2) then {_numHVTs = 8}; - - //Find military objectives - { - _x params ["_pos","_name"]; - if !(_name in _abandoned) then { - OT_NATOobjectives pushBack [_pos,_name]; - server setVariable [format ["vehgarrison%1",_name],[],true]; - - _garrison = floor(4 + random(8)); - if(_name in OT_NATO_priority or _name in OT_allAirports) then { - _garrison = floor(16 + random(8)); - server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"],true]; - }; - if(_name == OT_NATO_HQ) then { - _garrison = 48; - server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_T_APC_Tracked_01_AA_F","B_GMG_01_high_F","B_GMG_01_high_F","B_GMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F"],true]; - server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true]; - }else{ - server setVariable [format ["airgarrison%1",_name],[],true]; - }; - server setVariable [format ["garrison%1",_name],_garrison,true]; - - if(_name == OT_NATO_HQ) then { - OT_NATO_HQPos = _pos; - }; - - sleep 0.05; - - }else{ - OT_NATOobjectives pushBack [_pos,_name]; - }; - }foreach (OT_objectiveData + OT_airportData); - - _count = 0; - _done = []; - while {_count < _numHVTs} do { - _ob = selectRandom (OT_NATOobjectives - ([[OT_NATO_HQ,OT_NATO_HQPos]] + _done)); - _name = _ob select 1; - _done pushback _ob; - _id = format["%1%2",_name,round(random 99999)]; - OT_NATOhvts pushback [_id,_name,""]; - _count = _count + 1; - }; - (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0]; - sleep 0.1; - //Add comms towers - { - _x params ["_pos","_name"]; - OT_NATOcomms pushBack [_pos,_name]; - _garrison = floor(4 + random(4)); - server setVariable [format ["garrison%1",_name],_garrison,true]; - }foreach (OT_commsData); +private _nextturn = OT_NATOwait + random OT_NATOwait; +private _count = 0; - server setVariable ["NATOobjectives",OT_NATOobjectives,true]; - server setVariable ["NATOcomms",OT_NATOcomms,true]; - server setVariable ["NATOhvts",OT_NATOhvts,true]; - diag_log "Overthrow: Distributing NATO vehicles"; - //Randomly distribute NATO's vehicles - { - _type = _x select 0; - _num = _x select 1; - _count = 0; - while {_count < _num} do { - _obj = OT_NATOobjectives call BIS_fnc_selectRandom; - _name = _obj select 1; - _garrison = server getVariable format["vehgarrison%1",_name]; - _garrison pushback _type; - _count = _count + 1; - server setVariable [format ["vehgarrison%1",_name],_garrison,true]; - }; - }foreach(OT_NATO_Vehicles_Garrison); - - { - _type = _x select 0; - _num = _x select 1; - _count = 0; - while {_count < _num} do { - _name = OT_allAirports call BIS_fnc_selectRandom; - _garrison = server getVariable [format["airgarrison%1",_name],[]]; - _garrison pushback _type; - _count = _count + 1; - server setVariable [format ["airgarrison%1",_name],_garrison,true]; - }; - }foreach(OT_NATO_Vehicles_AirGarrison); - diag_log "Overthrow: Setting up NATO checkpoints"; - { - _garrison = floor(8 + random(6)); - if(_x in OT_NATO_priority) then { - _garrison = floor(12 + random(6)); - }; - - //_x setMarkerText format ["%1",_garrison]; - _x setMarkerAlpha 0; - server setVariable [format ["garrison%1",_x],_garrison,true]; - sleep 0.05; - }foreach (OT_NATO_control); - diag_log "Overthrow: Garrisoning towns"; - { - _town = _x; - _garrison = 0; - _stability = server getVariable format ["stability%1",_town]; - _population = server getVariable format ["population%1",_town]; - if(_stability > 10) then { - _max = round(_population / 30); - if(_max < 4) then {_max = 4}; - _garrison = 2+round((1-(_stability / 100)) * _max); - if(_town in OT_NATO_priority) then { - _garrison = round(_garrison * 2); - }; - }; - server setVariable [format ["garrison%1",_x],_garrison,true]; - sleep 0.05; - }foreach (OT_allTowns); -}; -diag_log "Overthrow: NATO Init Done"; - -OT_NATOInitDone = true; -publicVariable "OT_NATOInitDone"; - -{ - _pos = _x select 0; - _name = _x select 1; - _mrk = createMarker [_name,[_pos,25,270] call BIS_fnc_relPos]; - _mrk setMarkerShape "ICON"; - if(_name in (server getVariable "NATOabandoned")) then { - _mrk setMarkerType "flag_Tanoa"; - }else{ - _mrk setMarkerType "flag_NATO"; - }; - - server setVariable [_name,_pos,true]; - - OT_allObjectives pushback _name; -}foreach(OT_NATOobjectives); - -publicVariable "OT_allObjectives"; - -{ - _pos = _x select 0; - _name = _x select 1; - _mrk = createMarker [_name,_pos]; - _mrk setMarkerShape "ICON"; - _mrk setMarkerType "loc_Transmitter"; - if(_name in (server getVariable "NATOabandoned")) then { - _mrk setMarkerColor "ColorGUER"; - }else{ - _mrk setMarkerColor "ColorBLUFOR"; - }; - server setVariable [_name,_pos,true]; - OT_allComms pushback _name; - OT_allObjectives pushback _name; -}foreach(OT_NATOcomms); server setVariable ["NATOattacking","",true]; server setVariable ["NATOattackstart",0,true]; -sleep OT_NATOwait + round(random OT_NATOwait); - -while {true} do { - _garrisoned = false; - _numplayers = count([] call CBA_fnc_players); - _resources = server getVariable ["NATOresources",1000]; - _resourceGain = server getVariable ["NATOresourceGain",0]; - +while {sleep 10;true} do { + private _numplayers = count([] call CBA_fnc_players); if(_numplayers > 0) then { - diag_log format["Overthrow: NATO turn @ %1",time]; - _abandoned = server getVariable "NATOabandoned"; + _abandoned = server getVariable ["NATOabandoned",[]]; + _resources = server getVariable ["NATOresources",0]; + private _countered = (server getVariable ["NATOattacking",""]) != ""; - - private _currentAttack = server getVariable ["NATOattacking",""]; - private _currentAttackStart = server getVariable ["NATOattackstart",0]; - if(_currentAttack != "" and (time - _currentAttackStart) > 2400) then { - server setVariable ["NATOattacking","",true]; - _currentAttack = ""; + //Objective QRF + if !(_countered) then { { - if(side _x == west) then { - _lead = (units _x) select 0; - if((_lead getVariable ["garrison",""]) == "HQ") then { - if((vehicle _lead) != _lead) then { - [vehicle _lead] spawn OT_fnc_cleanup; - }; - [_x] spawn OT_fnc_cleanup; - }; - } - }foreach(allgroups); - }; - - if(_currentAttack == "") then { - _resources = _resources + _resourceGain + ((count _abandoned) * 25); - diag_log format["Overthrow: NATO resources @ %1",_resources]; - }else{ - diag_log format["Overthrow: NATO still attacking %1",_currentAttack]; - }; - - if(_currentAttack != "") then { - _garrisoned = true; - }; - - //Objective response - if !(_garrisoned) then { - { - _pos = _x select 0; - _name = _x select 1; + _x params ["_pos","_name","_cost"]; 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 or captive _x} count (_pos nearObjects ["CAManBase",200]); + _numres = {side _x == resistance or captive _x} count (_pos nearObjects 200); if(_nummil < 3 and _numres > 0) then { - _garrisoned = true; + _countered = true; server setVariable ["NATOattacking",_name,true]; server setVariable ["NATOattackstart",time,true]; diag_log format["Overthrow: NATO responding to %1",_name]; - [_name,_resources] spawn OT_fnc_NATOResponseObjective; + if(_resources < _cost) then {_cost = _resources}; + [_name,_cost] spawn OT_fnc_NATOResponseObjective; _name setMarkerAlpha 1; - _resources = 0; + _resources = _resources - _cost; }; }; }; - if(_garrisoned) exitWith {}; + if(_countered) exitWith {}; }foreach(OT_NATOobjectives); }; - if !(_garrisoned) then { + + //Town QRF (over 50 pop) + if !(_countered) then { + _sorted = [OT_allTowns,[],{server getvariable format["population%1",_x]},"DESCEND"] call BIS_fnc_SortBy; { _town = _x; - _townPos = server getVariable _town; - _current = server getVariable format ["garrison%1",_town];; + _pos = server getVariable _town; _stability = server getVariable format ["stability%1",_town]; _population = server getVariable format ["population%1",_town]; - if(_stability > 10 and !(_town in _abandoned)) then { - _max = round(_population / 40); - if(_max < 4) then {_max = 4}; - _garrison = 2+round((1-(_stability / 100)) * _max); - if(_town in OT_NATO_priority) then { - _garrison = round(_garrison * 2); - }; - _need = _garrison - _current; - if(_need < 0) then {_need = 0}; - if(_need > 1 and _resources >= 20) then { - _resources = _resources - 20; - _x spawn reGarrisonTown; + 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 200); + if(_nummil < 3 and _numres > 0) then { + if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) then { + server setVariable [format ["garrison%1",_town],0,true]; + diag_log format["Overthrow: NATO responding to %1",_town]; + [_town,_population] spawn OT_fnc_NATOResponseTown; + server setVariable ["NATOattacking",_town,true]; + server setVariable ["NATOattackstart",time,true]; + _countered = true; + _resources = _resources - _population; + }; }; }; - }foreach (OT_allTowns); + if(_countered) exitWith {}; + }foreach (_sorted); }; - { - _town = _x; - _stability = server getVariable format ["stability%1",_town]; - _population = server getVariable format ["population%1",_town]; - if(_population < 50) then { - if(_stability < 10 and !(_town in _abandoned)) then { - _abandoned pushback _town; - server setVariable [format ["garrison%1",_town],0,true]; - format["NATO has abandoned %1",_town] remoteExec ["OT_fnc_notifyGood",0,false]; - [_town,15] call stability; - }; - }; - }foreach (OT_allTowns); - //Town response - if !(_garrisoned) then { - _sorted = [OT_allTowns,[],{server getvariable format["population%1",_x]},"DESCEND"] call BIS_fnc_SortBy; + + if(_count >= _nextturn and !_countered) then { + _abandonedSomething = false; + //NATO turn + _nextturn = OT_NATOwait + random OT_NATOwait; + _count = 0; + + //Abandon towns (under 50 pop) { _town = _x; + _pos = server getVariable _town; _stability = server getVariable format ["stability%1",_town]; _population = server getVariable format ["population%1",_town]; - if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) exitWith { - server setVariable [format ["garrison%1",_town],0,true]; - diag_log format["Overthrow: NATO responding to %1",_town]; - [_town,_population] spawn OT_fnc_NATOResponseTown; - server setVariable ["NATOattacking",_town,true]; - server setVariable ["NATOattackstart",time,true]; - _garrisoned = true; - _resources = _resources - _population; - }; - }foreach (_sorted); - }; - - //Objective counter-attacks - if (!(_garrisoned) and count(_abandoned) > 2 and (_resources > 1000) and (random 100) > 95) then { - _highest = 0; - _high = 0; - private _sorted = [OT_NATOobjectives,[],{(_x select 0) distance OT_NATO_HQPos},"ASCEND"] call BIS_fnc_SortBy; - { - _x params ["_pos","_name"]; - if(_name != server getVariable ["NATOlastcounter",""]) then { - if(_name in _abandoned) exitWith { - diag_log format["Overthrow: NATO beginning attack on %1",_name]; - [_name,_resources] spawn OT_fnc_NATOCounterObjective; - server setVariable ["NATOlastcounter",_name,true]; - server setVariable ["NATOattacking",_name,true]; - server setVariable ["NATOattackstart",time,true]; - _resources = 0; - _garrisoned = true; + 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 200); + if(_nummil < 3 and _numres > 0) then { + if(_population < 50) then { + if(_stability < 10 and !(_town in _abandoned)) then { + _abandoned pushback _town; + server setVariable [format ["garrison%1",_town],0,true]; + format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false]; + [_town,15] call stability; + }; + }; }; }; - }foreach (_sorted); - }; + if(_abandonedSomething) exitWith {}; + }foreach (OT_allTowns); - //Town counter-attacks - if (!(_garrisoned) and count(_abandoned) > 5 and (_resources > 1000) and (random 100) > 98) then { - _highest = 0; - _high = 0; - { - if(_x != server getVariable ["NATOlastcounter",""]) then { - _pop = server getVariable[format["population%1",_x],0]; - if(_pop > 0 and _pop > _high) then { - _high = _pop; - _highest = _x; + if(!_abandonedSomething) then { + //Abandon towers + { + _pos = _x select 0; + _name = _x select 1; + 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 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; + _abandonedSomething = true; + }; + }; }; - }; - }foreach (_abandoned); - if(_high > 0) then { - diag_log format["Overthrow: NATO beginning attack on %1",_highest]; - [_highest,_resources] spawn OT_fnc_NATOCounterTown; - server setVariable ["NATOlastcounter",_name,true]; - server setVariable ["NATOattacking",_highest,true]; - server setVariable ["NATOattackstart",time,true]; - _resources = 0; - _garrisoned = true; + if(_abandonedSomething) exitWith {}; + }foreach(OT_NATOcomms); }; - }; - //HVT Convoys - if (!(_garrisoned) and (_resources > 200) and (random 100) > 96) then { - _highest = 0; - _high = 0; - //Move a random HVT somewhere - _hvt = selectRandom OT_NATOhvts; - _hvt params ["_id","_loc","_status"]; - _dest = selectRandom OT_NATOobjectives; - if(_status == "" and (_dest select 1) != _loc) then { - _frompos = server getVariable _loc; - _times = 0; - _do = true; - while {!([_frompos,_dest select 0] call OT_fnc_regionIsConnected)} do { - _dest = selectRandom OT_NATOobjectives; - _times = _times + 1; - if(_times > 50) exitWith {_do = false}; - }; - if (_do) then { - diag_log format["Overthrow: NATO moving a HVT from %1 to %2",_loc,_dest select 1]; - [[],[_hvt],_loc,_dest select 1] spawn OT_fnc_NATOConvoy; - _resources = _resources - 200; - _garrisoned = true; - }; - }; - }; - - //Radio tower counter-attacks - if (!(_garrisoned) and count(_abandoned) > 2 and (_resources > 200) and (random 100) > 90) then { - _highest = 0; - _high = 0; - private _sorted = [OT_NATOcomms,[],{(_x select 0) distance OT_NATO_HQPos},"ASCEND"] call BIS_fnc_SortBy; - { - _x params ["_pos","_name"]; - if(_pos in _abandoned) exitWith { - diag_log format["Overthrow: NATO sending recon team to %1",_name]; - _pos spawn OT_fnc_NATOSupportRecon; - _resources = _resources - 200; - _garrisoned = true; - }; - }foreach (_sorted); - }; - - { - _x params ["_pos","_name"]; - _alive = 0; - _enemy = 0; - { - if((side _x == west) and (alive _x) and ((_x getVariable ["garrison",""]) == "HQ")) then { - _alive = _alive + 1; - }; - if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then { - _enemy = _enemy + 1; - }; - }foreach(_pos nearEntities ["CAManBase",50]); - if(_alive > 1 and _enemy == 0) then { - _abandoned deleteAt (_abandoned find _name); - format["NATO has retaken control of the %1 tower",_name] remoteExec ["OT_fnc_notifyGood",0,false]; - _name setMarkerColor "ColorBLUFOR"; - _resources = _resources + 50; - server setVariable [format["garrison%1",_name],floor(4 + random(8)),true]; - }; - }foreach(OT_NATOcomms); - - if !(_garrisoned) then { - //Nothing to do, so NATO will harass - _chance = 98; - if(count _abandoned > 4) then {_chance = 95}; - if(count _abandoned > 8) then {_chance = 90}; - if(((random 100) > _chance) and (count _abandoned) > 0 and (_resources >= 25)) then { - _target = _abandoned call BIS_fnc_selectRandom; - _pos = server getvariable _target; - if !(isNil "_pos") then { - _pos spawn OT_fnc_NATOSupportSniper; - _resources = _resources - 25; - }; - }; + //Recover resources }; + //Finish + if(_resources > 2500) then {_resources = 2500}; + server setVariable ["NATOresources",_resources,true]; + server setVariable ["NATOabandoned",_abandoned,true]; }; - - { - _pos = _x select 0; - _name = _x select 1; - 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 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 ["OT_fnc_notifyGood",0,false]; - _resources = _resources - 100; - }; - }; - }; - }foreach(OT_NATOcomms); - if(_resources < 0) then {_resources = 0}; - - { - if(count (units _x) == 0) then { - deleteGroup _x; - }; - }foreach(allGroups); - if(_resources > 2500) then {_resources = 2500}; - server setVariable ["NATOresources",_resources,true]; - server setVariable ["NATOabandoned",_abandoned,true]; - sleep OT_NATOwait + round(random OT_NATOwait); + _count = _count + 1; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf index a85a7a32..0045a3b5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf @@ -36,6 +36,7 @@ if(!isMultiplayer) then { }; //Init factions + [] call OT_fnc_initNATO; [] execVM "factions\NATO.sqf"; [] execVM "factions\GUER.sqf"; [] execVM "factions\CRIM.sqf"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf index c2a7d215..0aa1fac0 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf @@ -20,6 +20,7 @@ if(OT_fastTime) then { waitUntil {sleep 1;server getVariable ["StartupType",""] != ""}; [] execVM "initEconomyLoad.sqf"; +[] call OT_fnc_initNATO; [] execVM "factions\NATO.sqf"; [] execVM "factions\GUER.sqf"; [] execVM "factions\CRIM.sqf"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 811d5c38..54c807ec 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck 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 @@ -212,9 +212,7 @@ OT_NATO_HQPos = [0,0,0];//Dont worry this gets populated later OT_NATO_Vehicles_Garrison = [ ["B_T_MRAP_01_hmg_F",5], - ["B_T_MRAP_01_gmg_F",5], - ["B_T_Static_AT_F",7], - ["B_HMG_01_high_F",10] + ["B_T_MRAP_01_gmg_F",5] ]; OT_NATO_Vehicles_AirGarrison = [ @@ -228,6 +226,10 @@ OT_NATO_Vehicles_AirGarrison = [ ["B_Plane_CAS_01_F",1] ]; +OT_NATO_StaticGarrison_LevelOne = ["B_HMG_01_high_F"]; +OT_NATO_StaticGarrison_LevelTwo = ["B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"]; +OT_NATO_StaticGarrison_LevelThree = ["B_T_Static_AT_F","B_T_Static_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"]; + OT_NATO_CommTowers = ["Land_TTowerBig_1_F","Land_TTowerBig_2_F"]; OT_NATO_Unit_PoliceCommander = "B_Gen_Commander_F"; diff --git a/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf b/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf index 4877b460..e88c0184 100644 --- a/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf +++ b/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf @@ -11,18 +11,19 @@ paraLandSafe = _unit = _this select 0; _chuteheight = _this select 1; if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute}; + waitUntil { !(alive _unit) or isTouchingGround _unit or (position _unit select 2) < 20 }; + + _unit allowDamage false; //So they dont hit trees or die on ground impact + waitUntil { !(alive _unit) or isTouchingGround _unit or (position _unit select 2) < 1 }; - if(!alive _unit) then { - deleteVehicle _unit; - }else{ - _unit action ["eject",_unit]; - sleep 1; - _inv = name _unit; - _id = [_unit] call fnc_getBuildID; - _unit setUnitLoadout (spawner getvariable [format["eject_%1",_id],[]]); - spawner setvariable [format["eject_%1",_id],nil,false]; - }; + _unit action ["eject",_unit]; + sleep 1; + _inv = name _unit; + _id = [_unit] call fnc_getBuildID; + _unit setUnitLoadout (spawner getvariable [format["eject_%1",_id],[]]); + spawner setvariable [format["eject_%1",_id],nil,false]; + _unit allowDamage true; }; OpenPlayerChute = diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf index 7540d957..01dd2e17 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf @@ -208,6 +208,14 @@ waitUntil { { _numalive = _numalive + ({alive _x} count (units _x)); _numin = _numin + ({alive _x and _x distance _pos < 150} count (units _x)); + { + if(vehicle _x != _x) then { + if(((vehicle _x) isKindOf "Air") and (position _x select 2) < 4) then { + //Downed heli + doGetout _x; + } + }; + }foreach(units _x); }foreach(_force); (_numalive < 4) or (time > _timeout) or (_numin > 4) }; @@ -216,7 +224,7 @@ private _force = spawner getVariable["NATOattackforce",[]]; { _target = leader _x; { - if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then { + if((side _x == resistance or captive _x) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then { _x reveal [_target,3]; }; }foreach(allunits); @@ -246,7 +254,7 @@ while {sleep 5;time < _timeout and !_won} do { _alivein = _alivein + 1; }; }; - if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then { + if((side _x == resistance or captive _x) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then { _enemy = _enemy + 1; if(_x distance _pos < 400) then { _enemyin = _enemyin + 1; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf new file mode 100644 index 00000000..8d26bd20 --- /dev/null +++ b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf @@ -0,0 +1,230 @@ +if (!isServer) exitwith {}; + +OT_NATOobjectives = []; +OT_NATOcomms = []; + +OT_NATOobjectives = server getVariable ["NATOobjectives",[]]; +OT_NATOcomms = server getVariable ["NATOcomms",[]]; +OT_NATOhvts = server getVariable ["NATOhvts",[]]; +OT_allObjectives = []; +OT_allComms = []; + +private _diff = server getVariable ["OT_difficulty",1]; + +if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOversion",0]) < OT_NATOversion) then { + diag_log "Overthrow: Generating NATO"; + server setVariable ["NATOversion",OT_NATOversion,false]; + _abandoned = server getVariable ["NATOabandoned",[]]; + + (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0,false]; + sleep 0.1; + { + _stability = server getVariable format ["stability%1",_x]; + if(_stability < 11 and !(_x in _abandoned)) then { + _abandoned pushback _x; + }; + }foreach (OT_allTowns); + server setVariable ["NATOabandoned",_abandoned,true]; + server setVariable ["garrisonHQ",1000,false]; + OT_NATOobjectives = []; + OT_NATOcomms = []; + OT_NATOhvts = []; + server setVariable ["NATOobjectives",OT_NATOobjectives,false]; + server setVariable ["NATOcomms",OT_NATOcomms,false]; + server setVariable ["NATOhvts",OT_NATOhvts,false]; + + _numHVTs = 6; + if(_diff == 0) then {_numHVTs = 4}; + if(_diff == 2) then {_numHVTs = 8}; + + //Find military objectives + { + _x params ["_pos","_name","_worth"]; + if !(_name in _abandoned) then { + OT_NATOobjectives pushBack _x; + server setVariable [format ["vehgarrison%1",_name],[],true]; + + _base = 8; + _statics = OT_NATO_StaticGarrison_LevelOne; + if(_worth > 500) then { + _base = 16; + _statics = OT_NATO_StaticGarrison_LevelTwo; + }; + if(_worth > 1000) then { + _base = 24; + _statics = OT_NATO_StaticGarrison_LevelThree; + }; + _garrison = floor(_base + random(8)); + server setVariable [format ["vehgarrison%1",_name],_statics,true]; + + if(_name == OT_NATO_HQ) then { + _garrison = 48; + server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_T_APC_Tracked_01_AA_F","B_GMG_01_high_F","B_GMG_01_high_F","B_GMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F"],true]; + server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true]; + }else{ + server setVariable [format ["airgarrison%1",_name],[],true]; + }; + server setVariable [format ["garrison%1",_name],_garrison,true]; + + if(_name == OT_NATO_HQ) then { + OT_NATO_HQPos = _pos; + }; + }else{ + OT_NATOobjectives pushBack _x; + }; + }foreach (OT_objectiveData + OT_airportData); + + _count = 0; + _done = []; + while {_count < _numHVTs} do { + _ob = selectRandom (OT_NATOobjectives - ([[OT_NATO_HQ,OT_NATO_HQPos]] + _done)); + _name = _ob select 1; + _done pushback _ob; + _id = format["%1%2",_name,round(random 99999)]; + OT_NATOhvts pushback [_id,_name,""]; + _count = _count + 1; + }; + + (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0]; + sleep 0.1; + //Add comms towers + { + _x params ["_pos","_name"]; + OT_NATOcomms pushBack [_pos,_name]; + _garrison = floor(4 + random(4)); + server setVariable [format ["garrison%1",_name],_garrison,true]; + }foreach (OT_commsData); + + server setVariable ["NATOobjectives",OT_NATOobjectives,true]; + server setVariable ["NATOcomms",OT_NATOcomms,true]; + server setVariable ["NATOhvts",OT_NATOhvts,true]; + diag_log "Overthrow: Distributing NATO vehicles"; + + + //Randomly distribute NATO's vehicles + //First, build a weighted list of objectives + _prilist = []; + { + _x params ["_pos","_name","_worth"]; + + if(_worth > 250) then { + _prilist pushback _name; + }; + if(_worth > 800) then { + _prilist pushback _name; + }; + if(_worth > 1200) then { + _prilist pushback _name; + }; + }foreach(OT_NATOobjectives); + + { + _type = _x select 0; + _num = _x select 1; + _count = 0; + while {_count < _num} do { + _name = _prilist call BIS_fnc_selectRandom; + _garrison = server getVariable format["vehgarrison%1",_name]; + _garrison pushback _type; + _count = _count + 1; + server setVariable [format ["vehgarrison%1",_name],_garrison,true]; + }; + }foreach(OT_NATO_Vehicles_Garrison); + + //Weighted airport list to distribute air vehicles + _prilist = []; + { + _x params ["_pos","_name","_worth"]; + _prilist pushback _name; + if(_worth > 500) then { + _prilist pushback _name; + }; + if(_worth > 800) then { + _prilist pushback _name; + }; + if(_worth > 1000) then { + _prilist pushback _name; + }; + }foreach(OT_airportData); + + { + _type = _x select 0; + _num = _x select 1; + _count = 0; + while {_count < _num} do { + _name = _prilist call BIS_fnc_selectRandom; + _garrison = server getVariable [format["airgarrison%1",_name],[]]; + _garrison pushback _type; + _count = _count + 1; + server setVariable [format ["airgarrison%1",_name],_garrison,true]; + }; + }foreach(OT_NATO_Vehicles_AirGarrison); + + + diag_log "Overthrow: Setting up NATO checkpoints"; + { + _garrison = floor(8 + random(6)); + if(_x in OT_NATO_priority) then { + _garrison = floor(12 + random(6)); + }; + + //_x setMarkerText format ["%1",_garrison]; + _x setMarkerAlpha 0; + server setVariable [format ["garrison%1",_x],_garrison,true]; + }foreach (OT_NATO_control); + + diag_log "Overthrow: Garrisoning towns"; + { + _town = _x; + _garrison = 0; + _stability = server getVariable format ["stability%1",_town]; + _population = server getVariable format ["population%1",_town]; + if(_stability > 10) then { + _max = round(_population / 30); + if(_max < 4) then {_max = 4}; + _garrison = 2+round((1-(_stability / 100)) * _max); + if(_town in OT_NATO_priority) then { + _garrison = round(_garrison * 2); + }; + }; + server setVariable [format ["garrison%1",_x],_garrison,true]; + }foreach (OT_allTowns); +}; +diag_log "Overthrow: NATO Init Done"; + +OT_NATOInitDone = true; +publicVariable "OT_NATOInitDone"; + +{ + _pos = _x select 0; + _name = _x select 1; + _mrk = createMarker [_name,[_pos,25,270] call BIS_fnc_relPos]; + _mrk setMarkerShape "ICON"; + if(_name in (server getVariable "NATOabandoned")) then { + _mrk setMarkerType "flag_Tanoa"; + }else{ + _mrk setMarkerType "flag_NATO"; + }; + + server setVariable [_name,_pos,true]; + + OT_allObjectives pushback _name; +}foreach(OT_NATOobjectives); + +publicVariable "OT_allObjectives"; + +{ + _pos = _x select 0; + _name = _x select 1; + _mrk = createMarker [_name,_pos]; + _mrk setMarkerShape "ICON"; + _mrk setMarkerType "loc_Transmitter"; + if(_name in (server getVariable "NATOabandoned")) then { + _mrk setMarkerColor "ColorGUER"; + }else{ + _mrk setMarkerColor "ColorBLUFOR"; + }; + server setVariable [_name,_pos,true]; + OT_allComms pushback _name; + OT_allObjectives pushback _name; +}foreach(OT_NATOcomms); diff --git a/mod.cpp b/mod.cpp index 6d6f8261..da91e083 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,10 +1,10 @@ -name = "Overthrow 0.7.3"; //This name will be displayed only in game , specifically the expansion menu +name = "Overthrow 0.7.4"; //This name will be displayed only in game , specifically the expansion menu picture = "logo_overthrow.paa"; //Location of your addon's icon logo = "logo_overthrow.paa"; logoOver = "logo_overthrow.paa"; actionName = "Github"; //The name of the action action = "https://github.com/armazac/Overthrow.Tanoa"; //The action , "Authors Website Link" -description = "Overthrow - Version 0.7.3"; // Addon Description +description = "Overthrow - Version 0.7.4"; // Addon Description overview = "A Revolution Simulator for Arma 3"; author = "ARMAzac"; overviewPicture = "logo_overthrow.paa"; From 17ff24a220c6f1f809952f1399fd0ebd30254a35 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 8 May 2017 03:06:28 +1000 Subject: [PATCH 03/16] new and faster method of owner tracking --- addons/overthrow_main/CfgFunctions.hpp | 2 + .../AI/fn_NATOMissionReconDestroy.sqf | 130 +++++++++++++ .../AI/fn_NATOSetExplosives.sqf | 38 ++++ .../missions/Overthrow.Tanoa/UI/buildMenu.sqf | 4 +- .../Overthrow.Tanoa/UI/fn_vehicleDialog.sqf | 2 +- .../missions/Overthrow.Tanoa/UI/mainMenu.sqf | 28 +-- .../Overthrow.Tanoa/actions/leaseBuilding.sqf | 3 +- .../Overthrow.Tanoa/actions/placementMode.sqf | 4 +- .../actions/recruitSoldier.sqf | 2 +- .../Overthrow.Tanoa/actions/recruitSquad.sqf | 2 +- .../Overthrow.Tanoa/actions/setHome.sqf | 7 +- .../Overthrow.Tanoa/data/objectives.sqf | 3 +- .../events/buildingDamaged.sqf | 3 + .../events/playerDisconnect.sqf | 2 +- .../Overthrow.Tanoa/factions/GUER.sqf | 10 +- .../Overthrow.Tanoa/factions/NATO.sqf | 178 +++++++++++++++++- .../Overthrow.Tanoa/initEconomyLoad.sqf | 2 +- .../missions/Overthrow.Tanoa/initFuncs.sqf | 61 +++++- .../Overthrow.Tanoa/initPlayerLocal.sqf | 60 +++--- .../missions/Overthrow.Tanoa/initServer.sqf | 2 + .../missions/Overthrow.Tanoa/initVar.sqf | 25 +-- .../missions/Overthrow.Tanoa/mission.sqm | 12 +- .../Overthrow.Tanoa/onPlayerRespawn.sqf | 2 +- .../Overthrow.Tanoa/spawners/gunDealer.sqf | 2 +- .../functions/AI/NPC/fn_initCarDealer.sqf | 6 +- .../functions/AI/NPC/fn_initGunDealer.sqf | 4 +- .../functions/AI/NPC/fn_initHarbor.sqf | 4 +- .../functions/AI/NPC/fn_initMobBoss.sqf | 17 +- .../functions/AI/NPC/fn_initPriest.sqf | 6 +- .../functions/AI/NPC/fn_initShopkeeper.sqf | 6 +- .../functions/UI/fn_notifyVehicle.sqf | 2 +- .../functions/actions/fn_buy.sqf | 12 +- .../functions/actions/fn_buyBuilding.sqf | 13 +- .../functions/actions/fn_recruitCiv.sqf | 2 +- .../functions/events/fn_preInit.sqf | 9 + .../factions/NATO/fn_NATOSupportSniper.sqf | 2 +- .../functions/factions/NATO/fn_initNATO.sqf | 32 +--- .../overthrow_main/functions/fn_canPlace.sqf | 3 +- .../overthrow_main/functions/fn_getOwner.sqf | 8 + .../overthrow_main/functions/fn_hasOwner.sqf | 2 +- .../overthrow_main/functions/fn_loadGame.sqf | 14 +- .../overthrow_main/functions/fn_saveGame.sqf | 4 +- .../overthrow_main/functions/fn_setOwner.sqf | 9 + addons/overthrow_main/ui/dialogs/main.hpp | 2 +- 44 files changed, 560 insertions(+), 181 deletions(-) create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf create mode 100644 addons/overthrow_main/functions/fn_getOwner.sqf create mode 100644 addons/overthrow_main/functions/fn_setOwner.sqf diff --git a/addons/overthrow_main/CfgFunctions.hpp b/addons/overthrow_main/CfgFunctions.hpp index 203c52dd..4a74cd89 100644 --- a/addons/overthrow_main/CfgFunctions.hpp +++ b/addons/overthrow_main/CfgFunctions.hpp @@ -14,6 +14,8 @@ class CfgFunctions class unitStock {}; class saveGame {}; class loadGame {}; + class setOwner {}; + class getOwner {}; }; class Events diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf new file mode 100644 index 00000000..9afa3a4f --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf @@ -0,0 +1,130 @@ +params ["_knownPos"]; + +private _posTarget = _knownPos; +private _close = nil; +private _dist = 4000; +private _closest = ""; +private _abandoned = server getVariable["NATOabandoned",[]]; +{ + _pos = _x select 0; + _name = _x select 1; + if(([_pos,_knownPos] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then { + _d = (_pos distance _knownPos); + if(_d < _dist) then { + _dist = _d; + _close = _pos; + _closest = _name; + }; + }; +}foreach(OT_NATOobjectives); +_isHQ = false; +if(isNil "_close") then { + _isHQ = true; + _close = OT_NATO_HQPos; +}; +_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; +_group = [_start, WEST, OT_NATO_Group_Recon] call BIS_fnc_spawnGroup; +_group call distributeAILoad; +sleep 0.5; + +_dir = [_start,_posTarget] call BIS_fnc_dirTo; + +if(_isHQ) then { + _attackpos = [_posTarget,[0,150]] call SHK_pos; + + //Determine direction to attack from (preferrably away from water) + _attackdir = random 360; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 180; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 90; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 180; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + }; + }; + }; + _attackdir = _attackdir - 45; + _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos; + _tgroup = creategroup blufor; + + _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; + _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos; + _veh setDir _dir; + _tgroup addVehicle _veh; + + _tgroup call distributeAILoad; + + createVehicleCrew _veh; + { + [_x] joinSilent _tgroup; + _x setVariable ["garrison","HQ",false]; + _x setVariable ["NOAI",true,false]; + }foreach(crew _veh); + + { + _x moveInCargo _veh; + _x setVariable ["garrison","HQ",false]; + }foreach(units _group); + + sleep 2; + + _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointCompletionRadius 150; + _wp setWaypointStatements ["true","(vehicle this) flyInHeight 100;"]; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"]; + _wp setWaypointCompletionRadius 50; + _wp setWaypointSpeed "FULL"; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","[vehicle this,75] spawn OT_fnc_parachuteAll"]; + _wp setWaypointTimeout [10,10,10]; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; + _wp setWaypointTimeout [15,15,15]; + + _moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; + + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "LOITER"; + _wp setWaypointBehaviour "CARELESS"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointCompletionRadius 100; + + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"]; + + { + _x addCuratorEditableObjects [units _tgroup,true]; + } forEach allCurators; +}; +{ + _x addCuratorEditableObjects [units _group,true]; +} forEach allCurators; +sleep 2; + +//This squad operates in stealth mode, therefore does not respond to calls for help from other units +{ + _x setVariable ["VCOM_NOPATHING_Unit",true,false]; + _x setVariable ["OT_targetPos",_knownPos,true]; +}foreach(units _group); + +_wp = _group addWaypoint [_posTarget,0]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "COMBAT"; +_wp setWaypointSpeed "FULL"; +_wp setWaypointStatements ["true","this spawn OT_fnc_NATOSetExplosives"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf new file mode 100644 index 00000000..fa1852f9 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf @@ -0,0 +1,38 @@ +_leader = _this; + +_group = group _leader; +private _targetPos = _leader getVariable ["OT_targetPos",objNull]; + +_gotexp = false; +_expert = objNull; +{ + if("DemoCharge_Remote_Mag" in magazines _x) then { + _gotexp = true; + _expert = _x; + }; +}foreach(units _group); + +if(_gotexp) then { + _p = _targetPos; + _expert setVariable ["NOAI",true,true]; + _group setCombatMode "COMBAT"; + _expert commandMove _p; + waitUntil {sleep 1;(!alive _expert) or (_expert distance _target) < 10}; + if(alive _expert) then { + _expert removeMagazineGlobal "DemoCharge_Remote_Mag"; + _p set [2,1]; + _charge = createVehicle ["DemoCharge_Remote_Ammo", _p, [], 0,""]; + _charge enableSimulationGlobal true; + + //run away! + _runto = [_p,[1000,2000],random 360] call SHK_pos; + _wp = _group addWaypoint [_runto,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + _expert setVariable ["NOAI",false,true]; + + sleep 120; + [[_charge], 0] call ace_explosives_fnc_scriptedExplosive; + }; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf index bcb26ecc..fa5118cc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf @@ -283,14 +283,14 @@ buildOnMouseUp = { clearMagazineCargoGlobal _x; clearBackpackCargoGlobal _x; clearItemCargoGlobal _x; - _x setVariable ["owner",getplayeruid player,true]; + [_x,getplayeruid player] call OT_fnc_setOwner; _x call initObjectLocal; }foreach(_objects); _created = _objects select 0; deleteVehicle modeTarget; }else{ _created = modeTarget; - modeTarget setVariable ["owner",getplayeruid player,true]; + [modeTarget,getplayeruid player] call OT_fnc_setOwner; modeTarget enableSimulationGlobal true; modeTarget = objNull; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf index 8b8bbece..6caf57cf 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf @@ -3,7 +3,7 @@ private _veh = vehicle player; private _isgen = call OT_fnc_playerIsGeneral; -if((_veh getVariable ["owner",""]) != (getplayeruid player)) then { +if !(_veh call OT_fnc_playerIsOwner) then { ctrlEnable [1605,false]; }else{ if(_veh getVariable ["OT_locked",false]) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf index ab9a05d7..19119d9f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf @@ -10,7 +10,7 @@ _buildingtextctrl = (findDisplay 8001) displayCtrl 1102; private _donerem = false; if !(isNull cursorObject) then { if((player distance cursorObject) < 20) then { - if (cursorObject in (entities "")) then { + if (cursorObject in ((allMissionObjects "Static") + vehicles)) then { if !((cursorObject isKindOf "CAManBase") or (side cursorObject) == west) then { call { if(((cursorObject isKindOf "Land") or (cursorObject isKindOf "Air")) and ("ToolKit" in (items player)) and (damage cursorObject) == 1) exitWith { @@ -26,7 +26,7 @@ if !(isNull cursorObject) then { ctrlEnable [1614,false]; }; }; - if((call OT_fnc_playerIsGeneral) or (cursorObject getVariable ["owner",""]) == (getplayeruid player)) exitWith { + if((call OT_fnc_playerIsGeneral) or (cursorObject call OT_fnc_playerIsOwner)) exitWith { _donerem = true; private _type = typeof cursorObject; _pic = getText(configfile >> "CfgVehicles" >> _type >> "editorPreview"); @@ -109,13 +109,17 @@ if(typename _b == "ARRAY") then { _txt = ""; if(_building call OT_fnc_hasOwner) then { - _owner = _building getVariable "owner"; + + _owner = _building call OT_fnc_getOwner; _ownername = server getVariable format["name%1",_owner]; if(isNil "_ownername") then {_ownername = "Someone"}; - if(_building getVariable ["leased",false]) then { - _ownername = format["%1 (Leased)",_ownername]; - }; if(_owner == getplayerUID player) then { + _leased = player getVariable ["leased",[]]; + _id = [_building] call OT_fnc_getBuildID; + if(_id in _leased) then { + _ownername = format["%1 (Leased)",_ownername]; + }; + if(typeof _building == OT_item_Tent) exitWith { ctrlSetText [1608,"Sell"]; ctrlEnable [1608,false]; @@ -151,13 +155,9 @@ if(typename _b == "ARRAY") then { ",_ownername]; }; - if(_building getVariable ["leased",false] or !((typeof _building) in OT_allRealEstate)) then { + if(_id in _leased) then { ctrlEnable [1609,false]; ctrlEnable [1610,false]; - if !((typeof _building) in OT_allRealEstate) then { - _lease = 0; - ctrlSetText [1608,"Remove"]; - }; }; _buildingTxt = format[" %1
@@ -181,7 +181,7 @@ if(typename _b == "ARRAY") then { ",_name,_ownername]; }; if(typeof _building == OT_barracks) then { - _owner = _building getVariable "owner"; + _owner = _building call OT_fnc_getOwner; _ownername = server getVariable format["name%1",_owner]; ctrlSetText [1608,"Sell"]; ctrlEnable [1608,false]; @@ -226,7 +226,7 @@ if(typename _b == "ARRAY") then { }; if(typeof _building == OT_policeStation) then { - _owner = _building getVariable "owner"; + _owner = _building call OT_fnc_getOwner; _ownername = server getVariable format["name%1",_owner]; ctrlSetText [1608,"Sell"]; ctrlEnable [1608,false]; @@ -241,7 +241,7 @@ if(typename _b == "ARRAY") then { }; if(typeof _building == "Land_Cargo_House_V4_F") then { - _owner = _building getVariable "owner"; + _owner = _building call OT_fnc_getOwner; _ownername = server getVariable format["name%1",_owner]; ctrlSetText [1608,"Sell"]; ctrlEnable [1608,false]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf index 85a74a01..ed3ab54b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf @@ -29,7 +29,7 @@ if(typename _b == "ARRAY") then { if !(_building call OT_fnc_hasOwner) then { _handled = true; }else{ - _owner = _building getVariable "owner"; + _owner = _building call OT_fnc_getOwner; if(_owner == getplayeruid player) then { _home = player getVariable "home"; if((_home distance _building) < 5) exitWith {"You cannot lease your home" call OT_fnc_notifyMinor;_err = true}; @@ -48,7 +48,6 @@ if(_handled) then { _leasedata pushback [_id,typeof _building,getpos _building,(getpos _building) call OT_fnc_nearestTown]; player setvariable ["leasedata",_leasedata,true]; - _building setVariable ["leased",true,true]; _mrkid = format["bdg-%1",_building]; _mrkid setMarkerAlphaLocal 0.3; playSound "3DEN_notificationDefault"; 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 c26dc2cd..a918bfd8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -161,7 +161,7 @@ if(_cost > 0) then { }else{ [modeTarget,false] remoteExec ["enableSimulationGlobal",2]; }; - modeTarget setVariable ["owner",getPlayerUID player,true]; + [modeTarget,getPlayerUID player] call OT_fnc_setOwner; modeTarget remoteExec["initObjectLocal",0,modeTarget]; if(_typecls == "Base" or _typecls == "Camp") then { _veh = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"]; @@ -214,7 +214,7 @@ if(_cost > 0) then { if(count _camp > 0) then { { _t = typeof _x; - if(_x getVariable ["owner",""] == getplayeruid player) then { + if((_x call OT_fnc_getOwner) == getplayeruid player) then { if(_t == OT_item_Tent or _t == "Land_ClutterCutter_large_F") then { deleteVehicle _x; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf index ac973150..c1581920 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf @@ -14,6 +14,6 @@ if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMin private _civ = [_soldier,_pos,_group] call OT_fnc_createSoldier; -_civ setVariable ["owner",getplayeruid player,true]; +[_civ,getPlayerUID player] call OT_fnc_setOwner; [_civ] spawn OT_fnc_initRecruit; _civ setRank "SERGEANT"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf index d3ac1d50..4ad33db5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf @@ -32,7 +32,7 @@ _leader = false; { _civ = [_x,_pos,_group] call OT_fnc_createSoldier; player reveal [_civ,4]; - if(!_leader) then {_group selectLeader _civ;_civ setVariable ["owner",getplayeruid player,true],_leader=true}; + if(!_leader) then {_group selectLeader _civ;[_civ,getPlayerUID player] call OT_fnc_setOwner,_leader=true}; }foreach(_soldiers); _group setGroupIdGlobal [format["%1-%2",_shortname,_cc]]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf index 2cfc8ba9..995cad51 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf @@ -4,7 +4,7 @@ _buildings = (getpos player) nearObjects 15; _handled = false; _building = objNULL; { - _owner = _x getVariable "owner"; + _owner = _x call OT_fnc_getOwner; if(!isNil "_owner") then { if ((typeof _x) in OT_allBuyableBuildings and _owner == getplayerUID player) exitWith { _handled = true; @@ -12,10 +12,9 @@ _building = objNULL; "This is now your home" call OT_fnc_notifyMinor; }; }; - + }foreach(_buildings); -if !(_handled) then { +if !(_handled) then { "You don't own any buildings nearby" call OT_fnc_notifyMinor; }; - diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf index b86e28f1..a2394de4 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf @@ -5,7 +5,8 @@ OT_objectiveData = [ [[3432.65,12893.3,0],"The Firing Range",250], [[3870.23,13412.4,0],"The Vehicle Range",300], [[3939.27,13915,0],"The Camp Remnants",250], - [[3166.18,11038.8,0],"Belfort Naval Base",500] + [[3166.18,11038.8,0],"Belfort Naval Base",500], + [[5216.9,3656.3,0],"Chemical Plant",600] ]; OT_NATOregion = "island_5"; OT_NATO_HQ = "Tuvanaka Airbase"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf new file mode 100644 index 00000000..a5b6a7a9 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf @@ -0,0 +1,3 @@ +params ["_obj","_sel","_dmg"]; + +player globalchat format ["damage %1 %2 %3",_obj,_sel,_dmg]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf index 9f082aa4..afca2ccd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf @@ -18,7 +18,7 @@ if(_me getVariable ["ACE_isUnconscious",false]) then { _data = []; { - if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then { + if(_x != "ot_loaded" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then { _data pushback [_x,_me getVariable _x]; }; }foreach(allVariables _me); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index 131e90b5..a64eee24 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -77,7 +77,7 @@ while {true} do { if(_container isEqualTo objNull) then { _p = _pos findEmptyPosition [0,100,OT_item_CargoContainer]; _container = OT_item_CargoContainer createVehicle _p; - _container setVariable ["owner",(server getVariable ["generals",[]]) select 0,true]; + [_container,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner; clearWeaponCargoGlobal _container; clearMagazineCargoGlobal _container; clearBackpackCargoGlobal _container; @@ -110,7 +110,7 @@ while {true} do { if(_container isEqualTo objNull) then { _p = _pos findEmptyPosition [0,100,OT_item_CargoContainer]; _container = OT_item_CargoContainer createVehicle _p; - _container setVariable ["owner",(server getVariable ["generals",[]]) select 0,true]; + [_container,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner; clearWeaponCargoGlobal _container; clearMagazineCargoGlobal _container; clearBackpackCargoGlobal _container; @@ -215,7 +215,7 @@ while {true} do { _p = OT_factoryPos findEmptyPosition [0,100,OT_item_CargoContainer]; if(count _p > 0) then { _veh = OT_item_CargoContainer createVehicle _p; - _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true]; + [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; @@ -245,7 +245,7 @@ while {true} do { _p = OT_factoryVehicleSpawn findEmptyPosition [0,100,_currentCls]; if(count _p > 0) then { _veh = _currentCls createVehicle _p; - _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true]; + [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; @@ -261,7 +261,7 @@ while {true} do { if(_veh isEqualTo objNull) then { _p = OT_factoryPos findEmptyPosition [0,100,OT_item_CargoContainer]; _veh = OT_item_CargoContainer createVehicle _p; - _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true]; + [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; 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 ff6c0d47..5d8d169d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -10,14 +10,51 @@ private _count = 0; server setVariable ["NATOattacking","",true]; server setVariable ["NATOattackstart",0,true]; +private _lastmin = date select 4; +private _lastsched = -1; + while {sleep 10;true} do { private _numplayers = count([] call CBA_fnc_players); if(_numplayers > 0) then { _abandoned = server getVariable ["NATOabandoned",[]]; - _resources = server getVariable ["NATOresources",0]; + _resources = server getVariable ["NATOresources",2000]; private _countered = (server getVariable ["NATOattacking",""]) != ""; - //Objective QRF + _knownTargets = spawner getVariable ["NATOknownTargets",[]]; + + _schedule = server getVariable ["NATOschedule",[]]; + + //scheduler + + if(_lastmin != (date select 4)) then { + private _lastmin = date select 4; + if(count _schedule > 0) then { + _item = []; + if((_lastsched == -1 or _lastsched == 0) and _lastmin >= 30) then { + _lastsched = 30; + _item = _schedule select 0; + }else{ + if((_lastsched == -1 or _lastsched == 30) and _lastmin < 30) then { + _lastsched = 0; + _item = _schedule select 0; + }; + }; + if(count _item > 0) then { + _schedule deleteAt 0; + _item params ["_mission","_ty","_pos"]; + if(_mission == "DESTROY") then { + [_pos] spawn OT_fnc_NATOMissionReconDestroy; + }; + }; + if(_lastmin == 0 or _lastmin == 30) then { + _item = _schedule select 0; + + }; + }; + }; + + + //Objective QRF and drone intel reports if !(_countered) then { { _x params ["_pos","_name","_cost"]; @@ -36,9 +73,31 @@ while {sleep 10;true} do { _resources = _resources - _cost; }; }; + //Drone intel report + _drone = spawner getVariable [format["drone%1",_name],objNull]; + if((!isNull _drone) and alive _drone) then { + _intel = _drone getVariable ["OT_seenTargets",[]]; + { + _added = false; + _x params ["_ty","_pos","_pri","_obj"]; + _rem = []; + { + _o = _x select 3; + if (_o isEqualTo _obj) then { + _added = true; + }; + }foreach(_knownTargets); + + if !(_added) then { + _knownTargets pushback [_ty,_pos,_pri,_obj,false]; + }; + }foreach(_intel); + _drone setVariable ["OT_seenTargets",[]]; + }; }; if(_countered) exitWith {}; }foreach(OT_NATOobjectives); + player globalchat format ["%1",_knownTargets]; }; //Town QRF (over 50 pop) @@ -71,6 +130,7 @@ while {sleep 10;true} do { if(_count >= _nextturn and !_countered) then { + _resourceGain = server getVariable ["NATOresourceGain",0]; _abandonedSomething = false; //NATO turn _nextturn = OT_NATOwait + random OT_NATOwait; @@ -124,11 +184,125 @@ while {sleep 10;true} do { }; //Recover resources + _resources = _resources + _resourceGain + ((count _abandoned) * 25); + + //Spawn missing drones + { + _x params ["_pos","_name"]; + if !(_name in _abandoned) then { + _drone = spawner getVariable [format["drone%1",_name],objNull]; + if(isNull _drone or !alive _drone) then { + _targets = []; + { + _town = _x; + _p = server getVariable _town; + if((_p distance _pos) < 3000) then { + _stability = server getVariable format["stability%1",_town]; + if((_town in _abandoned) or (_stability < 50)) then { + _targets pushback _p; + }; + }; + }foreach(OT_allTowns); + + { + _x params ["_p","_name"]; + if((_p distance _pos) < 3000) then { + if (_name in _abandoned) then { + _targets pushback _p; + }; + }; + }foreach(OT_NATOobjectives + OT_NATOcomms); + + { + _x params ["_ty","_p"]; + if((_ty == "FOB") and (_p distance _pos) < 3000) then { + _targets pushback _p; + }; + }foreach(_knownTargets); + + if(count _targets > 0) then { + _targets = [_targets,[],{random 100},"ASCEND"] call BIS_fnc_sortBy; + _group = createGroup blufor; + _p = [_pos,0,0,false,[0,0],[100,OT_NATO_Vehicles_ReconDrone]] call SHK_pos; + _drone = createVehicle [OT_NATO_Vehicles_ReconDrone, _p, [], 0,""]; + + createVehicleCrew _drone; + { + [_x] joinSilent _group; + }foreach(crew _drone); + + + spawner setVariable [format["drone%1",_name],_drone,false]; + _resources = _resources - 10; + + { + _wp = _group addWaypoint [_x,300]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointTimeout [20,45,60]; + }foreach(_targets); + + _wp = _group addWaypoint [_pos,300]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointTimeout [10,20,60]; + + _wp = _group addWaypoint [_pos,0]; + _wp setWaypointType "CYCLE"; + + { + _x addCuratorEditableObjects [[_drone]]; + }foreach(allCurators); + + _drone spawn OT_fnc_initDrone; + }; + }; + }; + if(_resources <= 0) exitWith {_resources = 0}; + }foreach(OT_NATOobjectives + OT_NATOcomms); + + //Decide on spend + _spend = 0; + if(_resources > 500) then { + _spend = 500; + }; + if(_resources > 1000) then { + _spend = 800; + }; + if(_resources > 1500) then { + _spend = 1200; + }; + + //Schedule some missions + if(_spend > 0) then { + _targets = [_knownTargets,[],{_x select 2},"DESCEND"] call BIS_fnc_sortBy; + { + _x params ["_ty","_pos","_pri","_obj","_done"]; + if !(_done) then { + if(_ty == "WH" or _ty == "PS" or _ty == "WS") then { + if(_spend > 250) then { + player globalchat "Scheduled Destroy Mission"; + _schedule pushback ["DESTROY",_ty,_pos]; + _spend = _spend - 250; + _resources = _resources -250; + _x set [4,true]; + }; + }; + }; + }foreach(_targets); + }; + + }; //Finish if(_resources > 2500) then {_resources = 2500}; server setVariable ["NATOresources",_resources,true]; server setVariable ["NATOabandoned",_abandoned,true]; + spawner setVariable ["NATOknownTargets",_knownTargets,true]; + server setVariable ["NATOschedule",_schedule,true]; + hint str _resources; }; _count = _count + 1; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf index d9ce1313..ce68c740 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf @@ -33,7 +33,7 @@ if((server getVariable ["EconomyVersion",0]) < OT_economyVersion) then { _pos = [[[getpos _building,50]]] call BIS_fnc_randomPos; }; server setVariable [format["factionrep%1",_cls],_pos,true]; - _building setVariable ["owner","system",true]; + [_building,"system"] call OT_fnc_setOwner; }; }foreach(OT_allFactions); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 570d6b52..92cc3054 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -16,6 +16,8 @@ doConversation = compileFinal preProcessFileLineNumbers "funcs\doConversation.sq playerDecision = compileFinal preProcessFileLineNumbers "funcs\playerDecision.sqf"; OT_fnc_NATOConvoy = compileFinal preProcessFileLineNumbers "AI\fn_NATOConvoy.sqf"; +OT_fnc_NATOMissionReconDestroy = compileFinal preProcessFileLineNumbers "AI\fn_NATOMissionReconDestroy.sqf"; +OT_fnc_NATOSetExplosives = compileFinal preProcessFileLineNumbers "AI\fn_NATOSetExplosives.sqf"; //UI mainMenu = compileFinal preProcessFileLineNumbers "UI\mainMenu.sqf"; @@ -92,6 +94,57 @@ keyHandler = compileFinal preProcessFileLineNumbers "keyHandler.sqf"; menuHandler = {}; fnc_getBuildID = compileFinal preProcessFileLineNumbers "funcs\fnc_getBuildID.sqf"; +OT_fnc_getBuildID = fnc_getBuildID; + +OT_fnc_initDrone = { + _drone = _this; + + _drone spawn { + _drone = _this; + _targets = []; + while {sleep 10; alive _drone} do { + { + _ty = typeof _x; + if((damage _x) < 1) then { + call { + if((_x isKindOf "StaticWeapon") and (side _x != west)) exitWith { + if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then { + _targets pushback ["SW",position _x,100,_x]; + }; + }; + if(_ty == OT_item_Flag) exitWith { + _targets pushback ["FOB",position _x,0,_x]; + }; + if(_ty == OT_warehouse) exitWith { + if(_x call OT_fnc_hasOwner) then { + _targets pushback ["WH",position _x,80,_x]; + }; + }; + if(_ty == OT_policeStation) exitWith { + _targets pushback ["PS",position _x,90,_x]; + }; + if(_ty == OT_workshopBuilding) exitWith { + _targets pushback ["WS",position _x,50,_x]; + }; + if(((_x isKindOf "Car") or (_x isKindOf "Air") or (_x isKindOf "Ship")) and !(_ty in (OT_allVehicles+OT_allBoats+OT_helis))) exitWith { + if !(side _x == west) then { + if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then { + _targets pushback ["V",position _x,0,_x]; + }; + }; + }; + if(_ty == OT_item_Storage) exitWith { + if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then { + _targets pushback ["AMMO",position _x,25,_x]; + }; + }; + }; + }; + }foreach((_drone nearObjects ["Static",500]) + (_drone nearObjects ["AllVehicles",500])); + _drone setVariable ["OT_seenTargets",_targets,false]; + }; + }; +}; OT_fnc_generateBanditPositions = { _num = 10; @@ -143,7 +196,7 @@ OT_fnc_generateBanditPositions = { }; OT_fnc_playerIsOwner = { - (_this getVariable ["owner",""]) == (getplayeruid player) + (_this call OT_fnc_getOwner) == (getplayeruid player) }; OT_fnc_playerAtWarehouse = { @@ -160,7 +213,7 @@ OT_fnc_playerAtWarehouse = { OT_fnc_lockVehicle = { private _veh = vehicle player; - if((_veh getVariable ["owner",""]) != (getplayeruid player)) exitWith {}; + if((_veh call OT_fnc_getOwner) != (getplayeruid player)) exitWith {}; if(_veh getVariable ["OT_locked",false]) then { _veh setVariable ["OT_locked",false,true]; "Vehicle unlocked" call OT_fnc_notifyMinor; @@ -220,10 +273,10 @@ OT_fnc_regionIsConnected = { }; OT_fnc_getRegion = { - _pos = _this; + _p = _this; _region = ""; { - if(_pos inArea _x) exitWith {_region = _x}; + if(_p inArea _x) exitWith {_region = _x}; }foreach(OT_regions); _region; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 431e6fd3..58dfeb4f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -124,38 +124,22 @@ if(isMultiplayer or _startup == "LOAD") then { _mrkName setMarkerAlphaLocal 1; }; if(_x in _leased) then { - _bdg setVariable ["leased",true,true]; + _mrkName setMarkerAlphaLocal 0.3; }; _nowowned pushback ([_bdg] call fnc_getBuildID); }; }else{ //new save with IDs if (typename _x == "SCALAR") then { - _bdg = OT_centerPos nearestObject _x; - if !(isNil "_bdg") then { - _mrkName = format["bdg-%1",_bdg]; - if(_bdg isKindOf "Building") then { - if(typeof _bdg == OT_warehouse) then { - _mrkName = createMarker [_mrkName,getpos _bdg]; - _mrkName setMarkerShape "ICON"; - _mrkName setMarkerColor "ColorWhite"; - _mrkName setMarkerType "OT_warehouse"; - _mrkName setMarkerAlpha 1; - }else{ - if(typeof _bdg != OT_policeStation) then { - _mrkName = createMarkerLocal [_mrkName,getpos _bdg]; - _mrkName setMarkerShape "ICON"; - _mrkName setMarkerType "loc_Tourism"; - _mrkName setMarkerColor "ColorWhite"; - _mrkName setMarkerAlpha 0; - _mrkName setMarkerAlphaLocal 1; - }; - }; - }; - if(_x in _leased) then { - _bdg setVariable ["leased",true,true]; - _mrkName setMarkerAlphaLocal 0.3; - }; + _mrkName = format["bdg-%1",_x]; + _mrkName = createMarkerLocal [_mrkName,getpos _bdg]; + _mrkName setMarkerShape "ICON"; + _mrkName setMarkerType "loc_Tourism"; + _mrkName setMarkerColor "ColorWhite"; + _mrkName setMarkerAlpha 0; + _mrkName setMarkerAlphaLocal 1; + if(_x in _leased) then { + _mrkName setMarkerAlphaLocal 0.3; }; }; }; @@ -167,7 +151,7 @@ if(isMultiplayer or _startup == "LOAD") then { { if(_x call OT_fnc_hasOwner) then { - if ((_x getVariable "owner" == getPlayerUID player) and !(_x isKindOf "LandVehicle") and !(_x isKindOf "Building")) then { + if ((_x call OT_fnc_playerIsOwner) and !(_x isKindOf "LandVehicle") and !(_x isKindOf "Building")) then { _furniture pushback _x }; }; @@ -187,7 +171,7 @@ if(isMultiplayer or _startup == "LOAD") then { if(_owner == (getplayeruid player)) then { if(typename _civ == "ARRAY") then { _civ = group player createUnit [_type,_civ,[],0,"NONE"]; - _civ setVariable ["owner",getplayeruid player,true]; + [_civ,getplayeruid player] call OT_fnc_setOwner; _civ setVariable ["OT_xp",_xp,true]; _civ setVariable ["NOAI",true,true]; _civ setRank _rank; @@ -202,7 +186,7 @@ if(isMultiplayer or _startup == "LOAD") then { commandStop _civ; }else{ - if((_civ getVariable "owner") == (getplayeruid player)) then { + if((_civ call OT_fnc_playerIsOwner) then { [_civ] joinSilent (group player); }; }; @@ -260,7 +244,7 @@ if (_newplayer) then { _money = 0; }; player setVariable ["money",_money,true]; - player setVariable ["owner",getplayerUID player,true]; + [player,getplayeruid player] call OT_fnc_setOwner; if(!isMultiplayer) then { { if(_x != player) then { @@ -296,7 +280,7 @@ if (_newplayer) then { _light setLightAmbient[.9, .9, .6]; _light setLightColor[.5, .5, .4]; - _house setVariable ["owner",getPlayerUID player,true]; + [_house,getplayeruid player] call OT_fnc_setOwner; player setVariable ["home",_housepos,true]; _furniture = (_house call OT_fnc_spawnTemplate) select 0; @@ -310,7 +294,7 @@ if (_newplayer) then { _x addBackpackCargoGlobal ["B_AssaultPack_khk", 1]; _x addItemCargoGlobal ["NVGoggles_INDEP", 1]; }; - _x setVariable ["owner",getplayerUID player,true]; + [_x,getplayeruid player] call OT_fnc_setOwner; }foreach(_furniture); player setVariable ["owned",[[_house] call fnc_getBuildID],true]; @@ -358,17 +342,17 @@ player addEventHandler ["WeaponAssembled",{ }; }; if(isplayer _me) then { - _wpn setVariable ["owner",getplayeruid _me,true]; + [_wpn,getplayeruid player] call OT_fnc_setOwner; }; }]; player addEventHandler ["InventoryOpened", { _veh = _this select 1; _ret = false; - if((_veh getVariable ["owner",""]) != (getplayeruid player)) then { + if((_veh call OT_fnc_getOwner) != (getplayeruid player)) then { if(_veh getVariable ["OT_locked",false]) then { _ret = true; - format["This inventory has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call OT_fnc_notifyMinor; + format["This inventory has been locked by %1",server getVariable "name"+(_veh call OT_fnc_getOwner)] call OT_fnc_notifyMinor; }; }; _ret; @@ -385,14 +369,14 @@ player addEventHandler ["GetInMan",{ if(_position == "driver") then { if !(_veh call OT_fnc_hasOwner) then { - _veh setVariable ["owner",getplayeruid player,true]; + [_veh,getplayeruid player] call OT_fnc_setOwner; _veh setVariable ["stolen",true,true]; [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing; }else{ - if((_veh getVariable ["owner",""]) != (getplayeruid player)) then { + if !(_veh call OT_fnc_playerIsOwner) then { if(!_isgen and (_veh getVariable ["OT_locked",false])) then { moveOut player; - format["This vehicle has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call OT_fnc_notifyMinor; + format["This vehicle has been locked by %1",server getVariable "name"+(_veh call OT_fnc_getOwner)] call OT_fnc_notifyMinor; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf index 0aa1fac0..9a9e558b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf @@ -1,6 +1,8 @@ [] execVM "income.sqf"; addMissionEventHandler ["EntityKilled",compileFinal preprocessFileLineNumbers "events\somethingDied.sqf"]; +["Building", "Dammaged", compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf"] call CBA_fnc_addClassEventHandler; + if (!isMultiplayer) exitWith {}; //Advanced towing script, credits to Duda http://www.armaholic.com/page.php?id=30575 diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 54c807ec..985198cb 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -27,7 +27,7 @@ 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 = 12; -OT_NATOversion = 7; +OT_NATOversion = 8; OT_CRIMversion = 1; OT_adminMode = false; OT_economyLoadDone = false; @@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck 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 = 30; //Half the Average time between NATO orders +OT_NATOwait = 3; //Half the Average time between NATO orders OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house @@ -211,8 +211,7 @@ OT_NATO_AirSpawn = "NATO_airspawn"; OT_NATO_HQPos = [0,0,0];//Dont worry this gets populated later OT_NATO_Vehicles_Garrison = [ - ["B_T_MRAP_01_hmg_F",5], - ["B_T_MRAP_01_gmg_F",5] + ]; OT_NATO_Vehicles_AirGarrison = [ @@ -227,8 +226,8 @@ OT_NATO_Vehicles_AirGarrison = [ ]; OT_NATO_StaticGarrison_LevelOne = ["B_HMG_01_high_F"]; -OT_NATO_StaticGarrison_LevelTwo = ["B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"]; -OT_NATO_StaticGarrison_LevelThree = ["B_T_Static_AT_F","B_T_Static_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"]; +OT_NATO_StaticGarrison_LevelTwo = ["B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F","B_T_MRAP_01_hmg_F"]; +OT_NATO_StaticGarrison_LevelThree = ["B_T_Static_AT_F","B_T_Static_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F","B_T_MRAP_01_hmg_F","B_T_MRAP_01_gmg_F"]; OT_NATO_CommTowers = ["Land_TTowerBig_1_F","Land_TTowerBig_2_F"]; @@ -239,7 +238,7 @@ OT_NATO_Vehicle_Quad = "B_Quadbike_01_F"; OT_NATO_Vehicle_Police = "B_GEN_Offroad_01_gen_F"; OT_NATO_Vehicle_Transport = ["B_T_Truck_01_transport_F","B_T_Truck_01_covered_F"]; OT_NATO_Vehicles_PoliceSupport = ["B_T_MRAP_01_hmg_F","B_T_MRAP_01_gmg_F","B_T_LSV_01_armed_F","B_Heli_Light_01_armed_F"]; -OT_NATO_Vehicles_AirDrones = ["B_UAV_02_F"]; +OT_NATO_Vehicles_ReconDrone = "B_UAV_01_F"; OT_NATO_Vehicles_CASDrone = "B_UAV_02_CAS_F"; OT_NATO_Vehicles_AirSupport = ["B_Heli_Attack_01_F"]; OT_NATO_Vehicles_AirSupport_Small = ["B_Heli_Light_01_armed_F"]; @@ -251,6 +250,7 @@ OT_NATO_Vehicle_AirTransport_Large = "B_Heli_Transport_03_F"; OT_NATO_Vehicle_Boat_Small = "B_Boat_Armed_01_minigun_F"; OT_NATO_GroundForces = ["B_T_InfSquad_Weapons","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad"]; +OT_NATO_Group_Recon = (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam"); OT_NATO_Unit_LevelOneLeader = "B_T_Soldier_TL_F"; OT_NATO_Units_LevelOne = ["B_T_Medic_F","B_T_Soldier_F","B_T_Soldier_LAT_F","B_T_Soldier_AAT_F","B_T_Soldier_AT_F","B_T_soldier_M_F","B_T_Soldier_GL_F","B_T_Soldier_AR_F"]; @@ -290,6 +290,7 @@ OT_interactingWith = objNull; //The cost to produce an item will be the Base price - player/factory bonuses + raw materials //The wholesale sell price of an item will be the base price - local markup //NB: the local markup can be negative, making buy prices lower and sell prices higher, in certain situations (high stability and/or player rep) + OT_items = []; if(OT_hasAce) then { OT_item_DefaultBlueprints pushback "ACE_fieldDressing"; @@ -297,8 +298,8 @@ if(OT_hasAce) then { [OT_items,[ ["ACE_fieldDressing",2,0,0,0.1], ["ACE_elasticBandage",3,0,0,0.2], - ["ACE_morphine",40,0,0,0.2], - ["ACE_epinephrine",40,0,0,0.2], + ["ACE_morphine",20,0,0,0.2], + ["ACE_epinephrine",50,0,0,0.2], ["ACE_adenosine",40,0,0,0.2], ["ACE_SpraypaintBlue",20,0,0,0.2], ["ACE_SpraypaintRed",20,0,0,0.2], @@ -328,7 +329,8 @@ if(OT_hasAce) then { ["ACE_UAVBattery",14,0,0,1], ["ACE_wirecutter",4,0,0,1], ["ACE_MapTools",2,0,0,1], - ["ACE_bloodIV",120,0,0,1] + ["ACE_bloodIV",80,0,0,1], + ["ACE_Cellphone",100,0,0,1] ]] call BIS_fnc_arrayPushStack; }else{ OT_item_DefaultBlueprints pushback "FirstAidKit"; @@ -894,10 +896,11 @@ OT_portBuilding = "Land_Warehouse_02_F"; OT_policeStation = "Land_Cargo_House_V3_F"; OT_warehouse = "Land_Warehouse_03_F"; OT_barracks = "Land_Barracks_01_grey_F"; +OT_workshopBuilding = "Land_Cargo_House_V4_F"; OT_loadingMessages = ["Adding Hidden Agendas","Adjusting Bell Curves","Aesthesizing Industrial Areas","Aligning Covariance Matrices","Applying Feng Shui Shaders","Applying Theatre Soda Layer","Asserting Packed Exemplars","Attempting to Lock Back-Buffer","Binding Sapling Root System","Breeding Fauna","Building Data Trees","Bureacritizing Bureaucracies","Calculating Inverse Probability Matrices","Calculating Llama Expectoration Trajectory","Calibrating Blue Skies","Charging Ozone Layer","Coalescing Cloud Formations","Cohorting Exemplars","Collecting Meteor Particles","Compounding Inert Tessellations","Compressing Fish Files","Computing Optimal Bin Packing","Concatenating Sub-Contractors","Containing Existential Buffer","Debarking Ark Ramp","Debunching Unionized Commercial Services","Deciding What Message to Display Next","Decomposing Singular Values","Decrementing Tectonic Plates","Deleting Ferry Routes","Depixelating Inner Mountain Surface Back Faces","Depositing Slush Funds","Destabilizing Economic Indicators","Determining Width of Blast Fronts","Deunionizing Bulldozers","Dicing Models","Diluting Livestock Nutrition Variables","Downloading Satellite Terrain Data","Exposing Flash Variables to Streak System","Extracting Resources","Factoring Pay Scale","Fixing Election Outcome Matrix","Flood-Filling Ground Water","Flushing Pipe Network","Gathering Particle Sources","Generating Jobs","Gesticulating Mimes","Graphing Whale Migration","Hiding Willio Webnet Mask","Implementing Impeachment Routine","Increasing Accuracy of RCI Simulators","Increasing Magmafacation","Initializing Rhinoceros Breeding Timetable","Initializing Robotic Click-Path AI","Inserting Sublimated Messages","Integrating Curves","Integrating Illumination Form Factors","Integrating Population Graphs","Iterating Cellular Automata","Lecturing Errant Subsystems","Mixing Genetic Pool","Modeling Object Components","Mopping Occupant Leaks","Normalizing Power","Obfuscating Quigley Matrix","Overconstraining Dirty Industry Calculations","Partitioning City Grid Singularities","Perturbing Matrices","Pixellating Nude Patch","Polishing Water Highlights","Populating Lot Templates","Preparing Sprites for Random Walks","Prioritizing Landmarks","Projecting Law Enforcement Pastry Intake","Realigning Alternate Time Frames","Reconfiguring User Mental Processes","Relaxing Splines","Removing Road Network Speed Bumps","Removing Texture Gradients","Removing Vehicle Avoidance Behavior","Resolving GUID Conflict","Reticulating Splines","Retracting Phong Shader","Retrieving from Back Store","Reverse Engineering Image Consultant","Routing Neural Network Infanstructure","Scattering Rhino Food Sources","Scrubbing Terrain","Searching for Llamas","Seeding Architecture Simulation Parameters","Sequencing Particles","Setting Advisor ","Setting Inner Deity ","Setting Universal Physical Constants","Sonically Enhancing Occupant-Free Timber","Speculating Stock Market Indices","Splatting Transforms","Stratifying Ground Layers","Sub-Sampling Water Data","Synthesizing Gravity","Synthesizing Wavelets","Time-Compressing Simulator Clock","Unable to Reveal Current Activity","Weathering Buildings","Zeroing Crime Network"]; OT_allBuyableBuildings = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_item_Tent,OT_item_Flag]; -OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,"Land_Cargo_House_V4_F"]; +OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,OT_workshopBuilding]; OT_Buildables = [ ["Training Camp",1200,[] call compileFinal preProcessFileLineNumbers "templates\military\trainingCamp.sqf","structures\trainingCamp.sqf",true,"Allows training of recruits and hiring of mercenaries"], diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 8a4a0c53..56c6a230 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm @@ -8,7 +8,7 @@ class EditorData toggles=522; class ItemIDProvider { - nextID=2092; + nextID=2097; }; class MarkerIDProvider { @@ -16,14 +16,14 @@ class EditorData }; class LayerIndexProvider { - nextID=249; + nextID=254; }; class Camera { - 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}; + pos[]={12686.042,114.2223,5353.1509}; + dir[]={-0.60531187,-0.5580765,-0.56759191}; + up[]={-0.40710393,0.8297838,-0.38173577}; + aside[]={-0.68401688,-1.1379598e-008,0.72947484}; }; }; binarizationWanted=0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf index e10ae687..8c5657ec 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf @@ -21,7 +21,7 @@ _newrecruits = []; _civ = _x select 2; if(_owner == (getplayeruid player)) then { if(typename _civ == "OBJECT") then { - if((_civ getVariable "owner") == (getplayeruid player)) then { + if(_civ call OT_fnc_playerIsOwner) then { [_civ] joinSilent (group player); }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf index 40eb178a..4b9febc8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf @@ -14,7 +14,7 @@ if(isNil "_gundealerpos") then { _building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding; _gundealerpos = (_building call BIS_fnc_buildingPositions) call BIS_fnc_selectRandom; server setVariable [format["gundealer%1",_town],_gundealerpos,true]; - _building setVariable ["owner","system",true]; + [_building,"system"] call OT_fnc_setOwner; }; _group = createGroup civilian; _groups pushback _group; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf index fa903c9a..c6ca2116 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf @@ -19,9 +19,9 @@ removeVest _unit; _unit forceAddUniform (OT_clothes_carDealers call BIS_fnc_selectRandom); -_unit setvariable ["owner","self"]; +[_unit,"self"] call OT_fnc_setOwner; _unit addEventHandler ["FiredNear", { - _u = _this select 0; + _u = _this select 0; _u setUnitPos "DOWN"; -}]; \ No newline at end of file +}]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf index adfd06d4..a4d071cb 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf @@ -24,5 +24,5 @@ _unit forceAddUniform (OT_clothes_guerilla call BIS_fnc_selectRandom); _group = group _unit; _group setBehaviour "CARELESS"; -_unit setvariable ["owner","self",true]; -(group _unit) allowFleeing 0; \ No newline at end of file +[_unit,"self"] call OT_fnc_setOwner; +(group _unit) allowFleeing 0; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf index 7aed0acb..e0de1501 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf @@ -19,9 +19,9 @@ removeVest _unit; _unit forceAddUniform (OT_clothes_harbor call BIS_fnc_selectRandom); -_unit setvariable ["owner","self"]; +[_unit,"self"] call OT_fnc_setOwner; _unit addEventHandler ["FiredNear", { - _u = _this select 0; + _u = _this select 0; _u setUnitPos "DOWN"; }]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf index 21385f8a..f38d7fdb 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf @@ -13,9 +13,9 @@ _unit addEventHandler ["HandleDamage", { _src = _this select 3; if(captive _src) then { if((vehicle _src) != _src or (_src call unitSeenCRIM)) then { - _src setCaptive false; - }; - }; + _src setCaptive false; + }; + }; }]; [_unit, OT_face_localBoss] remoteExecCall ["setFace", 0, _unit]; @@ -49,7 +49,7 @@ if(OT_hasACE) then { }else{ _unit linkItem "ItemWatch"; }; - +_unit linkItem "ACE_Cellphone"; _weapon = (OT_CRIM_Weapons + OT_allCheapRifles) call BIS_fnc_selectRandom; _base = [_weapon] call BIS_fnc_baseWeapon; @@ -66,7 +66,7 @@ _unit addWeapon _weapon; _config = configfile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo"; _numslots = count(_config); for "_i" from 0 to (_numslots-1) do { - if (isClass (_config select _i)) then { + if (isClass (_config select _i)) then { _slot = configName(_config select _i); _com = _config >> _slot >> "compatibleItems"; _items = []; @@ -76,9 +76,9 @@ for "_i" from 0 to (_numslots-1) do { }; }else{ _items = getArray(_com); - }; - if(count _items > 0) then { - _cls = _items call BIS_fnc_selectRandom; + }; + if(count _items > 0) then { + _cls = _items call BIS_fnc_selectRandom; _unit addPrimaryWeaponItem _cls; }; }; @@ -91,4 +91,3 @@ _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select if !(isNil "_magazine") then { _unit addItem _magazine; }; - diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf index ecaba026..87e37646 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf @@ -14,7 +14,7 @@ removeBackpack _unit; removeHeadgear _unit; removeVest _unit; -_unit setVariable ["owner","self"]; +[_unit,"self"] call OT_fnc_setOwner; [_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit]; [_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit]; @@ -26,8 +26,8 @@ _unit addEventHandler ["FiredNear", { if !(_u getVariable ["fleeing",false]) then { _u setVariable ["fleeing",true,false]; _u setBehaviour "COMBAT"; - _by = _this select 1; + _by = _this select 1; _u allowFleeing 1; _u setskill ["courage",0]; }; -}]; \ No newline at end of file +}]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf index 711109cf..7bd16c6e 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf @@ -20,9 +20,9 @@ removeVest _unit; _unit forceAddUniform (OT_clothes_shops call BIS_fnc_selectRandom); -_unit setvariable ["owner","self"]; +[_unit,"self"] call OT_fnc_setOwner; _unit addEventHandler ["FiredNear", { - _u = _this select 0; + _u = _this select 0; _u setUnitPos "DOWN"; -}]; \ No newline at end of file +}]; diff --git a/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf index 7a2bb948..6f9467ac 100644 --- a/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf +++ b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf @@ -1,2 +1,2 @@ -_txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) getVariable ["owner",""])]; +_txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) call OT_fnc_getOwner)]; [_txt, -0.5, 1, 5, 1, 0, 5] spawn bis_fnc_dynamicText; diff --git a/addons/overthrow_main/functions/actions/fn_buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf index dfa2e1e2..38f8fd19 100644 --- a/addons/overthrow_main/functions/actions/fn_buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -18,7 +18,7 @@ call { player setVariable ["money",_money-_price,true]; _veh = "C_Quadbike_01_F" createVehicle _pos; - _veh setVariable ["owner",getPlayerUID player,true]; + [_veh,getPlayerUID player] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; @@ -55,10 +55,10 @@ call { _veh = createVehicle [_cls, _pos, [], 0,""]; _crew = createVehicleCrew _veh; { - _x setVariable ["owner",getplayeruid player,true]; + [_x,getPlayerUID player] call OT_fnc_setOwner; }foreach(crew _veh); - _veh setVariable ["owner",getPlayerUID player,true]; + [_veh,getPlayerUID player] call OT_fnc_setOwner; if("ItemGPS" in (assignedItems player)) then { player addItem OT_item_UAVterminal; @@ -81,7 +81,7 @@ call { player setVariable ["money",_money-_price,true]; _veh = _cls createVehicle _pos; - _veh setVariable ["owner",getPlayerUID player,true]; + [_veh,getPlayerUID player] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; @@ -97,7 +97,7 @@ call { player setVariable ["money",_money-_price,true]; _veh = _cls createVehicle _pos; - _veh setVariable ["owner",getPlayerUID player,true]; + [_veh,getPlayerUID player] call OT_fnc_setOwner; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearBackpackCargoGlobal _veh; @@ -134,7 +134,7 @@ call { _box = false; { - _owner = _x getVariable "owner"; + _owner = _x call OT_fnc_getOwner; if(!isNil "_owner") then { if(_owner == getplayerUID player) exitWith {_box = _x}; }; diff --git a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf index ce7e47e1..29782aa7 100644 --- a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf +++ b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf @@ -10,7 +10,7 @@ if(typename _b == "ARRAY") then { if !(_building call OT_fnc_hasOwner) then { _handled = true; }else{ - _owner = _building getVariable "owner"; + _owner = _building call OT_fnc_getOwner; if(_owner == getplayeruid player) then { _home = player getVariable "home"; if(_home distance _building < 5) exitWith {"You cannot sell your home" call OT_fnc_notifyMinor;_err = true}; @@ -89,7 +89,7 @@ if(_handled) then { _owned = player getVariable "owned"; if(_type == "buy") then { - _building setVariable ["owner",getPlayerUID player,true]; + [_building,getPlayerUID player] call OT_fnc_setOwner; [-_price] call money; _mrk = createMarkerLocal [_mrkid,getpos _building]; @@ -110,10 +110,13 @@ if(_handled) then { }; }else{ if ((typeof _building) in OT_allRealEstate) then { - _building setVariable ["owner",nil,true]; - _building setVariable ["leased",nil,true]; + [_building,nil] call OT_fnc_setOwner; + _id = [_building] call fnc_getBuildID; + _leased = player getVariable ["leased",[]]; + _leased deleteAt (_leased find _id); + player setVariable ["leased",_leased,true]; deleteMarker _mrkid; - _owned deleteAt (_owned find ([_building] call fnc_getBuildID)); + _owned deleteAt (_owned find _id); [player,"Building Sold",format["Sold: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_sell]] call BIS_fnc_createLogRecord; [_sell] call money; }else{ diff --git a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf index b9562788..a8a131bc 100644 --- a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf @@ -15,7 +15,7 @@ if(random 100 > 80) then { }; _civ = player getvariable "hiringciv"; -_civ setVariable ["owner",getPlayerUID player,true]; +[_civ,getPlayerUID player] call OT_fnc_setOwner; _civ removeAllEventHandlers "FiredNear"; [_civ] joinSilent grpNull; [_civ] joinSilent (group player); diff --git a/addons/overthrow_main/functions/events/fn_preInit.sqf b/addons/overthrow_main/functions/events/fn_preInit.sqf index 09606ab7..b639de0c 100644 --- a/addons/overthrow_main/functions/events/fn_preInit.sqf +++ b/addons/overthrow_main/functions/events/fn_preInit.sqf @@ -9,12 +9,21 @@ if(isServer) then { warehouse = _group createUnit ["LOGIC",[2,0,0] , [], 0, ""]; spawner = _group createUnit ["LOGIC",[3,0,0] , [], 0, ""]; templates = _group createUnit ["LOGIC",[4,0,0] , [], 0, ""]; + owners = _group createUnit ["LOGIC",[5,0,0] , [], 0, ""]; publicVariable "server"; publicVariable "cost"; publicVariable "warehouse"; publicVariable "spawner"; publicVariable "templates"; + publicVariable "owners"; + + if(!isMultiplayer) then { + addMissionEventHandler ["Loaded", { + [] execVM "setupPlayer.sqf"; + [] spawn setupKeyHandler; + }]; + }; }; //VCOM AI, huge credits to Genesis, without VCOM this campaign would be so much less diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf index a182ecf4..bf0aae33 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf @@ -26,7 +26,7 @@ if(isNil "_close") then { _close = OT_NATO_HQPos; }; _start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; -_group = [_start, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_SniperTeam")] call BIS_fnc_spawnGroup; +_group = [_start, WEST, OT_NATO_Group_Recon] call BIS_fnc_spawnGroup; sleep 0.5; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf index 8d26bd20..10300151 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf @@ -25,6 +25,7 @@ if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOvers }; }foreach (OT_allTowns); server setVariable ["NATOabandoned",_abandoned,true]; + server setVariable ["NATOresources",2000,true]; server setVariable ["garrisonHQ",1000,false]; OT_NATOobjectives = []; OT_NATOcomms = []; @@ -100,37 +101,6 @@ if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOvers server setVariable ["NATOhvts",OT_NATOhvts,true]; diag_log "Overthrow: Distributing NATO vehicles"; - - //Randomly distribute NATO's vehicles - //First, build a weighted list of objectives - _prilist = []; - { - _x params ["_pos","_name","_worth"]; - - if(_worth > 250) then { - _prilist pushback _name; - }; - if(_worth > 800) then { - _prilist pushback _name; - }; - if(_worth > 1200) then { - _prilist pushback _name; - }; - }foreach(OT_NATOobjectives); - - { - _type = _x select 0; - _num = _x select 1; - _count = 0; - while {_count < _num} do { - _name = _prilist call BIS_fnc_selectRandom; - _garrison = server getVariable format["vehgarrison%1",_name]; - _garrison pushback _type; - _count = _count + 1; - server setVariable [format ["vehgarrison%1",_name],_garrison,true]; - }; - }foreach(OT_NATO_Vehicles_Garrison); - //Weighted airport list to distribute air vehicles _prilist = []; { diff --git a/addons/overthrow_main/functions/fn_canPlace.sqf b/addons/overthrow_main/functions/fn_canPlace.sqf index 793c54e7..fa858b1a 100644 --- a/addons/overthrow_main/functions/fn_canPlace.sqf +++ b/addons/overthrow_main/functions/fn_canPlace.sqf @@ -61,10 +61,9 @@ if !(_isbase) then { _estate = _pos call OT_fnc_nearestRealEstate; if(typename _estate == "ARRAY") then { _b = _estate select 0; - if(_b getVariable ["leased",false]) exitWith {_canplace = false}; if(typeof _b == OT_item_Tent) exitWith {_canplace = false}; if(_b call OT_fnc_hasOwner) then { - _owner = _b getVariable "owner"; + _owner = _b call OT_fnc_getOwner; if(_owner != getplayeruid player) then { if(_typecls != "Camp" and _typecls != "Base") then { _canplace = false; diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf new file mode 100644 index 00000000..8bacfdd3 --- /dev/null +++ b/addons/overthrow_main/functions/fn_getOwner.sqf @@ -0,0 +1,8 @@ +if(_this isKindOf "Building") exitWith { + _id = [_this] call OT_fnc_getBuildID; + owners getVariable [str _id,nil]; +}; +if(_this isKindOf "CAManBase") exitWith { + _this getVariable ["owner",nil]; +}; +owners getVariable [str _this,nil]; diff --git a/addons/overthrow_main/functions/fn_hasOwner.sqf b/addons/overthrow_main/functions/fn_hasOwner.sqf index 73ae98cd..84c6e0b3 100644 --- a/addons/overthrow_main/functions/fn_hasOwner.sqf +++ b/addons/overthrow_main/functions/fn_hasOwner.sqf @@ -12,7 +12,7 @@ Author: private _item = _this; -private _owner = _item getVariable "owner"; +private _owner = _item call OT_fnc_getOwner; private _ret = false; if !(isNil "_owner") then { if(typename _owner == "STRING") then { diff --git a/addons/overthrow_main/functions/fn_loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf index ae1d101e..6feef513 100644 --- a/addons/overthrow_main/functions/fn_loadGame.sqf +++ b/addons/overthrow_main/functions/fn_loadGame.sqf @@ -23,7 +23,7 @@ private _cc = 0; _veh = createVehicle [OT_Item_Flag, _pos, [], 0, "CAN_COLLIDE"]; _veh enableDynamicSimulation true; - _veh setVariable ["owner",_owner,true]; + [_veh,_owner] call OT_fnc_setOwner; _veh = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"]; _veh enableDynamicSimulation true; @@ -102,7 +102,7 @@ private _cc = 0; _veh setObjectTextureGlobal [0,"\ot\ui\maptanoa.paa"]; }; - _veh setVariable ["owner",_owner,true]; + [_veh,_owner] call OT_fnc_setOwner; { _cls = _x select 0; _num = _x select 1; @@ -210,23 +210,17 @@ sleep 0.1; _buildings = (_x nearObjects ["Building",8]); if(count _buildings > 0) then { _bdg = _buildings select 0; - _bdg setVariable ["owner",_uid,true]; + [_bdg,_uid] call OT_fnc_setOwner; }; }else{ //new save with IDs if (typename _x == "SCALAR") then { - _bdg = OT_centerPos nearestObject _x; - _bdg setVariable ["owner",_uid,true]; - if(_x in _leased) then { - _bdg setVariable ["leased",true,true]; - _leasedata pushback [_x,typeof _bdg,getpos _bdg,(getpos _bdg) call OT_fnc_nearestTown]; - }; + [_x,_uid] call OT_fnc_setOwner; }; }; }foreach(_val); }; }foreach(_vars); - [_uid,"leasedata",_leasedata] call OT_fnc_setOfflinePlayerAttribute; }foreach(server getvariable ["OT_allPlayers",[]]); sleep 2; //let the variables propagate server setVariable ["StartupType","LOAD",true]; diff --git a/addons/overthrow_main/functions/fn_saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf index 084379a9..ad3b6aec 100644 --- a/addons/overthrow_main/functions/fn_saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -34,7 +34,7 @@ private _data = []; _d = []; _all = []; { - if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then { + if(_x != "ot_loaded" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then { _all pushback _x; _val = _me getVariable _x; if !(isNil "_val") then { @@ -52,7 +52,7 @@ private _vehicles = []; _count = 10001; { if(!(_x isKindOf "Man") and (alive _x) and (_x call OT_fnc_hasOwner) and (typeof _x != OT_item_Flag)) then { - _owner = _x getVariable ["owner",false]; + _owner = _x call OT_fnc_getOwner; _s = _x call OT_fnc_unitStock; if(typeof _x == OT_item_safe) then { _s pushback ["money",_x getVariable ["money",0]]; diff --git a/addons/overthrow_main/functions/fn_setOwner.sqf b/addons/overthrow_main/functions/fn_setOwner.sqf new file mode 100644 index 00000000..98dd4075 --- /dev/null +++ b/addons/overthrow_main/functions/fn_setOwner.sqf @@ -0,0 +1,9 @@ +params ["_obj","_owner"]; +if(_obj isKindOf "Building") exitWith { + _id = [_obj] call OT_fnc_getBuildID; + owners setVariable [str _id,_owner,true]; +}; +if(_obj isKindOf "CAManBase") exitWith { + _obj setVariable ["owner",_owner,true]; +}; +owners setVariable [str _obj,_owner,true]; diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp index 726e9218..bf2d08a7 100644 --- a/addons/overthrow_main/ui/dialogs/main.hpp +++ b/addons/overthrow_main/ui/dialogs/main.hpp @@ -560,7 +560,7 @@ class OT_dialog_options class RscButton_1606: RscOverthrowButton { idc = 1606; - action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and (_x getvariable [""owner"",""""] != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""OT_fnc_notifyMinor"",0,false];"; + action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and ((_x call OT_fnc_getOwner) != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""OT_fnc_notifyMinor"",0,false];"; text = "Clean other"; //--- ToDo: Localize; x = 0.515469 * safezoneW + safezoneX; From 149b25fa161017ebec07f2278aef2c9bb042fe1d Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 8 May 2017 05:33:45 +1000 Subject: [PATCH 04/16] warehouses take damage, workshops finally repair vehicles --- .../AI/fn_NATOSetExplosives.sqf | 4 +-- .../missions/Overthrow.Tanoa/UI/buildMenu.sqf | 2 +- .../UI/fn_resistanceDialog.sqf | 10 +++--- .../missions/Overthrow.Tanoa/UI/mainMenu.sqf | 33 ++++++++++++----- .../Overthrow.Tanoa/actions/leaseBuilding.sqf | 16 +++++++++ .../events/buildingDamaged.sqf | 23 +++++++++++- .../Overthrow.Tanoa/factions/NATO.sqf | 3 -- .../missions/Overthrow.Tanoa/initFuncs.sqf | 9 ++--- .../Overthrow.Tanoa/initPlayerLocal.sqf | 10 ++++-- .../missions/Overthrow.Tanoa/initVar.sqf | 10 +++--- .../interaction/initObjectLocal.sqf | 6 +++- .../missions/Overthrow.Tanoa/keyHandler.sqf | 10 +----- .../missions/Overthrow.Tanoa/mission.sqm | 2 +- .../Overthrow.Tanoa/structures/workshop.sqf | 9 ++--- .../functions/actions/fn_buyBuilding.sqf | 6 ++-- .../functions/events/fn_preInit.sqf | 4 ++- .../overthrow_main/functions/fn_getOwner.sqf | 3 ++ .../overthrow_main/functions/fn_loadGame.sqf | 36 +++++++++++++++---- .../overthrow_main/functions/fn_saveGame.sqf | 6 ++++ .../overthrow_main/functions/fn_setOwner.sqf | 3 ++ addons/overthrow_main/ui/dialogs/build.hpp | 8 ++--- 21 files changed, 152 insertions(+), 61 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf index fa1852f9..59ebcf9d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf @@ -21,8 +21,8 @@ if(_gotexp) then { if(alive _expert) then { _expert removeMagazineGlobal "DemoCharge_Remote_Mag"; _p set [2,1]; - _charge = createVehicle ["DemoCharge_Remote_Ammo", _p, [], 0,""]; - _charge enableSimulationGlobal true; + _charge = "DemoCharge_Remote_Ammo" createVehicle _p; + _charge setPosATL _p; //run away! _runto = [_p,[1000,2000],random 360] call SHK_pos; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf index fa5118cc..59910e50 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf @@ -297,7 +297,7 @@ buildOnMouseUp = { if(modeCode != "") then { _created setVariable ["OT_init",modeCode,true]; - [modeValue,modeCode] remoteExec ["structureInit",2]; + [_created,modeValue,modeCode] remoteExec ["structureInit",2]; }; _clu = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"]; _clu enableDynamicSimulation true; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf index dbb2ad2f..d0cd4d33 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf @@ -48,13 +48,15 @@ lbClear 1501; }foreach(OT_economicData); _tax = server getVariable ["taxrate",0]; - +_damaged = owners getVariable ["damagedBuildings",[]]; private _lease = 0; { _x params ["_id","_cls","_pos","_town"]; - private _data = [_cls,_town] call OT_fnc_getRealEstateData; - _tl = (_data select 2); - _lease = _lease + _tl; + if (!_id in _damaged) then { + private _data = [_cls,_town] call OT_fnc_getRealEstateData; + _tl = (_data select 2); + _lease = _lease + _tl; + }; }foreach(player getVariable ["leasedata",[]]); if(_lease > 0) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf index 19119d9f..43a03966 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf @@ -113,6 +113,7 @@ if(typename _b == "ARRAY") then { _owner = _building call OT_fnc_getOwner; _ownername = server getVariable format["name%1",_owner]; if(isNil "_ownername") then {_ownername = "Someone"}; + if(_owner == getplayerUID player) then { _leased = player getVariable ["leased",[]]; _id = [_building] call OT_fnc_getBuildID; @@ -151,19 +152,24 @@ if(typename _b == "ARRAY") then { _buildingTxt = format[" Warehouse
- Owned by %1 - ",_ownername]; + Owned by %1
+ Damage: %2%3 + ",_ownername,round((damage _building) * 100),"%"]; }; if(_id in _leased) then { ctrlEnable [1609,false]; ctrlEnable [1610,false]; }; + if(damage _building == 1) then { + _lease = 0; + }; _buildingTxt = format[" %1
Owned by %2
- Lease Value: $%3/6hrs - ",_name,_ownername,[_lease, 1, 0, true] call CBA_fnc_formatNumber]; + Lease Value: $%3/6hrs
+ Damage: %4%5 + ",_name,_ownername,[_lease, 1, 0, true] call CBA_fnc_formatNumber,round((damage _building) * 100),"%"]; }else{ ctrlEnable [1608,false]; @@ -177,8 +183,9 @@ if(typename _b == "ARRAY") then { }; _buildingTxt = format[" %1
- Owned by %2 - ",_name,_ownername]; + Owned by %2
+ Damage: %2%3 + ",_name,_ownername,round((damage _building) * 100),"%"]; }; if(typeof _building == OT_barracks) then { _owner = _building call OT_fnc_getOwner; @@ -192,8 +199,18 @@ if(typename _b == "ARRAY") then { _buildingTxt = format[" Barracks
- Built by %1 - ",_ownername]; + Built by %1
+ Damage: %2%3 + ",_ownername,round((damage _building) * 100),"%"]; + }; + + if(damage _building == 1) then { + if((_owner == getplayerUID player) or (call OT_fnc_playerIsGeneral)) then { + ctrlEnable [1608,false]; //Not allowed to sell + ctrlSetText [1609,"Repair"]; //Replace lease/manage with repair + ctrlEnable [1609,true]; + ctrlEnable [1610,false]; + }; }; }else{ if(isNil "_price") then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf index ed3ab54b..c45cef9d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf @@ -3,6 +3,22 @@ _building = objNull; if(typename _b == "ARRAY") then { _building = (_b select 0); }; +if(damage _building == 1) exitWith { + _price = round((_b select 1) * 0.25); + _money = player getVariable ["money",0]; + if(_money >= _price) then { + [-_price] call money; + _building setDamage 0; + _id = [_building] call OT_fnc_getBuildID; + _damaged = owners getVariable ["damagedBuildings",[]]; + if(_id in _damaged) then { + _damaged deleteAt (_damaged find _id); + owners setVariable ["damagedBuildings",_damaged,true]; + } + }else{ + format["You need $%1",[_price, 1, 0, true] call CBA_fnc_formatNumber]; + }; +}; if(typeof _building == OT_policeStation) exitWith {[] call policeDialog}; if(typeof _building == OT_barracks) exitWith {[] call recruitDialog}; if(typeof _building == OT_warehouse) exitWith {[] call buyVehicleDialog}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf index a5b6a7a9..d83de458 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf @@ -1,3 +1,24 @@ params ["_obj","_sel","_dmg"]; -player globalchat format ["damage %1 %2 %3",_obj,_sel,_dmg]; +if(damage _obj == 1) then { + _damaged = owners getVariable ["damagedBuildings",[]]; + _id = [_obj] call OT_fnc_getBuildID; + if !(_id in _damaged) then { + _damaged pushback _id; + owners setVariable ["damagedBuildings",_damaged,true]; + _ty = typeof _obj; + + if(_ty == OT_warehouseBuilding) then { + format ["Warehouse damaged %1",(getpos _bdg) call BIS_fnc_locationDescription] remoteExec ["OT_fnc_notifyMinor",0,false]; + }; + if(_ty == OT_policeStation) then { + _town = (getpos _obj) call OT_fnc_nearestTown; + _abandoned = server getVariable ["NATOabandoned",[]]; + server setVariable [format["police%1",_town],0,true]; + if(_town in _abandoned) then { + [_town,-20] call stability; + format ["Police station destroyed in %1",_town] remoteExec ["OT_fnc_notifyMinor",0,false]; + }; + }; + }; +}; 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 5d8d169d..1d8746a9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -97,7 +97,6 @@ while {sleep 10;true} do { }; if(_countered) exitWith {}; }foreach(OT_NATOobjectives); - player globalchat format ["%1",_knownTargets]; }; //Town QRF (over 50 pop) @@ -283,7 +282,6 @@ while {sleep 10;true} do { if !(_done) then { if(_ty == "WH" or _ty == "PS" or _ty == "WS") then { if(_spend > 250) then { - player globalchat "Scheduled Destroy Mission"; _schedule pushback ["DESTROY",_ty,_pos]; _spend = _spend - 250; _resources = _resources -250; @@ -302,7 +300,6 @@ while {sleep 10;true} do { server setVariable ["NATOabandoned",_abandoned,true]; spawner setVariable ["NATOknownTargets",_knownTargets,true]; server setVariable ["NATOschedule",_schedule,true]; - hint str _resources; }; _count = _count + 1; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 92cc3054..758f6b27 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -204,7 +204,7 @@ OT_fnc_playerAtWarehouse = { _b = (position player) call OT_fnc_nearestRealEstate; if(typename _b == "ARRAY") then { _building = _b select 0; - if((typeof _building) == OT_warehouse and _building call OT_fnc_hasOwner) then { + if((typeof _building) == OT_warehouse and (_building call OT_fnc_hasOwner) and (damage _building) < 1) then { _iswarehouse = true; }; }; @@ -602,9 +602,10 @@ mpSetDir = { }; structureInit = { - private _pos = _this select 0; - private _code = compileFinal preProcessFileLineNumbers (_this select 1); - [_pos] spawn _code; + private _veh = _this select 0; + private _pos = _this select 1; + private _code = compileFinal preProcessFileLineNumbers (_this select 2); + [_pos,_veh] spawn _code; }; blackFaded = { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 58dfeb4f..3ce189de 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -132,7 +132,13 @@ if(isMultiplayer or _startup == "LOAD") then { //new save with IDs if (typename _x == "SCALAR") then { _mrkName = format["bdg-%1",_x]; - _mrkName = createMarkerLocal [_mrkName,getpos _bdg]; + _pos = buildingpositions getVariable [str _x,[]]; + if(count _pos == 0) then { + _bdg = OT_centerPos nearestObject _x; + _pos = position _bdg; + buildingpositions setVariable [str _x,_pos,true]; + }; + _mrkName = createMarkerLocal [_mrkName,_pos]; _mrkName setMarkerShape "ICON"; _mrkName setMarkerType "loc_Tourism"; _mrkName setMarkerColor "ColorWhite"; @@ -186,7 +192,7 @@ if(isMultiplayer or _startup == "LOAD") then { commandStop _civ; }else{ - if((_civ call OT_fnc_playerIsOwner) then { + if(_civ call OT_fnc_playerIsOwner) then { [_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 985198cb..858c08b9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck 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 = 3; //Half the Average time between NATO orders +OT_NATOwait = 30; //Half the Average time between NATO orders (x 10 seconds) OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house @@ -909,12 +909,12 @@ OT_Buildables = [ ["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"], ["Observation Post",800,["Land_Cargo_Patrol_V4_F"],"structures\observationPost.sqf",false,"Includes unarmed personnel to keep an eye over the area and provide intel on enemy positions"], ["Barracks",5000,[OT_barracks],"",false,"Allows recruiting of squads"], - ["Guard Tower",10000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need?."], + ["Guard Tower",5000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need?."], ["Hangar",1200,["Land_Airport_01_hangar_F"],"",false,"A big empty building, could probably fit a plane inside it."], - ["Workshop",2500,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"Attach weapons to vehicles"], + ["Workshop",1000,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"Attach weapons to vehicles"], ["House",1100,["Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_GarageShelter_01_F","Land_Slum_04_F"],"",false,"4 walls, a roof, and if you're lucky a door that opens."], - ["Police Station",3500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."], - ["Warehouse",5000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."] + ["Police Station",2500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."], + ["Warehouse",4000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."] ]; OT_workshop = [ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf index 99f0db07..b90c7564 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf @@ -20,7 +20,7 @@ if(typeof _this == OT_item_Storage) then { private _iswarehouse = call OT_fnc_playerAtWarehouse; if !(_iswarehouse) exitWith { - "No warehouse within range" call OT_fnc_notifyMinor; + "No warehouse within range or needs repair" call OT_fnc_notifyMinor; }; OT_warehouseTarget = _this select 0; @@ -29,6 +29,10 @@ if(typeof _this == OT_item_Storage) then { [] call warehouseDialog; },nil,0,false,true,"","call OT_fnc_playerAtWarehouse"]; _this addAction ["Store In Warehouse", { + private _iswarehouse = call OT_fnc_playerAtWarehouse; + if !(_iswarehouse) exitWith { + "No warehouse within range or needs repair" call OT_fnc_notifyMinor; + }; OT_warehouseTarget = _this select 0; [] spawn OT_fnc_transferTo; },nil,0,false,true,"","call OT_fnc_playerAtWarehouse"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf index ac07a1d5..47de8ae1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf @@ -55,15 +55,7 @@ if (_key == 21) then deleteVehicle _veh; }; }; - _b = player call OT_fnc_nearestRealEstate; - _iswarehouse = false; - if(typename _b == "ARRAY") then { - _building = _b select 0; - if((typeof _building) == OT_warehouse and _building call OT_fnc_hasOwner) then { - _iswarehouse = true; - }; - }; - if(_iswarehouse) then { + if(call OT_fnc_playerAtWarehouse) then { createDialog "OT_dialog_vehiclewarehouse"; }else{ createDialog "OT_dialog_vehicle"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 56c6a230..c9a6e05f 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=254; + nextID=259; }; class Camera { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf index d2e54fe8..181aa6d2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf @@ -1,8 +1,3 @@ -private ["_pos","_shop"]; +params ["_pos","_shop"]; -_pos = _this select 0; -_shop = (_pos nearObjects ["Land_Cargo_House_V4_F",10]) select 0; - -if(OT_hasACE) then { - [_shop] call ace_repair_fnc_moduleAssignRepairFacility; -}; +_shop setVariable ["ACE_isRepairFacility",1,true]; diff --git a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf index 29782aa7..03173854 100644 --- a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf +++ b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf @@ -102,12 +102,14 @@ if(_handled) then { _mrk setMarkerAlpha 0; _mrk setMarkerAlphaLocal 1; }; - - _owned pushback ([_building] call fnc_getBuildID); + _id = [_building] call fnc_getBuildID; + buildingpositions setVariable [str _id,position _building,true]; + _owned pushback _id; [player,"Building Purchased",format["Bought: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_price]] call BIS_fnc_createLogRecord; if(_price > 10000) then { [_town,round(_price / 10000)] call standing; }; + _bdg addEventHandler ["Dammaged",compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf"]; }else{ if ((typeof _building) in OT_allRealEstate) then { [_building,nil] call OT_fnc_setOwner; diff --git a/addons/overthrow_main/functions/events/fn_preInit.sqf b/addons/overthrow_main/functions/events/fn_preInit.sqf index b639de0c..78dfd35a 100644 --- a/addons/overthrow_main/functions/events/fn_preInit.sqf +++ b/addons/overthrow_main/functions/events/fn_preInit.sqf @@ -10,6 +10,7 @@ if(isServer) then { spawner = _group createUnit ["LOGIC",[3,0,0] , [], 0, ""]; templates = _group createUnit ["LOGIC",[4,0,0] , [], 0, ""]; owners = _group createUnit ["LOGIC",[5,0,0] , [], 0, ""]; + buildingpositions = _group createUnit ["LOGIC",[5,0,0] , [], 0, ""]; publicVariable "server"; publicVariable "cost"; @@ -17,7 +18,8 @@ if(isServer) then { publicVariable "spawner"; publicVariable "templates"; publicVariable "owners"; - + publicVariable "buildingpositions"; + if(!isMultiplayer) then { addMissionEventHandler ["Loaded", { [] execVM "setupPlayer.sqf"; diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf index 8bacfdd3..18bb8f0e 100644 --- a/addons/overthrow_main/functions/fn_getOwner.sqf +++ b/addons/overthrow_main/functions/fn_getOwner.sqf @@ -1,3 +1,6 @@ +if(typename _this == "SCALAR") exitWith { + owners getVariable [str _this,nil]; +}; if(_this isKindOf "Building") exitWith { _id = [_this] call OT_fnc_getBuildID; owners getVariable [str _id,nil]; diff --git a/addons/overthrow_main/functions/fn_loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf index 6feef513..f5586cbd 100644 --- a/addons/overthrow_main/functions/fn_loadGame.sqf +++ b/addons/overthrow_main/functions/fn_loadGame.sqf @@ -6,7 +6,7 @@ private ["_data"]; _data = profileNameSpace getVariable ["Overthrow.save.001",""]; if(typename _data != "ARRAY") exitWith { [] remoteExec ['newGame',2]; - "No save found, starting new game" remoteExec ["hint",bigboss,true]; + "No save found, starting new game" remoteExec ["hint",0,true]; }; private _cc = 0; @@ -15,6 +15,12 @@ private _cc = 0; _key = _x select 0; _val = _x select 1; _set = true; + if(_key == "buildingpositions") then { + { + buildingpositions setVariable [_x select 0,_x select 1,true]; + }foreach(_val); + _set = false; + }; if(_key == "bases") then { { _pos = _x select 0; @@ -136,7 +142,7 @@ private _cc = 0; if(count _x > 6) then { _code = (_x select 6); if(_code != "") then { - [getpos _veh,_code] call structureInit; + [_veh,getpos _veh,_code] call structureInit; }; _veh setVariable ["OT_init",_code,true]; }; @@ -196,11 +202,13 @@ private _cc = 0; }; }foreach(_data); sleep 0.1; +private _built = (allMissionObjects "Static"); { - _uid = _x; - _vars = server getVariable [_uid,[]]; - _leased = [_uid,"leased",[]] call OT_fnc_getOfflinePlayerAttribute; - _leasedata = []; + private _uid = _x; + private _vars = server getVariable [_uid,[]]; + private _leased = [_uid,"leased",[]] call OT_fnc_getOfflinePlayerAttribute; + private _leasedata = []; + private _handler = compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf"; { _x params ["_name","_val"]; if(_name == "owned") then { @@ -216,11 +224,27 @@ sleep 0.1; //new save with IDs if (typename _x == "SCALAR") then { [_x,_uid] call OT_fnc_setOwner; + + _pos = buildingpositions getVariable [str _x,[]]; + _bdg = objNull; + if(count _pos == 0) then { + _bdg = OT_centerPos nearestObject _x; + buildingpositions setVariable [str _x,position _bdg,true]; + }else{ + _bdg = _pos nearestObject _x; + }; + if !(_bdg in _built) then { + _bdg addEventHandler ["Dammaged",_handler]; + }; + if(_x in _leased) then { + _leasedata pushback [_x,typeof _bdg,_pos,_pos call OT_fnc_nearestTown]; + }; }; }; }foreach(_val); }; }foreach(_vars); + [_uid,"leasedata",_leasedata] call OT_fnc_setOfflinePlayerAttribute; }foreach(server getvariable ["OT_allPlayers",[]]); sleep 2; //let the variables propagate server setVariable ["StartupType","LOAD",true]; diff --git a/addons/overthrow_main/functions/fn_saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf index ad3b6aec..aee3f8a5 100644 --- a/addons/overthrow_main/functions/fn_saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -26,6 +26,12 @@ private _data = []; }; }foreach(allVariables server); +_poses = []; +{ + _poses pushback [_x,buildingpositions getVariable _x]; +}foreach(allVariables buildingpositions); +_data pushback ["buildingpositions",_poses]; + //get all online player data { _uid = getPlayerUID _x; diff --git a/addons/overthrow_main/functions/fn_setOwner.sqf b/addons/overthrow_main/functions/fn_setOwner.sqf index 98dd4075..add327f0 100644 --- a/addons/overthrow_main/functions/fn_setOwner.sqf +++ b/addons/overthrow_main/functions/fn_setOwner.sqf @@ -1,4 +1,7 @@ params ["_obj","_owner"]; +if(typename _obj == "SCALAR") exitWith { + owners setVariable [str _obj,_owner,true]; +}; if(_obj isKindOf "Building") exitWith { _id = [_obj] call OT_fnc_getBuildID; owners setVariable [str _id,_owner,true]; diff --git a/addons/overthrow_main/ui/dialogs/build.hpp b/addons/overthrow_main/ui/dialogs/build.hpp index a4e7e429..482c57c4 100644 --- a/addons/overthrow_main/ui/dialogs/build.hpp +++ b/addons/overthrow_main/ui/dialogs/build.hpp @@ -64,14 +64,14 @@ class OT_dialog_buildbase class RscButton_1604: RscOverthrowButton { idc = 1604; - action = "'Helipad' call build"; + action = "'Workshop' call build"; - text = "Helipad"; //--- ToDo: Localize; - x = 0.0204687 * safezoneW + safezoneX; + text = "Workshop"; //--- ToDo: Localize; + x = 0.891875 * 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; + tooltip = "Modify vehicles"; //--- ToDo: Localize; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END From c17d4351658dc95df318fbbf9bb4ebb1b390b01a Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Thu, 11 May 2017 01:28:31 +1000 Subject: [PATCH 05/16] Relax, Morty. Theyre just mortars --- addons/overthrow_main/CfgWeapons.hpp | 10 + .../Overthrow.Tanoa/AI/fn_NATOConvoy.sqf | 83 ++++---- .../Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf | 21 ++ .../AI/fn_NATOMissionDeployFOB.sqf | 142 ++++++++++++++ .../Overthrow.Tanoa/AI/fn_NATOMortar.sqf | 41 ++++ .../Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf | 92 +++++++++ .../missions/Overthrow.Tanoa/UI/mainMenu.sqf | 16 ++ .../Overthrow.Tanoa/UI/recruitDialog.sqf | 44 +++-- .../Overthrow.Tanoa/actions/leaseBuilding.sqf | 2 +- .../Overthrow.Tanoa/actions/placementMode.sqf | 4 +- .../Overthrow.Tanoa/factions/GUER.sqf | 22 +++ .../Overthrow.Tanoa/factions/NATO.sqf | 179 +++++++++++++++++- .../missions/Overthrow.Tanoa/initFuncs.sqf | 19 +- .../Overthrow.Tanoa/initPlayerLocal.sqf | 4 +- .../missions/Overthrow.Tanoa/initVar.sqf | 32 +++- .../missions/Overthrow.Tanoa/keyHandler.sqf | 2 +- .../missions/Overthrow.Tanoa/mission.sqm | 12 +- .../spawners/ambientVehicles.sqf | 1 + .../spawners/militaryGarrison.sqf | 4 +- .../templates/military/trainingCamp.sqf | 26 +-- .../missions/Overthrow.Tanoa/wantedSystem.sqf | 6 +- addons/overthrow_main/config.cpp | 2 +- .../functions/AI/NPC/fn_initCivilian.sqf | 24 ++- .../functions/AI/NPC/fn_initCivilianGroup.sqf | 2 +- .../functions/AI/NPC/fn_initGendarmPatrol.sqf | 6 + .../AI/NPC/fn_initMilitaryPatrol.sqf | 1 - .../functions/actions/fn_buy.sqf | 5 + .../functions/actions/fn_recruitCiv.sqf | 7 +- .../functions/factions/NATO/fn_initNATO.sqf | 21 ++ .../overthrow_main/functions/fn_canPlace.sqf | 3 +- .../overthrow_main/functions/fn_getOwner.sqf | 5 +- .../overthrow_main/functions/fn_setOwner.sqf | 5 +- addons/overthrow_main/ui/dialogs/build.hpp | 38 +++- .../ui/items/fertilizer_x_ca.paa | Bin 0 -> 43616 bytes 34 files changed, 750 insertions(+), 131 deletions(-) create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf create mode 100644 addons/overthrow_main/ui/items/fertilizer_x_ca.paa diff --git a/addons/overthrow_main/CfgWeapons.hpp b/addons/overthrow_main/CfgWeapons.hpp index 4df52055..d2343f8b 100644 --- a/addons/overthrow_main/CfgWeapons.hpp +++ b/addons/overthrow_main/CfgWeapons.hpp @@ -76,4 +76,14 @@ class CfgWeapons { mass = 30; }; }; + class OT_Fertilizer: OT_ItemCore { + scope = 2; + picture = "\ot\ui\items\fertilizer_x_ca.paa"; + displayName = "Fertilizer"; + descriptionShort = "A material of natural or synthetic origin that is applied to soils or to plant tissues (usually leaves) to supply one or more plant nutrients essential to the growth of plants."; + descriptionUse = ""; + class ItemInfo: InventoryItem_Base_F { + mass = 80; + }; + }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf index 0aa7e70c..b7ecddf2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf @@ -1,5 +1,7 @@ params ["_vehtypes","_hvts","_from","_to"]; +private _abandoned = server getvariable ["NATOabandoned",[]]; +if(_from in _abandoned) exitWith {}; private _frompos = server getvariable _from; private _fromregion = _frompos call OT_fnc_getRegion; @@ -8,25 +10,38 @@ private _topos = server getvariable _to; private _dir = [_frompos,_topos] call BIS_fnc_dirTo; private _group = creategroup blufor; +_group setBehaviour "CARELESS"; private _track = objNull; if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then { - _convoypos = _frompos; + _convoypos = [_frompos,random 360,120] call SHK_pos; + private _road = [_convoypos] call BIS_fnc_nearestRoad; + if (!isNull _road) then { + _roadscon = roadsConnectedto _road; + if (count _roadscon == 2) then { + _posVeh = (getpos _road) findEmptyPosition [0,15,_vehtypes select 0]; + if(count _posVeh > 0) then { + _convoypos = _posVeh; + _dir = [_road, _roadscon select 0] call BIS_fnc_DirTo; + }; + }; + }; { - _pos = [_convoypos,0,120,false,[0,0],[250,_x]] call SHK_pos; + _pos = _convoypos; _veh = createVehicle [_x, _pos, [], 0,""]; _veh setVariable ["garrison","HQ",false]; _veh setDir (_dir); _group addVehicle _veh; createVehicleCrew _veh; + _driver = driver _veh; + _driver disableAI "AUTOCOMBAT"; { [_x] joinSilent _group; _x setVariable ["garrison","HQ",false]; - _x setVariable ["NOAI",true,false]; - _x disableAI "AUTOCOMBAT"; }foreach(crew _veh); - _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos; + _driver assignAsCommander _veh; + _convoypos = [_convoypos,20,_dir+180] call BIS_fnc_relPos; sleep 0.1; }foreach(_vehtypes); @@ -38,20 +53,20 @@ if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then { _veh setDir (_dir); _group addVehicle _veh; createVehicleCrew _veh; + + _driver = driver _veh; + _driver disableAI "AUTOCOMBAT"; { [_x] joinSilent _group; _x setVariable ["garrison","HQ",false]; - _x setVariable ["NOAI",true,false]; - _x disableAI "AUTOCOMBAT"; }foreach(crew _veh); - - _lead = leader _veh; - _lead setVariable ["hvt",true,true]; - _lead setVariable ["hvt_id",_x select 0,true]; - _lead setRank "COLONEL"; + _driver assignAsCommander _veh; + _driver setVariable ["hvt",true,true]; + _driver setVariable ["hvt_id",_x select 0,true]; + _driver setRank "COLONEL"; if(isNull _track) then {_track = _lead}; - _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos; + _convoypos = [_convoypos,20,_dir] call BIS_fnc_relPos; sleep 0.1; _x set [2,"CONVOY"]; @@ -59,30 +74,32 @@ if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then { private _numsupport = 2; - private _count = 0; - while {_count < _numsupport} do { - _vehtype = selectRandom OT_NATO_Vehicles_GroundSupport; - _pos = [_convoypos,0,120,false,[0,0],[250,_vehtype]] call SHK_pos; - _veh = createVehicle [_vehtype, _pos, [], 0,""]; - _veh setVariable ["garrison","HQ",false]; - - _veh setDir (_dir); - _group addVehicle _veh; - createVehicleCrew _veh; - { - [_x] joinSilent _group; - _x setVariable ["garrison","HQ",false]; - _x setVariable ["NOAI",true,false]; - _x disableAI "AUTOCOMBAT"; - }foreach(crew _veh); - _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos; - _count = _count + 1; - sleep 0.1; + if(count _hvts > 0) then { + private _count = 0; + while {_count < _numsupport} do { + _vehtype = selectRandom OT_NATO_Vehicles_GroundSupport; + _pos = [_convoypos,0,120,false,[0,0],[250,_vehtype]] call SHK_pos; + _veh = createVehicle [_vehtype, _pos, [], 0,""]; + _veh setVariable ["garrison","HQ",false]; + _veh setDir (_dir); + _group addVehicle _veh; + createVehicleCrew _veh; + _driver = driver _veh; + _driver disableAI "AUTOCOMBAT"; + { + [_x] joinSilent _group; + _x setVariable ["garrison","HQ",false]; + }foreach(crew _veh); + _driver assignAsCommander _veh; + _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos; + _count = _count + 1; + sleep 0.1; + }; }; sleep 5; _wp = _group addWaypoint [asltoatl _topos,50]; _wp setWaypointType "MOVE"; - _wp setWaypointBehaviour "SAFE"; + _wp setWaypointBehaviour "CARELESS"; _wp setWaypointSpeed "LIMITED"; _wp setWaypointTimeout [60,60,60]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf new file mode 100644 index 00000000..ff8bff81 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf @@ -0,0 +1,21 @@ +_leader = _this; + +_group = group _leader; +private _targetPos = _leader getVariable ["OT_targetPos",objNull]; +private _veh = vehicle _leader; + +{ + unassignVehicle _x; +}foreach(units _group); +(units _group) allowGetIn false; + +sleep 10; +if(({alive _x} count (units _group)) == 0) exitWith {}; + +if(!isNull _veh) then {deleteVehicle _veh}; +_flag = OT_flag_NATO createVehicle _targetPos; + +private _fobs = server getVariable ["NATOfobs",[]]; +_fobs pushback [_targetPos,count units _group,[]]; +server setVariable ["NATOfobs",_fobs,true]; +_group call OT_fnc_initMilitaryPatrol; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf new file mode 100644 index 00000000..dcd704dd --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf @@ -0,0 +1,142 @@ +params ["_posTarget"]; + +private _close = nil; +private _dist = 4000; +private _closest = ""; +private _abandoned = server getVariable["NATOabandoned",[]]; +{ + _pos = _x select 0; + _name = _x select 1; + if(([_pos,_posTarget] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then { + _d = (_pos distance _posTarget); + if(_d < _dist) then { + _dist = _d; + _close = _pos; + _closest = _name; + }; + }; +}foreach(OT_NATOobjectives); +_isHQ = false; +if(isNil "_close") then { + _isHQ = true; + _close = OT_NATO_HQPos; +}; +_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; +_group = [_start, WEST, OT_NATO_Group_Engineers] call BIS_fnc_spawnGroup; +_group call distributeAILoad; +sleep 0.5; + +_dir = [_start,_posTarget] call BIS_fnc_dirTo; + +if(_isHQ) then { + _attackpos = [_posTarget,[0,150]] call SHK_pos; + + //Determine direction to attack from (preferrably away from water) + _attackdir = random 360; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 180; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 90; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { + _attackdir = _attackdir + 180; + if(_attackdir > 359) then {_attackdir = _attackdir - 359}; + }; + }; + }; + _attackdir = _attackdir - 45; + _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos; + _tgroup = creategroup blufor; + + _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; + _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos; + _veh setDir _dir; + _tgroup addVehicle _veh; + + _tgroup call distributeAILoad; + + createVehicleCrew _veh; + { + [_x] joinSilent _tgroup; + _x setVariable ["garrison","HQ",false]; + _x setVariable ["NOAI",true,false]; + }foreach(crew _veh); + + { + _x moveInCargo _veh; + _x setVariable ["garrison","HQ",false]; + }foreach(units _group); + + sleep 2; + + _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointCompletionRadius 150; + _wp setWaypointStatements ["true","(vehicle this) flyInHeight 100;"]; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"]; + _wp setWaypointCompletionRadius 50; + _wp setWaypointSpeed "FULL"; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","[vehicle this,75] spawn OT_fnc_parachuteAll"]; + _wp setWaypointTimeout [10,10,10]; + + _wp = _tgroup addWaypoint [_ao,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; + _wp setWaypointTimeout [15,15,15]; + + _moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; + + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "LOITER"; + _wp setWaypointBehaviour "CARELESS"; + _wp setWaypointSpeed "FULL"; + _wp setWaypointCompletionRadius 100; + + _wp = _tgroup addWaypoint [_moveto,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"]; + + { + _x addCuratorEditableObjects [units _tgroup,true]; + } forEach allCurators; +}else{ + _convoypos = [_close,random 360,120] call SHK_pos; + private _road = [_convoypos] call BIS_fnc_nearestRoad; + if (!isNull _road) then { + _convoypos = (getpos _road); + }; + _spawnpos = _convoypos findEmptyPosition [0,100,OT_NATO_Vehicle_Transport_Light]; + _veh = OT_NATO_Vehicle_Transport_Light createVehicle _spawnpos; + _group addVehicle _veh; + + { + _x moveInAny _veh; + }foreach(units _group); +}; +{ + _x addCuratorEditableObjects [units _group,true]; +} forEach allCurators; +sleep 2; + +//This squad operates in stealth mode, therefore does not respond to calls for help from other units +{ + _x setVariable ["VCOM_NOPATHING_Unit",true,false]; + _x setVariable ["OT_targetPos",_posTarget,true]; +}foreach(units _group); + +_wp = _group addWaypoint [_posTarget,0]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "CARELESS"; +_wp setWaypointSpeed "FULL"; +_wp setWaypointStatements ["true","this spawn OT_fnc_NATODeployFOB"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf new file mode 100644 index 00000000..ddfb94d4 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf @@ -0,0 +1,41 @@ +params ["_mortar","_mortargroup"]; + +while {sleep 5+(random 5); ("8Rnd_82mm_Mo_shells" in getArtilleryAmmo[_mortar]) and (alive _mortar) and ({alive _x} count (units _mortargroup)) > 0} do { + private _attacking = server getVariable ["NATOattacking",""]; + if(_attacking != "" and !(_attacking in OT_allTowns)) then { + _pos = server getvariable _attacking; + _distance = (_pos distance _mortar); + + _timesince = time - (server getVariable ["NATOattackstart",time]); + if(_timesince < 300) then { + if (_distance < 4000 and _distance > 500) then { + _mortargroup setCombatMode "RED"; + _p = [[[_pos,300]]] call SHK_pos; + _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1]; + sleep 3+(random 3); + _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1]; + sleep 3; + _mortargroup setCombatMode "BLUE"; + }; + }; + }else{ + private _targets = [spawner getVariable ["NATOknownTargets",[]],[],{_x select 2},"DESCEND"] call BIS_fnc_SortBy; + { + _x params ["_ty","_pos","_pri","_obj","_done"]; + _distance = (_pos distance _mortar); + if (_distance < 4000 and _distance > 250 and !_done) exitWith { + _x set [4,true]; + _mortargroup setCombatMode "RED"; + + _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1]; + sleep 3+(random 3); + _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1]; + sleep 3+(random 3); + _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1]; + sleep 3; + _mortargroup setCombatMode "BLUE"; + }; + }foreach(_targets); + spawner setVariable ["NATOknowntargets",_targets,true]; + }; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf new file mode 100644 index 00000000..23f4804a --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf @@ -0,0 +1,92 @@ +params ["_pos","_upgrades"]; + +{ + if(_x == "Barriers") then { + _p = [_pos,8,0] call BIS_fnc_relPos; + _v = OT_NATO_Barrier_Small createVehicle _p; + _v setDir 180; + + sleep 0.1; + + _p = [_pos,8,180] call BIS_fnc_relPos; + _v = OT_NATO_Barrier_Small createVehicle _p; + _v setDir 0; + + sleep 0.1; + + _p = [_pos,7,270] call BIS_fnc_relPos; + _v = OT_NATO_Barrier_Large createVehicle _p; + _v setDir 270; + + sleep 0.1; + + _p = [_pos,7,90] call BIS_fnc_relPos; + _v = OT_NATO_Barrier_Large createVehicle _p; + _v setDir 90; + }; + if(_x == "HMG") then { + _gun = OT_NATO_StaticGarrison_LevelOne select 0; + + _p = [_pos,8.5,45] call BIS_fnc_relPos; + _v = _gun createVehicle _p; + _v setDir 45; + createVehicleCrew _v; + + sleep 0.1; + + _p = [_pos,10,45] call BIS_fnc_relPos; + _v = OT_NATO_Sandbag_Curved createVehicle _p; + _v setDir 225; + + _p = [_pos,8.5,135] call BIS_fnc_relPos; + _v = _gun createVehicle _p; + _v setDir 135; + createVehicleCrew _v; + + sleep 0.1; + + _p = [_pos,10,135] call BIS_fnc_relPos; + _v = OT_NATO_Sandbag_Curved createVehicle _p; + _v setDir 315; + + _p = [_pos,8.5,225] call BIS_fnc_relPos; + _v = _gun createVehicle _p; + _v setDir 225; + createVehicleCrew _v; + + sleep 0.1; + + _p = [_pos,10,225] call BIS_fnc_relPos; + _v = OT_NATO_Sandbag_Curved createVehicle _p; + _v setDir 45; + + _p = [_pos,8.5,315] call BIS_fnc_relPos; + _v = _gun createVehicle _p; + _v setDir 315; + createVehicleCrew _v; + + sleep 0.1; + + _p = [_pos,10,315] call BIS_fnc_relPos; + _v = OT_NATO_Sandbag_Curved createVehicle _p; + _v setDir 135; + }; + if(_x == "Mortar") then { + _p = _pos findEmptyPosition [0,50,OT_NATO_Mortar]; + _v = OT_NATO_Mortar createVehicle _p; + createVehicleCrew _v; + + _g = grpNull; + { + _x disableAI "AUTOTARGET"; + _x disableAI "FSM"; + _x disableAI "AUTOCOMBAT"; + _x setVariable ["NOAI",true,false]; + _g = group _x; + }foreach(crew _v); + _g setCombatMode "BLUE"; + [_v,_g] spawn OT_fnc_NATOMortar; + }; + + sleep 0.1; +}foreach(_upgrades); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf index 43a03966..5d2b62b3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf @@ -203,6 +203,22 @@ if(typename _b == "ARRAY") then { Damage: %2%3 ",_ownername,round((damage _building) * 100),"%"]; }; + if(typeof _building == OT_trainingCamp) then { + _owner = _building call OT_fnc_getOwner; + _ownername = server getVariable format["name%1",_owner]; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlEnable [1609,true]; + ctrlSetText [1609,"Recruit"]; + //ctrlEnable [1609,false]; + //ctrlEnable [1610,false]; + + _buildingTxt = format[" + Training Camp
+ Built by %1
+ Damage: %2%3 + ",_ownername,round((damage _building) * 100),"%"]; + }; if(damage _building == 1) then { if((_owner == getplayerUID player) or (call OT_fnc_playerIsGeneral)) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf index 3d546767..3191c887 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf @@ -1,29 +1,43 @@ +_b = player call OT_fnc_nearestRealEstate; +_building = objNull; +if(typename _b != "ARRAY") exitWith {}; +_building = (_b select 0); +if(damage _building == 1) exitWith {"Must repair before you can recruit" call OT_fnc_notifyMinor}; + disableSerialization; -_base = (getpos player) call OT_fnc_nearestObjective; -if (isNil "_base") exitWith {}; -if !((_base select 1) in (server getvariable "NATOabandoned")) exitWith {"This barracks is under NATO control" call OT_fnc_notifyMinor}; +_base = nil; +_good = true; +if(typeof _building == OT_barracks) then { + _base = (getpos player) call OT_fnc_nearestObjective; + if !((_base select 1) in (server getvariable "NATOabandoned")) then { + _good = false; + } +}; +if ((typeof _building == OT_barracks) and isNil "_base") exitWith {}; +if ((typeof _building == OT_barracks) and !_good) exitWith {"This barracks is under NATO control" call OT_fnc_notifyMinor}; private _price = floor((["Tanoa","CIV",0] call OT_fnc_getPrice) * 1.5); createDialog "OT_dialog_buy"; ctrlSetText [1600,"Recruit"]; lbClear 1500; -{ - _cls = _x select 0; - _comp = _x select 1; - _cost = (_price * count _comp); - - _idx = lbAdd [1500,_cls]; - lbSetValue [1500,_idx,_cost]; - lbSetData [1500,_idx,_cls]; -}foreach(OT_squadables); -{ +if (typeof _building == OT_barracks) then { + { + _cls = _x select 0; + _comp = _x select 1; + _cost = (_price * count _comp); + + _idx = lbAdd [1500,_cls]; + lbSetValue [1500,_idx,_cost]; + lbSetData [1500,_idx,_cls]; + }foreach(OT_squadables); +}; +{ _cls = _x select 0; _name = _cls call ISSE_Cfg_Vehicle_GetName; - + _idx = lbAdd [1500,_name]; lbSetValue [1500,_idx,_price]; lbSetData [1500,_idx,_cls]; }foreach(OT_recruitables); - diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf index c45cef9d..23a8bfad 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf @@ -20,7 +20,7 @@ if(damage _building == 1) exitWith { }; }; if(typeof _building == OT_policeStation) exitWith {[] call policeDialog}; -if(typeof _building == OT_barracks) exitWith {[] call recruitDialog}; +if((typeof _building == OT_barracks) or (typeof _building == OT_trainingCamp)) exitWith {[] call recruitDialog}; if(typeof _building == OT_warehouse) exitWith {[] call buyVehicleDialog}; if(typename _b != "ARRAY") 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 a918bfd8..2c8e755e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -9,8 +9,8 @@ _description = ""; modeFinished = false; modeCancelled = false; call { - if(_typecls == "Camp") exitWith {attachAt = [0,3.5,1.1];modeValues = [OT_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 = [OT_item_Flag];_cost=500;_description="Creates a fast travel destination for all friendlies and enables build mode for military structures"}; + if(_typecls == "Camp") exitWith {attachAt = [0,3.5,1.1];modeValues = [OT_item_Tent];_cost=40;_description="Creates a fast travel destination for all friendlies. Only one allowed per player, will remove any existing camps."}; + if(_typecls == "Base") exitWith {attachAt = [0,6,4];modeValues = [OT_item_Flag];_cost=250;_description="Creates a fast travel destination for all friendlies and enables build mode for basic military structures"}; if(_typecls == "Ammobox") exitWith {modeValues = [OT_item_Storage];_cost=60;_description="Another empty ammobox to fill with items you have acquired through.. various means."}; if(_typecls == "Whiteboard") exitWith {modeValues = [OT_item_Map];_cost=20;_description="Plan out your next assault in the middle of the jungle."}; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index a64eee24..c3876663 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -137,6 +137,23 @@ while {true} do { _outnum = round (_outnum * (_inputnum / _intotal)); }; if(_output != "" and _outnum > 0) then { + if(_output in ["OT_Sugarcane","ACE_Banana"]) then { + _foundFertilizer = false; + { + _c = _x; + { + _x params ["_cls","_amt"]; + if(_cls == "OT_Fertilizer") exitWith { + [_c, _cls, 1] call CBA_fnc_removeItemCargo; + _foundFertilizer = true; + }; + }foreach(_c call OT_fnc_unitStock); + if(_foundFertilizer) exitWith {}; + }foreach(_pos nearObjects [OT_item_CargoContainer, 50]); + if(_foundFertilizer) then { + _output = round(_output * 1.5); + }; + }; _container addItemCargoGlobal [_output,_outnum]; }; }; @@ -164,6 +181,11 @@ while {true} do { [_town,-1] call stability; }; }; + }else{ + _numcops = {side _x == west} count (_townpos nearObjects ["CAManBase",600]); + if(_numcops > 0) then { + [_town,-1] call stability; + }; }; }foreach(OT_allTowns); }; 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 1d8746a9..0205864e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -16,18 +16,17 @@ private _lastsched = -1; while {sleep 10;true} do { private _numplayers = count([] call CBA_fnc_players); if(_numplayers > 0) then { + _fobs = server getVariable ["NATOfobs",[]]; _abandoned = server getVariable ["NATOabandoned",[]]; _resources = server getVariable ["NATOresources",2000]; private _countered = (server getVariable ["NATOattacking",""]) != ""; - _knownTargets = spawner getVariable ["NATOknownTargets",[]]; - _schedule = server getVariable ["NATOschedule",[]]; //scheduler if(_lastmin != (date select 4)) then { - private _lastmin = date select 4; + _lastmin = date select 4; if(count _schedule > 0) then { _item = []; if((_lastsched == -1 or _lastsched == 0) and _lastmin >= 30) then { @@ -41,14 +40,20 @@ while {sleep 10;true} do { }; if(count _item > 0) then { _schedule deleteAt 0; - _item params ["_mission","_ty","_pos"]; + _item params ["_mission","_p1","_p2"]; if(_mission == "DESTROY") then { - [_pos] spawn OT_fnc_NATOMissionReconDestroy; + [_p2] spawn OT_fnc_NATOMissionReconDestroy; + }; + if(_mission == "CONVOY") then { + _vehtypes = []; + _numveh = round(random 2) + 2; + _count = 0; + while {_count < _numveh} do { + _count = _count + 1; + _vehtypes pushback (selectRandom OT_NATO_Vehicles_Convoy); + }; + [_vehtypes,[],_p1 select 1,_p2 select 1] spawn OT_fnc_NATOConvoy; }; - }; - if(_lastmin == 0 or _lastmin == 30) then { - _item = _schedule select 0; - }; }; }; @@ -126,6 +131,25 @@ while {sleep 10;true} do { }foreach (_sorted); }; + //Check on FOBs + _clearedFOBs = []; + { + _x params ["_pos","_garrison"]; + _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]); + _numres = {side _x == resistance or captive _x} count (_pos nearObjects 50); + if(_nummil == 0 and _numres > 0) then { + _clearedFOBs pushback _x; + "Cleared NATO FOB" remoteExec ["OT_fnc_notifyMinor",0,false]; + _flag = _pos nearobjects [OT_flag_NATO,50]; + if(count _flag > 0) then{ + deleteVehicle (_flag select 0); + }; + }; + }foreach(_fobs); + + { + _fobs deleteAt (_fobs find _x); + }foreach(_clearedFOBs); if(_count >= _nextturn and !_countered) then { @@ -274,6 +298,36 @@ while {sleep 10;true} do { _spend = 1200; }; + if((_spend > 1000) and (count _fobs) < 3 and (random 100) > 0) then { + //Deploy an FOB + _lowest = ""; + { + _stability = server getVariable [format["stability%1",_x],100]; + if((_x in _abandoned) or _stability < 50) exitWith { + _lowest = _x; + }; + }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); + if(_lowest != "") then { + _townPos = (server getVariable _lowest); + _pp = [_townPos,random 360,2000] call SHK_pos; + _gotpos = []; + { + _pos = _x select 0; + _pos set [2,0]; + _bb = _pos call OT_fnc_nearestObjective; + _bpos = _bb select 0; + if((_pos distance _bpos) > 400 and (_pos distance _townPos) > 250) exitWith { + _gotpos = _pos; + }; + }foreach (selectBestPlaces [_pp, 1000,"(1 - forest - trees) * (1 - houses) * (1 - sea)",5,4]); + if(count _gotpos > 0) then { + _spend = _spend - 1000; + _resources = _resources - 1000; + [_gotpos] spawn OT_fnc_NATOMissionDeployFOB; + }; + }; + }; + //Schedule some missions if(_spend > 0) then { _targets = [_knownTargets,[],{_x select 2},"DESCEND"] call BIS_fnc_sortBy; @@ -281,7 +335,7 @@ while {sleep 10;true} do { _x params ["_ty","_pos","_pri","_obj","_done"]; if !(_done) then { if(_ty == "WH" or _ty == "PS" or _ty == "WS") then { - if(_spend > 250) then { + if(_spend > 250 and (random 100) > 95) then { _schedule pushback ["DESTROY",_ty,_pos]; _spend = _spend - 250; _resources = _resources -250; @@ -290,9 +344,113 @@ while {sleep 10;true} do { }; }; }foreach(_targets); + if(_spend > 500 and (random 100) > 95) then { + _low = 50; + _lowest = ""; + { + _stability = server getVariable [format["stability%1",_x],100]; + if(!(_x in _abandoned) and _stability < _low) exitWith { + _lowest = _x; + }; + }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); + + if(_lowest == "") then { + //Could not find NATO controlled town under 50% stability, looking for resistance-controlled town above 50% + { + _stability = server getVariable [format["stability%1",_x],100]; + if((_x in _abandoned) and _stability > _low) exitWith { + _lowest = _x; + }; + }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); + }; + + if(_lowest != "") then { + _townPos = server getVariable _lowest; + _start = ([OT_NATOobjectives,[],{(_x select 0) distance _townPos},"ASCEND"] call BIS_fnc_SortBy) select 0; + _startName = _start select 1; + _startPos = _start select 0; + _end = []; + { + _x params ["_p","_n"]; + if((_n != _startName) and !(_n in _abandoned) and ([_p,_startPos] call OT_fnc_regionIsConnected)) exitWith { + _end = _x; + }; + }foreach([OT_NATOobjectives,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); + if(count _end > 0) then { + //Schedule a convoy + _spend = _spend - 500; + _resources = _resources - 500; + _schedule pushback ["CONVOY",_start,_end]; + }; + }; + }; }; + //Upgrade garrisons + { + _x params ["_pos","_name","_pri"]; + if !(_name in _abandoned) then { + _garrison = server getvariable [format["garrison%1",_name],0]; + _max = 8; + if(_pri > 300) then { + _max = 12; + }; + if(_pri > 800) then { + _max = 24; + }; + if(_pri > 1200) then { + _max = 32; + }; + if(!(_pos call OT_fnc_inSpawnDistance) and (_garrison < _max) and (_spend > 150) and (random 100 > 95)) then { + server setvariable [format["garrison%1",_name],_garrison+4,true]; + _spend = _spend - 150; + _resources = _resources - 150; + }; + }; + }foreach(OT_NATOobjectives); + //Upgrade FOBs + { + _x params ["_pos","_garrison","_upgrades"]; + _max = 16; + if((_garrison < _max) and (_spend > 150) and (random 100 > 95)) exitWith { + _x set [1,_garrison + 4]; + _spend = _spend - 150; + _resources = _resources - 150; + _group = creategroup blufor; + _count = 0; + while {_count < 4} do { + _start = [[[_pos,50]]] call BIS_fnc_randomPos; + + _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"]; + _civ setVariable ["garrison","HQ",false]; + _civ setRank "LIEUTENANT"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + _civ setBehaviour "SAFE"; + + _count = _count + 1; + }; + _group call OT_fnc_initMilitaryPatrol; + }; + if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > 0)) exitWith { + _spend = _spend - 300; + _resources = _resources - 300; + _upgrades pushback "Mortar"; + [_pos,["Mortar"]] spawn OT_fnc_NATOupgradeFOB; + }; + if(!("Barriers" in _upgrades) and (_spend > 50) and (random 100 > 95)) exitWith { + _spend = _spend - 50; + _resources = _resources - 50; + _upgrades pushback "Barriers"; + [_pos,["Barriers"]] spawn OT_fnc_NATOupgradeFOB; + }; + if(!("HMG" in _upgrades) and (_spend > 150) and (random 100 > 95)) exitWith { + _spend = _spend - 150; + _resources = _resources - 150; + _upgrades pushback "HMG"; + [_pos,["HMG"]] spawn OT_fnc_NATOupgradeFOB; + }; + }foreach(_fobs); }; //Finish if(_resources > 2500) then {_resources = 2500}; @@ -300,6 +458,7 @@ while {sleep 10;true} do { server setVariable ["NATOabandoned",_abandoned,true]; spawner setVariable ["NATOknownTargets",_knownTargets,true]; server setVariable ["NATOschedule",_schedule,true]; + server setVariable ["NATOfobs",_fobs,true]; }; _count = _count + 1; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 758f6b27..4c6d1f61 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -18,6 +18,10 @@ playerDecision = compileFinal preProcessFileLineNumbers "funcs\playerDecision.sq OT_fnc_NATOConvoy = compileFinal preProcessFileLineNumbers "AI\fn_NATOConvoy.sqf"; OT_fnc_NATOMissionReconDestroy = compileFinal preProcessFileLineNumbers "AI\fn_NATOMissionReconDestroy.sqf"; OT_fnc_NATOSetExplosives = compileFinal preProcessFileLineNumbers "AI\fn_NATOSetExplosives.sqf"; +OT_fnc_NATOMissionDeployFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATOMissionDeployFOB.sqf"; +OT_fnc_NATODeployFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATODeployFOB.sqf"; +OT_fnc_NATOupgradeFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATOupgradeFOB.sqf"; +OT_fnc_NATOMortar = compileFinal preProcessFileLineNumbers "AI\fn_NATOMortar.sqf"; //UI mainMenu = compileFinal preProcessFileLineNumbers "UI\mainMenu.sqf"; @@ -226,9 +230,10 @@ OT_fnc_lockVehicle = { OT_fnc_squadAssignVehicle = { _squad = (hcselected player) select 0; _veh = cursorObject; + if((_veh isKindOf "Air") or (_veh isKindOf "Land") or (_veh isKindOf "Ship")) then { + _squad setVariable ["OT_assigned",_veh,false]; _squad addVehicle _veh; - [] call OT_fnc_squadGetIn; player hcSelectGroup [_squad,false]; format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call OT_fnc_notifyMinor; }; @@ -236,16 +241,20 @@ OT_fnc_squadAssignVehicle = { OT_fnc_squadGetIn = { { - _squad = _x; - (units _squad) orderGetIn true; - player hcSelectGroup [_squad,false]; + _veh = _x getVariable ["OT_assigned",objNull]; + (units _x) allowGetIn true; + if !(isNull _veh) then { + _x addVehicle _veh; + }; + player hcSelectGroup [_x,false]; }foreach(hcSelected player); }; OT_fnc_squadGetOut = { { _squad = _x; - (units _squad) orderGetIn false; + { unassignVehicle _x } forEach (units _squad); + (units _squad) allowGetIn false; player hcSelectGroup [_squad,false]; }foreach(hcSelected player); }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 3ce189de..70500549 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -377,7 +377,9 @@ player addEventHandler ["GetInMan",{ if !(_veh call OT_fnc_hasOwner) then { [_veh,getplayeruid player] call OT_fnc_setOwner; _veh setVariable ["stolen",true,true]; - [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing; + if(_veh getVariable ["ambient",false]) then { + [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing; + }; }else{ if !(_veh call OT_fnc_playerIsOwner) then { if(!_isgen and (_veh getVariable ["OT_locked",false])) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 858c08b9..f8808e32 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck 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 = 30; //Half the Average time between NATO orders (x 10 seconds) +OT_NATOwait = 3; //Half the Average time between NATO orders (x 10 seconds) OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house @@ -144,7 +144,7 @@ OT_faces_western = ["WhiteHead_1","WhiteHead_2","WhiteHead_3","WhiteHead_4","Whi OT_faces_eastern = ["AsianHead_A3_01","AsianHead_A3_02","AsianHead_A3_03","AsianHead_A3_04","AsianHead_A3_05","AsianHead_A3_06","AsianHead_A3_07"]; OT_face_localBoss = "TanoanBossHead"; -OT_Resources = ["OT_Wood","OT_Steel","OT_Plastic","OT_Sugarcane","OT_Sugar"]; +OT_Resources = ["OT_Wood","OT_Steel","OT_Plastic","OT_Sugarcane","OT_Sugar","OT_Fertilizer"]; OT_civType_gunDealer = "C_man_p_fugitive_F"; OT_civType_local = "C_man_1"; @@ -155,7 +155,8 @@ OT_civType_priest = "C_man_w_worker_F"; OT_vehTypes_civ = []; //populated automatically, but you can add more here and they will appear in streets OT_vehType_distro = "C_Van_01_box_F"; OT_vehType_ferry = "C_Boat_Transport_02_F"; -OT_vehTypes_civignore = ["C_Hatchback_01_F","C_Hatchback_01_sport_F"]; //Civs cannot drive these vehicles for whatever reason +OT_vehType_service = "C_Offroad_01_repair_F"; +OT_vehTypes_civignore = ["C_Hatchback_01_F","C_Hatchback_01_sport_F",OT_vehType_service]; //Civs cannot drive these vehicles for whatever reason OT_item_CargoContainer = "B_Slingload_01_Cargo_F"; @@ -170,7 +171,7 @@ OT_item_BasicGun = "hgun_P07_F";//Player starts with this weapon in their ammobo OT_item_BasicAmmo = "16Rnd_9x21_Mag"; if(OT_hasAce) then { - OT_consumableItems = ["ACE_fieldDressing","ACE_Sandbag_empty","ACE_elasticBandage","ItemMap","ToolKit","ACE_epinephrine"]; //Shops will try to stock more of these + OT_consumableItems = ["ACE_fieldDressing","ACE_Sandbag_empty","ACE_elasticBandage","ItemMap","ToolKit","ACE_epinephrine","OT_Fertilizer"]; //Shops will try to stock more of these }else{ OT_consumableItems = ["FirstAidKit","Medikit","ItemMap","ToolKit"]; }; @@ -237,25 +238,34 @@ OT_NATO_Vehicle_PoliceHeli = "B_Heli_Light_01_F"; OT_NATO_Vehicle_Quad = "B_Quadbike_01_F"; OT_NATO_Vehicle_Police = "B_GEN_Offroad_01_gen_F"; OT_NATO_Vehicle_Transport = ["B_T_Truck_01_transport_F","B_T_Truck_01_covered_F"]; +OT_NATO_Vehicle_Transport_Light = "B_CTRG_LSV_01_light_F"; OT_NATO_Vehicles_PoliceSupport = ["B_T_MRAP_01_hmg_F","B_T_MRAP_01_gmg_F","B_T_LSV_01_armed_F","B_Heli_Light_01_armed_F"]; OT_NATO_Vehicles_ReconDrone = "B_UAV_01_F"; OT_NATO_Vehicles_CASDrone = "B_UAV_02_CAS_F"; OT_NATO_Vehicles_AirSupport = ["B_Heli_Attack_01_F"]; OT_NATO_Vehicles_AirSupport_Small = ["B_Heli_Light_01_armed_F"]; OT_NATO_Vehicles_GroundSupport = ["B_T_MRAP_01_gmg_F","B_T_MRAP_01_hmg_F","B_T_LSV_01_armed_F"]; +OT_NATO_Vehicles_Convoy = ["B_UGV_01_rcws_F","B_T_MRAP_01_hmg_F","B_T_LSV_01_armed_F","B_T_LSV_01_armed_F","B_T_LSV_01_armed_F"]; OT_NATO_Vehicles_AirWingedSupport = ["B_Plane_CAS_01_F"]; OT_NATO_Vehicle_AirTransport_Small = "B_Heli_Transport_01_camo_F"; OT_NATO_Vehicle_AirTransport = ["B_Heli_Transport_03_F","B_Heli_Transport_01_F","B_Heli_Transport_01_F"]; OT_NATO_Vehicle_AirTransport_Large = "B_Heli_Transport_03_F"; OT_NATO_Vehicle_Boat_Small = "B_Boat_Armed_01_minigun_F"; +OT_NATO_Sandbag_Curved = "Land_BagFence_01_round_green_F"; +OT_NATO_Barrier_Small = "Land_HBarrier_01_line_5_green_F"; +OT_NATO_Barrier_Large = "Land_HBarrier_01_wall_6_green_F"; + OT_NATO_GroundForces = ["B_T_InfSquad_Weapons","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad"]; OT_NATO_Group_Recon = (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam"); +OT_NATO_Group_Engineers = (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> "B_T_Support_ENG"); OT_NATO_Unit_LevelOneLeader = "B_T_Soldier_TL_F"; OT_NATO_Units_LevelOne = ["B_T_Medic_F","B_T_Soldier_F","B_T_Soldier_LAT_F","B_T_Soldier_AAT_F","B_T_Soldier_AT_F","B_T_soldier_M_F","B_T_Soldier_GL_F","B_T_Soldier_AR_F"]; OT_NATO_Units_LevelTwo = OT_NATO_Units_LevelOne + ["B_T_Soldier_AA_F","B_T_Soldier_AAR_F","B_T_Soldier_AAA_F"]; +OT_NATO_Mortar = "B_T_Mortar_01_F"; + OT_NATO_Unit_Pilot = "B_T_Pilot_F"; OT_NATO_Unit_Sniper = "B_T_Sniper_F"; OT_NATO_Unit_Spotter = "B_T_Spotter_F"; @@ -410,6 +420,7 @@ cost setVariable ["OT_Steel",[30,0,0,0],true]; cost setVariable ["OT_Plastic",[20,0,0,0],true]; cost setVariable ["OT_Sugarcane",[15,0,0,0],true]; cost setVariable ["OT_Sugar",[25,0,0,0],true]; +cost setVariable ["OT_Fertilizer",[30,0,0,0],true]; if(OT_hasTFAR) then { [OT_backpacks,[ @@ -832,7 +843,7 @@ OT_attachments = []; OT_allWeapons = OT_allSubMachineGuns + OT_allAssaultRifles + OT_allMachineGuns + OT_allSniperRifles + OT_allHandGuns + OT_allMissileLaunchers + OT_allRocketLaunchers; if(isServer) then { - cost setVariable ["CIV",[100,0,0,0],true]; + cost setVariable ["CIV",[80,0,0,0],true]; cost setVariable ["WAGE",[5,0,0,0],true]; cost setVariable [OT_item_UAV,[200,0,0,1],true]; cost setVariable ["FUEL",[5,0,0,0],true]; @@ -897,16 +908,18 @@ OT_policeStation = "Land_Cargo_House_V3_F"; OT_warehouse = "Land_Warehouse_03_F"; OT_barracks = "Land_Barracks_01_grey_F"; OT_workshopBuilding = "Land_Cargo_House_V4_F"; +OT_refugeeCamp = "Land_Medevac_house_V1_F"; +OT_trainingCamp = "Land_IRMaskingCover_02_F"; OT_loadingMessages = ["Adding Hidden Agendas","Adjusting Bell Curves","Aesthesizing Industrial Areas","Aligning Covariance Matrices","Applying Feng Shui Shaders","Applying Theatre Soda Layer","Asserting Packed Exemplars","Attempting to Lock Back-Buffer","Binding Sapling Root System","Breeding Fauna","Building Data Trees","Bureacritizing Bureaucracies","Calculating Inverse Probability Matrices","Calculating Llama Expectoration Trajectory","Calibrating Blue Skies","Charging Ozone Layer","Coalescing Cloud Formations","Cohorting Exemplars","Collecting Meteor Particles","Compounding Inert Tessellations","Compressing Fish Files","Computing Optimal Bin Packing","Concatenating Sub-Contractors","Containing Existential Buffer","Debarking Ark Ramp","Debunching Unionized Commercial Services","Deciding What Message to Display Next","Decomposing Singular Values","Decrementing Tectonic Plates","Deleting Ferry Routes","Depixelating Inner Mountain Surface Back Faces","Depositing Slush Funds","Destabilizing Economic Indicators","Determining Width of Blast Fronts","Deunionizing Bulldozers","Dicing Models","Diluting Livestock Nutrition Variables","Downloading Satellite Terrain Data","Exposing Flash Variables to Streak System","Extracting Resources","Factoring Pay Scale","Fixing Election Outcome Matrix","Flood-Filling Ground Water","Flushing Pipe Network","Gathering Particle Sources","Generating Jobs","Gesticulating Mimes","Graphing Whale Migration","Hiding Willio Webnet Mask","Implementing Impeachment Routine","Increasing Accuracy of RCI Simulators","Increasing Magmafacation","Initializing Rhinoceros Breeding Timetable","Initializing Robotic Click-Path AI","Inserting Sublimated Messages","Integrating Curves","Integrating Illumination Form Factors","Integrating Population Graphs","Iterating Cellular Automata","Lecturing Errant Subsystems","Mixing Genetic Pool","Modeling Object Components","Mopping Occupant Leaks","Normalizing Power","Obfuscating Quigley Matrix","Overconstraining Dirty Industry Calculations","Partitioning City Grid Singularities","Perturbing Matrices","Pixellating Nude Patch","Polishing Water Highlights","Populating Lot Templates","Preparing Sprites for Random Walks","Prioritizing Landmarks","Projecting Law Enforcement Pastry Intake","Realigning Alternate Time Frames","Reconfiguring User Mental Processes","Relaxing Splines","Removing Road Network Speed Bumps","Removing Texture Gradients","Removing Vehicle Avoidance Behavior","Resolving GUID Conflict","Reticulating Splines","Retracting Phong Shader","Retrieving from Back Store","Reverse Engineering Image Consultant","Routing Neural Network Infanstructure","Scattering Rhino Food Sources","Scrubbing Terrain","Searching for Llamas","Seeding Architecture Simulation Parameters","Sequencing Particles","Setting Advisor ","Setting Inner Deity ","Setting Universal Physical Constants","Sonically Enhancing Occupant-Free Timber","Speculating Stock Market Indices","Splatting Transforms","Stratifying Ground Layers","Sub-Sampling Water Data","Synthesizing Gravity","Synthesizing Wavelets","Time-Compressing Simulator Clock","Unable to Reveal Current Activity","Weathering Buildings","Zeroing Crime Network"]; OT_allBuyableBuildings = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_item_Tent,OT_item_Flag]; -OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,OT_workshopBuilding]; +OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,OT_workshopBuilding,OT_refugeeCamp,OT_trainingCamp]; OT_Buildables = [ - ["Training Camp",1200,[] call compileFinal preProcessFileLineNumbers "templates\military\trainingCamp.sqf","structures\trainingCamp.sqf",true,"Allows training of recruits and hiring of mercenaries"], + ["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"], + ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Informs helicopter pilots of where might be a nice place to land"], ["Observation Post",800,["Land_Cargo_Patrol_V4_F"],"structures\observationPost.sqf",false,"Includes unarmed personnel to keep an eye over the area and provide intel on enemy positions"], ["Barracks",5000,[OT_barracks],"",false,"Allows recruiting of squads"], ["Guard Tower",5000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need?."], @@ -914,7 +927,8 @@ OT_Buildables = [ ["Workshop",1000,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"Attach weapons to vehicles"], ["House",1100,["Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_GarageShelter_01_F","Land_Slum_04_F"],"",false,"4 walls, a roof, and if you're lucky a door that opens."], ["Police Station",2500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."], - ["Warehouse",4000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."] + ["Warehouse",4000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."], + ["Refugee Camp",600,[OT_refugeeCamp],"",false,"Attracts scared civilians that are more likely to join your cause"] ]; OT_workshop = [ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf index 47de8ae1..ca9c1804 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf @@ -6,7 +6,7 @@ _key = _this select 1; if (_key == 21) then { if(!dialog) then { - if(count (player nearObjects ["Land_Cargo_House_V4_F",10]) > 0) then { + if(count (player nearObjects [OT_workshopBuilding,10]) > 0) then { [] call workshopDialog; }else{ if((vehicle player) != player and count (player nearObjects [OT_portBuilding,30]) > 0) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index c9a6e05f..9d05d461 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm @@ -8,7 +8,7 @@ class EditorData toggles=522; class ItemIDProvider { - nextID=2097; + nextID=2109; }; class MarkerIDProvider { @@ -16,14 +16,14 @@ class EditorData }; class LayerIndexProvider { - nextID=259; + nextID=274; }; class Camera { - pos[]={12686.042,114.2223,5353.1509}; - dir[]={-0.60531187,-0.5580765,-0.56759191}; - up[]={-0.40710393,0.8297838,-0.38173577}; - aside[]={-0.68401688,-1.1379598e-008,0.72947484}; + pos[]={12880.063,4.9866929,4514.0859}; + dir[]={0.7855866,-0.51558232,0.34234276}; + up[]={0.47268483,0.85680676,0.20598541}; + aside[]={0.39953578,-1.2495075e-006,-0.91682374}; }; }; binarizationWanted=0; 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 bd767db3..4612f84b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf @@ -44,6 +44,7 @@ while {(_count < _numVeh)} do { if(count _posVeh > 0) then { _veh = _vehtype createVehicle _posVeh; + _veh setVariable ["ambient",true,true]; clearItemCargoGlobal _veh; _veh setFuel (0.2 + (random 0.5)); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf index 029bc769..134bec24 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf @@ -158,12 +158,12 @@ _road = objNull; if(count _pos > 0) then { _dir = [_posTown,_pos] call BIS_fnc_dirTo; _p = [_pos,1.5,_dir] call BIS_fnc_relPos; - _veh = "Land_BagFence_Round_F" createVehicle _p; + _veh = OT_NATO_Sandbag_Curved createVehicle _p; _veh setpos _p; _veh setDir (_dir-180); _groups pushback _veh; _p = [_pos,-1.5,_dir] call BIS_fnc_relPos; - _veh = "Land_BagFence_Round_F" createVehicle _p; + _veh = OT_NATO_Sandbag_Curved createVehicle _p; _veh setpos _p; _veh setDir (_dir); _groups pushback _veh; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf index 5f83b5ac..c678b2c3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf @@ -1,24 +1,8 @@ [ - ["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_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 + ["Land_CampingChair_V2_F",[-1.44146,-1.7173,0],223.485,1,0,[],"","",true,false], + ["Land_ClutterCutter_large_F",[0,0,0],0,1,0,[],"","",true,false] +] diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf index 21f46584..15eab8cc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf @@ -327,11 +327,11 @@ while {alive _unit} do { if(_attack != "") then { _pos = server getVariable _attack; private _playerpos = getpos _unit; - if(_pos distance _playerpos < 500) then { + if(_pos distance _playerpos < 1000) then { private _altitude = _playerpos select 2; - _unit setCaptive false; - _unit setVariable ["hiding",30,false]; if(_altitude > 5) then { + _unit setCaptive false; + _unit setVariable ["hiding",30,false]; //Radar is active here (vehicle _unit) spawn revealToNATO; }; diff --git a/addons/overthrow_main/config.cpp b/addons/overthrow_main/config.cpp index 3ea31e3c..7df2cade 100644 --- a/addons/overthrow_main/config.cpp +++ b/addons/overthrow_main/config.cpp @@ -22,7 +22,7 @@ class CfgPatches "cba_xeh", "cba_jr" }; - requiredVersion=1.66; + requiredVersion=1.69; units[] = {"OT_GanjaItem","OT_BlowItem"}; weapons[] = {"OT_Ganja","OT_Blow"}; }; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf index d1326d67..84fe5a9f 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf @@ -24,11 +24,21 @@ _unit forceAddUniform (OT_clothes_locals call BIS_fnc_selectRandom); _unit addEventHandler ["FiredNear", { _u = _this select 0; - if !(_u getVariable ["fleeing",false]) then { - _u setVariable ["fleeing",true,false]; - _u setBehaviour "COMBAT"; - _by = _this select 1; - _u allowFleeing 1; - _u setskill ["courage",0]; + _group = group _u; + if !(_group getVariable ["fleeing",false]) then { + _group setVariable ["fleeing",true,false]; + _group setBehaviour "COMBAT"; + _by = _this select 1; + _camps = _u nearObjects [OT_refugeeCamp,2500]; + if(count _camps > 0) then { + _camp = _camps select 0; + while {(count (waypoints _group)) > 0} do { + deleteWaypoint ((waypoints _group) select 0); + }; + _wp = _group addWaypoint [position _camp,30]; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointType "MOVE"; + _wp setWaypointSpeed "FULL"; + }; }; -}]; \ No newline at end of file +}]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf index 275ef4d5..99db581d 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf @@ -12,7 +12,7 @@ private _hour = date select 3; private _start = getpos ((units _g) select 0); if(isNil "_start") exitWith {}; private _dest = [_start,[0,100]] call SHK_pos; -private _bdg = [_start,OT_allShops + OT_offices] call OT_fnc_getRandomBuilding; +private _bdg = [_start,OT_allShops + OT_offices + [OT_refugeeCamp]] call OT_fnc_getRandomBuilding; if(typename _bdg != "BOOL") then { _dest = getpos(_bdg)}; private _wp = _g addWaypoint [_dest,0]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf index 3c66caa7..0eebdde8 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf @@ -1,6 +1,12 @@ private _group = _this; private _garrison = ((units _group) select 0) getvariable ["garrison",""]; +if(isNil "_garrison") exitWith { + { + deleteVehicle _x; + }foreach(units _group); + deleteGroup _group; +}; private _start = server getVariable [_garrison,position ((units _group) select 0)]; if(isNil "_start") exitWith {}; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf index 95dafe20..5b18fdd6 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf @@ -1,6 +1,5 @@ private _group = _this; -private _garrison = ((units _group) select 0) getvariable ["garrison",""]; private _start = position ((units _group) select 0); if(isNil "_start") exitWith {}; diff --git a/addons/overthrow_main/functions/actions/fn_buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf index 38f8fd19..e8a79f32 100644 --- a/addons/overthrow_main/functions/actions/fn_buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -87,6 +87,11 @@ call { clearBackpackCargoGlobal _veh; clearItemCargoGlobal _veh; + if(_cls == OT_vehType_service) then { + _veh addItemCargoGlobal ["ToolKit", 1]; + [_veh,3,"ACE_Wheel"] call ace_repair_fnc_addSpareParts; + }; + player reveal _veh; format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call OT_fnc_notifyMinor; playSound "3DEN_notificationDefault"; diff --git a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf index a8a131bc..f781dd30 100644 --- a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf @@ -1,8 +1,10 @@ -if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor}; - _town = (getpos player) call OT_fnc_nearestTown; _standing = player getVariable format['rep%1',_town]; +if(_standing < 10 and count (player nearObjects [OT_refugeeCamp,20]) == 0) exitWith { + "+10 Standing required to recruit. Try building a refugee camp at an FOB." call OT_fnc_notifyMinor +}; + _price = [_town,"CIV",_standing] call OT_fnc_getPrice; _money = player getVariable ["money",0]; @@ -19,6 +21,7 @@ _civ = player getvariable "hiringciv"; _civ removeAllEventHandlers "FiredNear"; [_civ] joinSilent grpNull; [_civ] joinSilent (group player); +_civ setCaptive true; [_civ] spawn OT_fnc_initRecruit; [player,format["New Recruit: %1",name _civ],format["Recruited: %1 for $%2",name _civ,_price]] call BIS_fnc_createLogRecord; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf index 10300151..e6ef676a 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf @@ -198,3 +198,24 @@ publicVariable "OT_allObjectives"; OT_allComms pushback _name; OT_allObjectives pushback _name; }foreach(OT_NATOcomms); + +{ + _x params ["_pos","_garrison","_upgrades"]; + OT_flag_NATO createVehicle _pos; + _count = 0; + _group = creategroup blufor; + while {_count < _garrison} do { + _start = [[[_pos,50]]] call BIS_fnc_randomPos; + + _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"]; + _civ setVariable ["garrison","HQ",false]; + _civ setRank "LIEUTENANT"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + _civ setBehaviour "SAFE"; + + _count = _count + 1; + }; + _group call OT_fnc_initMilitaryPatrol; + + [_pos,_upgrades] call OT_fnc_NATOupgradeFOB; +}foreach(server getVariable ["NATOfobs",[]]); diff --git a/addons/overthrow_main/functions/fn_canPlace.sqf b/addons/overthrow_main/functions/fn_canPlace.sqf index fa858b1a..182dfd8b 100644 --- a/addons/overthrow_main/functions/fn_canPlace.sqf +++ b/addons/overthrow_main/functions/fn_canPlace.sqf @@ -40,6 +40,7 @@ if(_typecls != "Base") then { }; }; }else{ + _isbase = true; _base = _pos call OT_fnc_nearestBase; if !(isNil "_base") then { if((_base select 0) distance _pos < 300) then { @@ -87,7 +88,7 @@ if !(_isbase) then { if(_typecls == "Base") then { _town = _pos call OT_fnc_nearestTown; _postown = server getVariable _town; - _dist = 250; + _dist = 200; if((_postown distance _pos) < _dist) then {_canplace = false}; }; diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf index 18bb8f0e..c24dc3f1 100644 --- a/addons/overthrow_main/functions/fn_getOwner.sqf +++ b/addons/overthrow_main/functions/fn_getOwner.sqf @@ -5,7 +5,4 @@ if(_this isKindOf "Building") exitWith { _id = [_this] call OT_fnc_getBuildID; owners getVariable [str _id,nil]; }; -if(_this isKindOf "CAManBase") exitWith { - _this getVariable ["owner",nil]; -}; -owners getVariable [str _this,nil]; +_this getVariable ["owner",nil]; diff --git a/addons/overthrow_main/functions/fn_setOwner.sqf b/addons/overthrow_main/functions/fn_setOwner.sqf index add327f0..a4b15d56 100644 --- a/addons/overthrow_main/functions/fn_setOwner.sqf +++ b/addons/overthrow_main/functions/fn_setOwner.sqf @@ -6,7 +6,4 @@ if(_obj isKindOf "Building") exitWith { _id = [_obj] call OT_fnc_getBuildID; owners setVariable [str _id,_owner,true]; }; -if(_obj isKindOf "CAManBase") exitWith { - _obj setVariable ["owner",_owner,true]; -}; -owners setVariable [str _obj,_owner,true]; +_obj setVariable ["owner",_owner,true]; diff --git a/addons/overthrow_main/ui/dialogs/build.hpp b/addons/overthrow_main/ui/dialogs/build.hpp index 482c57c4..daa95ffc 100644 --- a/addons/overthrow_main/ui/dialogs/build.hpp +++ b/addons/overthrow_main/ui/dialogs/build.hpp @@ -68,11 +68,47 @@ class OT_dialog_buildbase text = "Workshop"; //--- ToDo: Localize; x = 0.891875 * safezoneW + safezoneX; - y = 0.676 * safezoneH + safezoneY; + y = 0.412 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; tooltip = "Modify vehicles"; //--- ToDo: Localize; }; + class RscButton_1605: RscOverthrowButton + { + idc = 1605; + action = "'Helipad' call build"; + + text = "Helipad"; //--- ToDo: Localize; + x = 0.891875 * safezoneW + safezoneX; + y = 0.5 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Apparently helicopters need a place to land"; //--- ToDo: Localize; + }; + class RscButton_1606: RscOverthrowButton + { + idc = 1606; + action = "'Refugee Camp' call build"; + + text = "Refugee Camp"; //--- ToDo: Localize; + x = 0.891875 * safezoneW + safezoneX; + y = 0.588 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Helps with recruiting local civilians to your cause."; //--- ToDo: Localize; + }; + class RscButton_1607: RscOverthrowButton + { + idc = 1607; + action = "'Training Camp' call build"; + + text = "Training Camp"; //--- ToDo: Localize; + x = 0.891875 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Recruit trained and pre-equipped soldiers"; //--- ToDo: Localize; + }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// diff --git a/addons/overthrow_main/ui/items/fertilizer_x_ca.paa b/addons/overthrow_main/ui/items/fertilizer_x_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..3d541a4c163a213a8c9aa505077492ce8506f17b GIT binary patch literal 43616 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 literal 0 HcmV?d00001 From e9199c0c97312b0750ecc2c0baa68d0291b9f769 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Fri, 12 May 2017 00:31:52 +1000 Subject: [PATCH 06/16] Mr. Garrison, can I please be excused from class? --- .../Overthrow.Tanoa/AI/fn_NATOMortar.sqf | 36 ++++- .../Overthrow.Tanoa/UI/fn_garrisonDialog.sqf | 1 + .../missions/Overthrow.Tanoa/UI/mainMenu.sqf | 56 +++++--- .../Overthrow.Tanoa/UI/warehouseDialog.sqf | 64 +++++---- .../actions/fn_addGarrison.sqf | 72 ++++++++++ .../Overthrow.Tanoa/factions/GUER.sqf | 2 +- .../Overthrow.Tanoa/factions/NATO.sqf | 8 +- .../missions/Overthrow.Tanoa/initFuncs.sqf | 4 +- .../missions/Overthrow.Tanoa/initVar.sqf | 5 +- .../missions/Overthrow.Tanoa/intelSystem.sqf | 33 +++-- .../AI/NPC/fn_initMilitaryPatrol.sqf | 10 +- .../functions/AI/fn_getSoldier.sqf | 1 + .../functions/AI/fn_initVCOMAI.sqf | 4 +- .../functions/actions/fn_buyBuilding.sqf | 106 +++++++------- .../factions/NATO/fn_NATOGroundForces.sqf | 1 + .../factions/NATO/fn_NATOGroundSupport.sqf | 6 +- .../overthrow_main/functions/fn_loadGame.sqf | 51 +++++++ .../overthrow_main/functions/fn_saveGame.sqf | 56 +++++++- .../functions/geography/fn_nearestBase.sqf | 2 +- .../warehouse/fn_findWeaponInWarehouse.sqf | 1 + addons/overthrow_main/ui/dialogs/build.hpp | 8 +- addons/overthrow_main/ui/dialogs/main.hpp | 21 ++- .../overthrow_main/ui/dialogs/resistance.hpp | 131 ++++++++++++++++++ 23 files changed, 545 insertions(+), 134 deletions(-) create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf index ddfb94d4..ece6c8f0 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf @@ -2,6 +2,8 @@ params ["_mortar","_mortargroup"]; while {sleep 5+(random 5); ("8Rnd_82mm_Mo_shells" in getArtilleryAmmo[_mortar]) and (alive _mortar) and ({alive _x} count (units _mortargroup)) > 0} do { private _attacking = server getVariable ["NATOattacking",""]; + private _mortarpos = position _mortar; + if(_attacking != "" and !(_attacking in OT_allTowns)) then { _pos = server getvariable _attacking; _distance = (_pos distance _mortar); @@ -10,12 +12,28 @@ while {sleep 5+(random 5); ("8Rnd_82mm_Mo_shells" in getArtilleryAmmo[_mortar]) if(_timesince < 300) then { if (_distance < 4000 and _distance > 500) then { _mortargroup setCombatMode "RED"; - _p = [[[_pos,300]]] call SHK_pos; + _p = [_pos,random 360,300] call SHK_pos; _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1]; sleep 3+(random 3); _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1]; sleep 3; _mortargroup setCombatMode "BLUE"; + //Did anyone hear that? + if({side _x == resistance or captive _x} count (_mortarpos nearObjects ["CAManBase",3000]) > 0) then { + private _icons = spawner getVariable ["NATOmortars",[]]; + _found = false; + { + if((_x select 0) == _mortar) exitWith { + _range = (_x select 1) - round((_x select 0) * 0.25); + _x set [1,_range]; + _x set [2,[_mortarpos,random 360,_range] call SHK_pos]; + }; + }foreach(_icons); + if !(_found) then { + _icons pushback [_mortar,1500,[_mortarpos,random 360,1500] call SHK_pos]; + }; + spawner setVariable ["NATOmortars",_icons,true]; + }; }; }; }else{ @@ -34,6 +52,22 @@ while {sleep 5+(random 5); ("8Rnd_82mm_Mo_shells" in getArtilleryAmmo[_mortar]) _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1]; sleep 3; _mortargroup setCombatMode "BLUE"; + //Did anyone hear that? + if({side _x == resistance or captive _x} count (_mortarpos nearObjects ["CAManBase",3000]) > 0) then { + private _icons = spawner getVariable ["NATOmortars",[]]; + _found = false; + { + if((_x select 0) == _mortar) exitWith { + _range = (_x select 1) - round((_x select 0) * 0.25); + _x set [1,_range]; + _x set [2,[_mortarpos,random 360,_range] call SHK_pos]; + }; + }foreach(_icons); + if !(_found) then { + _icons pushback [_mortar,1500,[_mortarpos,random 360,1500] call SHK_pos]; + }; + spawner setVariable ["NATOmortars",_icons,true]; + }; }; }foreach(_targets); spawner setVariable ["NATOknowntargets",_targets,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf new file mode 100644 index 00000000..4bd09d56 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf @@ -0,0 +1 @@ +createDialog "OT_dialog_garrison"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf index 5d2b62b3..0291ff57 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf @@ -11,7 +11,7 @@ private _donerem = false; if !(isNull cursorObject) then { if((player distance cursorObject) < 20) then { if (cursorObject in ((allMissionObjects "Static") + vehicles)) then { - if !((cursorObject isKindOf "CAManBase") or (side cursorObject) == west) then { + if !((cursorObject isKindOf "CAManBase") or (side cursorObject) == west or (typeof cursorObject) == OT_item_flag) then { call { if(((cursorObject isKindOf "Land") or (cursorObject isKindOf "Air")) and ("ToolKit" in (items player)) and (damage cursorObject) == 1) exitWith { _donerem = true; @@ -132,17 +132,6 @@ if(typename _b == "ARRAY") then { Owned by %1 ",_ownername]; }; - if(typeof _building == OT_item_Flag) exitWith { - ctrlSetText [1608,"Sell"]; - ctrlEnable [1608,false]; - ctrlEnable [1609,false]; - ctrlEnable [1610,false]; - - _buildingTxt = format[" - %1
- Founded by %2 - ",_building getVariable "name",_ownername]; - }; ctrlSetText [1608,format["Sell ($%1)",[_sell, 1, 0, true] call CBA_fnc_formatNumber]]; @@ -211,7 +200,7 @@ if(typename _b == "ARRAY") then { ctrlEnable [1609,true]; ctrlSetText [1609,"Recruit"]; //ctrlEnable [1609,false]; - //ctrlEnable [1610,false]; + ctrlEnable [1610,false]; _buildingTxt = format[" Training Camp
@@ -220,6 +209,41 @@ if(typename _b == "ARRAY") then { ",_ownername,round((damage _building) * 100),"%"]; }; + if(typeof _building == OT_refugeeCamp) then { + _owner = _building call OT_fnc_getOwner; + _ownername = server getVariable format["name%1",_owner]; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlEnable [1609,false]; + ctrlEnable [1610,false]; + + _buildingTxt = format[" + Refugee Camp
+ Built by %1
+ Damage: %2%3 + ",_ownername,round((damage _building) * 100),"%"]; + }; + + if(typeof _building == OT_item_flag) then { + _base = []; + { + if((_x select 0) distance _building < 5) exitWith {_base = _x}; + }foreach(server getvariable ["bases",[]]); + + _ownername = server getVariable format["name%1",_base select 2]; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,true]; + ctrlSetText [1608,"Garrison"]; + ctrlEnable [1609,false]; + //ctrlEnable [1609,false]; + ctrlEnable [1610,false]; + + _buildingTxt = format[" + %1
+ Founded by %2 + ",_base select 1,_ownername]; + }; + if(damage _building == 1) then { if((_owner == getplayerUID player) or (call OT_fnc_playerIsGeneral)) then { ctrlEnable [1608,false]; //Not allowed to sell @@ -287,7 +311,7 @@ if(typename _b == "ARRAY") then { ",_ownername]; }; - if(!((typeof _building) in OT_allRealEstate)) then { + if(!((typeof _building) in OT_allRealEstate + [OT_item_flag])) then { ctrlEnable [1609,false]; ctrlEnable [1610,false]; ctrlEnable [1608,false]; @@ -316,8 +340,8 @@ if(typename _b == "ARRAY") then { ",_obname]; ctrlEnable [1609,false]; }; - ctrlSetText [1608,"Sell"]; - ctrlEnable [1608,false]; + ctrlSetText [1608,"Garrison"]; + ctrlEnable [1608,true]; ctrlSetText [1609,"Procurement"]; ctrlEnable [1610,false]; }else{ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf index c4acfb0e..d4b1b7f5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf @@ -2,38 +2,44 @@ private _cursel = lbCurSel 1500; lbClear 1500; _sorted = [allVariables warehouse,[],{_x},"ASCEND"] call BIS_fnc_SortBy; _numitems = 0; -{ +{ _d = warehouse getVariable [_x,[_x,0]]; - _cls = _d select 0; - _num = _d select 1; - _name = ""; - _pic = ""; - - if(_num > 0) then { - _numitems = _numitems + 1; - if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { - _name = _cls call ISSE_Cfg_Weapons_GetName; - _pic = _cls call ISSE_Cfg_Weapons_GetPic; - }; - if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { - _name = _cls call ISSE_Cfg_Magazine_GetName; - _pic = _cls call ISSE_Cfg_Magazine_GetPic; - }; - if(_cls isKindOf "Bag_Base") then { - _name = _cls call ISSE_Cfg_Vehicle_GetName; - _pic = _cls call ISSE_Cfg_Vehicle_GetPic; - }; - if(isClass (configFile >> "CfgGlasses" >> _cls)) then { - _name = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName"); - _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture"); - }; + if(typename _d == "ARRAY") then { + _cls = _d select 0; + _num = _d select 1; + _name = ""; + _pic = ""; - _idx = lbAdd [1500,format["%1 x %2",_num,_name]]; - lbSetPicture [1500,_idx,_pic]; - lbSetValue [1500,_idx,_num]; - lbSetData [1500,_idx,_cls]; + if(_num > 0) then { + _numitems = _numitems + 1; + call { + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith { + _name = _cls call ISSE_Cfg_Weapons_GetName; + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + }; + if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) exitWith { + _name = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + }; + if(_cls isKindOf "Bag_Base") exitWith { + _name = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + }; + if(isClass (configFile >> "CfgGlasses" >> _cls)) exitWith { + _name = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName"); + _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture"); + }; + _name = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + }; + + _idx = lbAdd [1500,format["%1 x %2",_num,_name]]; + lbSetPicture [1500,_idx,_pic]; + lbSetValue [1500,_idx,_num]; + lbSetData [1500,_idx,_cls]; + }; }; }foreach(_sorted); if(_cursel >= _numitems) then {_cursel = 0}; -lbSetCurSel [1500, _cursel]; \ No newline at end of file +lbSetCurSel [1500, _cursel]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf new file mode 100644 index 00000000..6d098387 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf @@ -0,0 +1,72 @@ +params ["_create"]; + +private _b = (getpos player) call OT_fnc_nearestBase; +private _pos = _b select 0; +_code = format["fob%1",_pos]; +if(_pos distance player > 30) then { + _b = (getpos player) call OT_fnc_nearestObjective; + _pos = _b select 0; + _code = _b select 1; +}; + +_group = spawner getVariable [format["resgarrison%1",_code],grpNull]; +_doinit = false; +if(isNull _group) then { + _group = creategroup resistance; + spawner setVariable [format["resgarrison%1",_code],_group,true]; + _doinit = true; +}; +private _sol = []; +if(typename _create == "SCALAR") then { + _sol = OT_recruitables select _create; + _cls = _sol select 0; + + _soldier = _cls call OT_fnc_getSoldier; + + private _money = player getVariable ["money",0]; + private _cost = _soldier select 0; + if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor}; + + [-_cost] call money; + + private _civ = [_soldier,_pos,_group] call OT_fnc_createSoldier; + + if(_doinit) then { + _group call OT_fnc_initMilitaryPatrol; + }; +}else{ + if(_create == "HMG") then { + _p = _pos findEmptyPosition [0,50,"I_HMG_01_high_F"]; + + _cost = ["Tanoa","I_HMG_01_high_weapon_F",0] call OT_fnc_getPrice; + _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); + _cost = _cost + 300; + + private _money = player getVariable ["money",0]; + if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor}; + [-_cost] call money; + + _gun = "I_HMG_01_high_F" createVehicle _p; + createVehicleCrew _gun; + { + [_x] joinSilent _group; + }foreach(crew _gun); + }; + if(_create == "GMG") then { + _p = _pos findEmptyPosition [0,50,"I_GMG_01_high_F"]; + + _cost = ["Tanoa","I_GMG_01_high_weapon_F",0] call OT_fnc_getPrice; + _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); + _cost = _cost + 300; + + private _money = player getVariable ["money",0]; + if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor}; + [-_cost] call money; + + _gun = "I_GMG_01_high_F" createVehicle _p; + createVehicleCrew _gun; + { + [_x] joinSilent _group; + }foreach(crew _gun); + }; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index c3876663..c576f526 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -173,8 +173,8 @@ while {true} do { _stabcounter = 0; { _town = _x; + _townpos = server getvariable _x; if !(_town in _abandoned) then { - _townpos = server getvariable _x; if(_townpos call OT_fnc_inSpawnDistance) then { _numcops = {side _x == west} count (_townpos nearObjects ["CAManBase",600]); if(_numcops == 0) then { 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 0205864e..baf5ea75 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -298,7 +298,7 @@ while {sleep 10;true} do { _spend = 1200; }; - if((_spend > 1000) and (count _fobs) < 3 and (random 100) > 0) then { + if((_spend > 500) and (count _fobs) < 3 and (random 100) > 95) then { //Deploy an FOB _lowest = ""; { @@ -321,8 +321,8 @@ while {sleep 10;true} do { }; }foreach (selectBestPlaces [_pp, 1000,"(1 - forest - trees) * (1 - houses) * (1 - sea)",5,4]); if(count _gotpos > 0) then { - _spend = _spend - 1000; - _resources = _resources - 1000; + _spend = _spend - 500; + _resources = _resources - 500; [_gotpos] spawn OT_fnc_NATOMissionDeployFOB; }; }; @@ -432,7 +432,7 @@ while {sleep 10;true} do { }; _group call OT_fnc_initMilitaryPatrol; }; - if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > 0)) exitWith { + if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > 95)) exitWith { _spend = _spend - 300; _resources = _resources - 300; _upgrades pushback "Mortar"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 4c6d1f61..7170ae57 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -48,6 +48,7 @@ OT_fnc_reverseEngineerDialog = compileFinal preProcessFileLineNumbers "UI\fn_rev OT_fnc_vehicleDialog = compileFinal preProcessFileLineNumbers "UI\fn_vehicleDialog.sqf"; OT_fnc_newGameDialog = compileFinal preProcessFileLineNumbers "UI\fn_newGameDialog.sqf"; OT_fnc_optionsDialog = compileFinal preProcessFileLineNumbers "UI\fn_optionsDialog.sqf"; +OT_fnc_garrisonDialog = compileFinal preProcessFileLineNumbers "UI\fn_garrisonDialog.sqf"; template_playerDesk = [] call compileFinal preProcessFileLineNumbers "templates\playerdesk.sqf"; template_checkpoint = [] call compileFinal preProcessFileLineNumbers "templates\NATOcheckpoint.sqf"; @@ -77,6 +78,7 @@ exportAll = compileFinal preProcessFileLineNumbers "actions\exportAll.sqf"; import = compileFinal preProcessFileLineNumbers "actions\import.sqf"; restoreLoadout = compileFinal preProcessFileLineNumbers "actions\restoreLoadout.sqf"; removeLoadout = compileFinal preProcessFileLineNumbers "actions\removeLoadout.sqf"; +OT_fnc_addGarrison = compileFinal preProcessFileLineNumbers "actions\fn_addGarrison.sqf"; //Modes @@ -534,7 +536,7 @@ OT_fnc_initRecruit = { _civ setSkill 1.0; _civ setRank "PRIVATE"; - _civ setVariable ["NOAI",false,true]; + _civ setVariable ["NOAI",true,true]; _civ spawn wantedSystem; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index f8808e32..bcc2cb9d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck 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 = 3; //Half the Average time between NATO orders (x 10 seconds) +OT_NATOwait = 30; //Half the Average time between NATO orders (x 10 seconds) OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house @@ -117,7 +117,8 @@ OT_Recruitables = [ ["I_Soldier_AT_F","AssaultRifle","launch_I_Titan_short_F",200,"",""], //9 ["I_Soldier_AA_F","AssaultRifle","launch_I_Titan_F",200,"",""], //10 ["I_Soldier_AAT_F","AssaultRifle","",200,"",""], //11 - ["I_Soldier_AAA_F","AssaultRifle","",200,"",""] //12 + ["I_Soldier_AAA_F","AssaultRifle","",200,"",""], //12 + ["I_soldier_GL_F","GrenadeLauncher","",200,"",""] //13 ]; OT_Squadables = [ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf index fe29f753..19388be8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf @@ -100,6 +100,18 @@ _handler = { _t = _t + 1; }foreach(units (group player)); + { + (_this select 0) drawIcon [ + "\A3\ui_f\data\map\markers\nato\b_mortar.paa", + [0,0.3,0.59,(2000 - (_x select 1)) / 2000], + _x select 2, + 24, + 24, + 0, + "" + ]; + }foreach(spawner getVariable ["NATOmortars",[]]); + { _passengers = ""; _color = [0,0.5,0,1]; @@ -227,7 +239,7 @@ _handler = { } }foreach(OT_allTowns); { - if !(_x getVariable ["looted",false]) then { + if ((typeof _x != "B_UAV_AI") and !(_x getVariable ["looted",false])) then { (_this select 0) drawIcon [ "ot\ui\markers\death.paa", [1,1,1,0.5], @@ -249,23 +261,16 @@ _handler = { getdir _x ]; }; - if(_x isKindOf "StaticWeapon" and isNull attachedTo _x) then { - _do = false; - _color = [0,0.5,0,1]; - if(side _x == resistance) then { - _do = true; - }else{ - if(resistance knowsAbout _x > 0) then { - _do = true; - _color = [0.5,0,0,1] - }; - }; - if(_do) then { + if((_x isKindOf "StaticWeapon") and isNull attachedTo _x) then { + if(side _x == civilian or side _x == resistance or captive _x) then { + _col = [0.5,0.5,0.5,1]; + if(!isNull gunner _x) then {_col = [0,0.5,0,1]}; _i = "\A3\ui_f\data\map\markers\nato\o_art.paa"; if(_x isKindOf "StaticMortar") then {_i = "\A3\ui_f\data\map\markers\nato\o_mortar.paa"}; + if !(someAmmo _x) then {_col set [3,0.4]}; (_this select 0) drawIcon [ _i, - _color, + _col, position _x, 30, 30, diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf index 5b18fdd6..b9bfbc71 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf @@ -4,7 +4,7 @@ private _start = position ((units _group) select 0); if(isNil "_start") exitWith {}; -_wp = _group addWaypoint [_start,5]; +_wp = _group addWaypoint [_start,40]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; @@ -12,7 +12,7 @@ _wp setWaypointTimeout [10,20,60]; _dest = [_start,[50,75],45] call SHK_pos; -_wp = _group addWaypoint [_dest,10]; +_wp = _group addWaypoint [_dest,40]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; @@ -20,7 +20,7 @@ _wp setWaypointTimeout [10,20,60]; _dest = [_start,[100,200],180] call SHK_pos; -_wp = _group addWaypoint [_dest,10]; +_wp = _group addWaypoint [_dest,40]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; @@ -28,7 +28,7 @@ _wp setWaypointTimeout [10,20,60]; _dest = [_start,[100,200],270] call SHK_pos; -_wp = _group addWaypoint [_dest,10]; +_wp = _group addWaypoint [_dest,40]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; @@ -36,7 +36,7 @@ _wp setWaypointTimeout [10,20,60]; _dest = [_start,[100,200],0] call SHK_pos; -_wp = _group addWaypoint [_dest,10]; +_wp = _group addWaypoint [_dest,40]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; diff --git a/addons/overthrow_main/functions/AI/fn_getSoldier.sqf b/addons/overthrow_main/functions/AI/fn_getSoldier.sqf index 391eea2b..fbe6ce5f 100644 --- a/addons/overthrow_main/functions/AI/fn_getSoldier.sqf +++ b/addons/overthrow_main/functions/AI/fn_getSoldier.sqf @@ -25,6 +25,7 @@ if(_wpn == "") then { { _weapon = [_x] call BIS_fnc_itemType; _weaponType = _weapon select 1; + if(_weaponType == "AssaultRifle" and (_x find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"}; if(_weaponType == _primary) then {_possible pushback _x}; }foreach(OT_allWeapons); _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy; diff --git a/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf b/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf index 30283b71..d27524c3 100644 --- a/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf +++ b/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf @@ -11,7 +11,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 = 0; +NOAI_FOR_PLAYERLEADERS = 1; //Will AI garrison static weapons nearby? VCOM_STATICGARRISON = 1; //How far can the AI hear gunshots from? @@ -51,7 +51,7 @@ 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]; //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]; +VCOM_SideBasedExecution = [WEST,EAST]; //Distance AI will respond to call of help from each other VCOM_Unit_AIWarnDistance = 600; diff --git a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf index 03173854..73bb576c 100644 --- a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf +++ b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf @@ -1,5 +1,3 @@ -if !(captive player) exitWith {"You cannot buy or manage real estate while wanted" call OT_fnc_notifyMinor}; - _b = player call OT_fnc_nearestRealEstate; private _handled = false; private _type = "buy"; @@ -7,65 +5,79 @@ private _err = false; private _isfactory = false; if(typename _b == "ARRAY") then { _building = (_b select 0); - if !(_building call OT_fnc_hasOwner) then { - _handled = true; + if(typeof _building == OT_item_Flag) then { + _err = true; + [] call OT_fnc_garrisonDialog; }else{ - _owner = _building call OT_fnc_getOwner; - if(_owner == getplayeruid player) then { - _home = player getVariable "home"; - if(_home distance _building < 5) exitWith {"You cannot sell your home" call OT_fnc_notifyMinor;_err = true}; - _type = "sell"; + if !(_building call OT_fnc_hasOwner) then { _handled = true; + }else{ + _owner = _building call OT_fnc_getOwner; + if(_owner == getplayeruid player) then { + _home = player getVariable "home"; + if(_home distance _building < 5) exitWith {"You cannot sell your home" call OT_fnc_notifyMinor;_err = true}; + _type = "sell"; + _handled = true; + }; }; }; }else{ - _b = (position player) call OT_fnc_nearestLocation; - if((_b select 1) == "Business") then { - if (call OT_fnc_playerIsGeneral) then { - _name = (_b select 0); - _pos = (_b select 2) select 0; - _price = _name call OT_fnc_getBusinessPrice; - _err = true; - _money = [] call OT_fnc_resistanceFunds; - if(_money >= _price) then { - [-_price] call OT_fnc_resistanceFunds; - _owned = server getVariable ["GEURowned",[]]; - if(_owned find _name == -1) then { - server setVariable ["GEURowned",_owned + [_name],true]; - server setVariable [format["%1employ",_name],2]; - _pos remoteExec ["OT_fnc_resetSpawn",2,false]; - format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true]; - _name setMarkerColor "ColorGUER"; - }; - }else{ - "The resistance cannot afford this" call OT_fnc_notifyMinor; - }; - }; + _ob = (position player) call OT_fnc_nearestObjective; + _dist = (_ob select 0) distance player; + _name = _ob select 1; + + if (_dist < 250 and _name in (server getVariable ["NATOabandoned",[]])) then { + _err = true; + [] call OT_fnc_garrisonDialog; }else{ - if((getpos player) distance OT_factoryPos < 150) then { + _b = (position player) call OT_fnc_nearestLocation; + if((_b select 1) == "Business") then { if (call OT_fnc_playerIsGeneral) then { - _name = "Factory"; - - _owned = server getVariable ["GEURowned",[]]; - if(_owned find _name == -1) then { - _pos = OT_factoryPos; - _price = _name call OT_fnc_getBusinessPrice; - _err = true; - _money = [] call OT_fnc_resistanceFunds; - if(_money >= _price) then { - [-_price] call OT_fnc_resistanceFunds; + _name = (_b select 0); + _pos = (_b select 2) select 0; + _price = _name call OT_fnc_getBusinessPrice; + _err = true; + _money = [] call OT_fnc_resistanceFunds; + if(_money >= _price) then { + [-_price] call OT_fnc_resistanceFunds; + _owned = server getVariable ["GEURowned",[]]; + if(_owned find _name == -1) then { server setVariable ["GEURowned",_owned + [_name],true]; server setVariable [format["%1employ",_name],2]; _pos remoteExec ["OT_fnc_resetSpawn",2,false]; format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true]; _name setMarkerColor "ColorGUER"; - }else{ - "The resistance cannot afford this" call OT_fnc_notifyMinor; }; }else{ - //Manage - [] spawn OT_fnc_factoryDialog; - _isfactory = true; + "The resistance cannot afford this" call OT_fnc_notifyMinor; + }; + }; + }else{ + if((getpos player) distance OT_factoryPos < 150) then { + if (call OT_fnc_playerIsGeneral) then { + _name = "Factory"; + + _owned = server getVariable ["GEURowned",[]]; + if(_owned find _name == -1) then { + _pos = OT_factoryPos; + _price = _name call OT_fnc_getBusinessPrice; + _err = true; + _money = [] call OT_fnc_resistanceFunds; + if(_money >= _price) then { + [-_price] call OT_fnc_resistanceFunds; + server setVariable ["GEURowned",_owned + [_name],true]; + server setVariable [format["%1employ",_name],2]; + _pos remoteExec ["OT_fnc_resetSpawn",2,false]; + format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true]; + _name setMarkerColor "ColorGUER"; + }else{ + "The resistance cannot afford this" call OT_fnc_notifyMinor; + }; + }else{ + //Manage + [] spawn OT_fnc_factoryDialog; + _isfactory = true; + }; }; }; }; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf index db389542..6a888ffe 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf @@ -123,6 +123,7 @@ if(_byair and (typename _tgroup == "GROUP")) then { _dropos = getpos(_roads select (count _roads - 1)); }; _move = _tgroup addWaypoint [_dropos,0]; + _move setWaypointBehaviour "CARELESS"; _move setWaypointTimeout [30,30,30]; _move setWaypointType "TR UNLOAD"; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf index 71a367f3..adf27dde 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf @@ -29,7 +29,11 @@ while {_count < _num} do { sleep 0.1; }; -_wp = _group addWaypoint [asltoatl _attackpos,20]; +_wp = _group addWaypoint [_attackpos,20]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "CARELESS"; + +_wp = _group addWaypoint [_attackpos,20]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointTimeout [600,600,600]; diff --git a/addons/overthrow_main/functions/fn_loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf index f5586cbd..a9141b0f 100644 --- a/addons/overthrow_main/functions/fn_loadGame.sqf +++ b/addons/overthrow_main/functions/fn_loadGame.sqf @@ -202,6 +202,57 @@ private _cc = 0; }; }foreach(_data); sleep 0.1; + +{ + _pos = _x select 0; + _code = format["fob%1",_pos]; + _garrison = server getVariable [format["resgarrison%1",_code],[]]; + if(count _garrison > 0) then { + _group = creategroup resistance; + spawner setVariable [format["resgarrison",_code],_group,true]; + { + _x params ["_cls","_loadout"]; + call { + if(_cls == "HMG") exitWith { + _p = _pos findEmptyPosition [0,50,"I_HMG_01_high_F"]; + _gun = "I_HMG_01_high_F" createVehicle _p; + createVehicleCrew _gun; + { + [_x] joinSilent _group; + }foreach(crew _gun); + }; + if(_cls == "GMG") exitWith { + _p = _pos findEmptyPosition [0,50,"I_GMG_01_high_F"]; + _gun = "I_GMG_01_high_F" createVehicle _p; + createVehicleCrew _gun; + { + [_x] joinSilent _group; + }foreach(crew _gun); + }; + private _start = [[[_pos,30]]] call BIS_fnc_randomPos; + private _civ = _group createUnit [_cls, _start, [],0, "NONE"]; + _civ setUnitLoadout [_loadout,true]; + }; + }foreach(_garrison); + }; +}foreach(server getvariable ["bases",[]]); + +{ + _pos = _x select 0; + _code = _x select 1; + _garrison = server getVariable [format["resgarrison%1",_code],[]]; + if(count _garrison > 0) then { + _group = creategroup resistance; + spawner setVariable [format["resgarrison",_code],_group,true]; + { + _x params ["_cls","_loadout"]; + private _start = [[[_pos,30]]] call BIS_fnc_randomPos; + private _civ = _group createUnit [_cls, _start, [],0, "NONE"]; + _civ setUnitLoadout [_loadout,true]; + }foreach(_garrison); + }; +}foreach(OT_objectiveData + OT_airportData); + private _built = (allMissionObjects "Static"); { private _uid = _x; diff --git a/addons/overthrow_main/functions/fn_saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf index aee3f8a5..70ad5111 100644 --- a/addons/overthrow_main/functions/fn_saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -9,7 +9,7 @@ waitUntil {!isNil "OT_NATOInitDone"}; private _data = []; //get all server data { - if !(_x == "StartupType" or _x == "recruits" or _x == "squads") then { + if !(_x == "StartupType" or _x == "recruits" or _x == "squads" or (_x select [0,11]) == "resgarrison") then { _val = server getVariable _x; if(typename _val == "ARRAY") then { //Copy the array @@ -137,6 +137,60 @@ private _squads = []; _data pushback ["squads",_squads]; +{ + _pos = _x select 0; + _code = format["fob%1",_pos]; + _group = spawner getvariable [format["resgarrison%1",_code],grpNull]; + if !(isNull _group) then { + _soldiers = []; + { + if(alive _x) then { + if(vehicle _x == _x) then { + _soldiers pushback [typeof _x,getUnitLoadout _x]; + }else{ + _veh = vehicle _x; + if(someAmmo _veh and (typeof _veh == "I_HMG_01_high_F")) then { + _soldiers pushback ["HMG",[]]; + }; + if(someAmmo _veh and (typeof _veh == "I_GMG_01_high_F")) then { + _soldiers pushback ["GMG",[]]; + }; + }; + }; + }foreach(units _group); + if(count _soldiers > 0) then { + _data pushback [format["resgarrison%1",_code],_soldiers]; + }; + }; +}foreach(server getVariable ["bases",[]]); + +{ + _pos = server getvariable _x; + _code = _x; + _group = spawner getvariable [format["resgarrison%1",_code],grpNull]; + if !(isNull _group) then { + _soldiers = []; + { + if(alive _x) then { + if(vehicle _x == _x) then { + _soldiers pushback [typeof _x,getUnitLoadout _x]; + }else{ + _veh = vehicle _x; + if(someAmmo _veh and (typeof _veh == "I_HMG_01_high_F")) then { + _soldiers pushback ["HMG",[]]; + }; + if(someAmmo _veh and (typeof _veh == "I_GMG_01_high_F")) then { + _soldiers pushback ["GMG",[]]; + }; + }; + }; + }foreach(units _group); + if(count _soldiers > 0) then { + _data pushback [format["resgarrison%1",_code],_soldiers]; + }; + }; +}foreach(OT_allObjectives); + _data pushback ["timedate",date]; { diff --git a/addons/overthrow_main/functions/geography/fn_nearestBase.sqf b/addons/overthrow_main/functions/geography/fn_nearestBase.sqf index c9a8c1b9..fbc1fba5 100644 --- a/addons/overthrow_main/functions/geography/fn_nearestBase.sqf +++ b/addons/overthrow_main/functions/geography/fn_nearestBase.sqf @@ -1,2 +1,2 @@ private _pos = _this; -([server getVariable ["bases",[]],[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy) select 0 +([server getVariable ["bases",[[[0,0,0]]]],[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy) select 0 diff --git a/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf b/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf index c5e3436d..4ffa404f 100644 --- a/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf +++ b/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf @@ -8,6 +8,7 @@ private _possible = []; if(_num > 0) then { private _weapon = [_cls] call BIS_fnc_itemType; private _weaponType = _weapon select 1; + if(_weaponType == "AssaultRifle" and (_cls find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"}; if(_weaponType == _type) then {_possible pushback _cls}; }; }foreach(allvariables warehouse); diff --git a/addons/overthrow_main/ui/dialogs/build.hpp b/addons/overthrow_main/ui/dialogs/build.hpp index daa95ffc..faa9f5c4 100644 --- a/addons/overthrow_main/ui/dialogs/build.hpp +++ b/addons/overthrow_main/ui/dialogs/build.hpp @@ -68,7 +68,7 @@ class OT_dialog_buildbase text = "Workshop"; //--- ToDo: Localize; x = 0.891875 * safezoneW + safezoneX; - y = 0.412 * safezoneH + safezoneY; + y = 0.324 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; tooltip = "Modify vehicles"; //--- ToDo: Localize; @@ -80,7 +80,7 @@ class OT_dialog_buildbase text = "Helipad"; //--- ToDo: Localize; x = 0.891875 * safezoneW + safezoneX; - y = 0.5 * safezoneH + safezoneY; + y = 0.412 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; tooltip = "Apparently helicopters need a place to land"; //--- ToDo: Localize; @@ -92,7 +92,7 @@ class OT_dialog_buildbase text = "Refugee Camp"; //--- ToDo: Localize; x = 0.891875 * safezoneW + safezoneX; - y = 0.588 * safezoneH + safezoneY; + y = 0.5 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; tooltip = "Helps with recruiting local civilians to your cause."; //--- ToDo: Localize; @@ -104,7 +104,7 @@ class OT_dialog_buildbase text = "Training Camp"; //--- ToDo: Localize; x = 0.891875 * safezoneW + safezoneX; - y = 0.676 * safezoneH + safezoneY; + y = 0.588 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; tooltip = "Recruit trained and pre-equipped soldiers"; //--- ToDo: Localize; diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp index bf2d08a7..f3286717 100644 --- a/addons/overthrow_main/ui/dialogs/main.hpp +++ b/addons/overthrow_main/ui/dialogs/main.hpp @@ -363,7 +363,7 @@ class OT_dialog_command idc = 1601; text = "Loot"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; - y = 0.654 * safezoneH + safezoneY; + y = 0.412 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Commands all selected units to loot bodies and fill closest container to them"; //--- ToDo: Localize; @@ -374,12 +374,23 @@ class OT_dialog_command idc = 1602; text = "Open Inventory"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; - y = 0.478 * safezoneH + safezoneY; + y = 0.324 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Commands first unit selected to walk to and open the closest container to them"; //--- ToDo: Localize; action = "closeDialog 0;[] spawn OT_fnc_orderOpenInventory;"; }; + class RscButton_1603: RscOverthrowButton + { + idc = 1603; + text = "Create Squad"; //--- ToDo: Localize; + x = 0.005 * safezoneW + safezoneX; + y = 0.5 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Splits selected units off into a new squad"; //--- ToDo: Localize; + action = "closeDialog 0;[] spawn OT_fnc_createSquad;"; + }; class RscButton_1612: RscOverthrowButton { idc = 1612; @@ -428,7 +439,7 @@ class OT_dialog_squad idc = 1601; text = "Assign Vehicle"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; - y = 0.654 * safezoneH + safezoneY; + y = 0.324 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Assigns vehicle you are looking at to squad"; //--- ToDo: Localize; @@ -439,7 +450,7 @@ class OT_dialog_squad idc = 1602; text = "Get In"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; - y = 0.478 * safezoneH + safezoneY; + y = 0.412 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Orders squad to board assigned vehicle"; //--- ToDo: Localize; @@ -450,7 +461,7 @@ class OT_dialog_squad idc = 1603; text = "Get Out"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; - y = 0.566 * safezoneH + safezoneY; + y = 0.5 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.077 * safezoneH; tooltip = "Orders squad to disembark assigned vehicle"; //--- ToDo: Localize; diff --git a/addons/overthrow_main/ui/dialogs/resistance.hpp b/addons/overthrow_main/ui/dialogs/resistance.hpp index 3b83d803..abafe945 100644 --- a/addons/overthrow_main/ui/dialogs/resistance.hpp +++ b/addons/overthrow_main/ui/dialogs/resistance.hpp @@ -168,3 +168,134 @@ class OT_dialog_resistance //////////////////////////////////////////////////////// } } + + +class OT_dialog_garrison +{ + idd=9000; + movingenable=false; + class controlsBackground + { + class RscStructuredText_1100: RscOverthrowStructuredText + { + idc = 1100; + + text = ""; //--- ToDo: Localize; + x = 0.288594 * safezoneW + safezoneX; + y = 0.214 * safezoneH + safezoneY; + w = 0.422812 * safezoneW; + h = 0.572 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Niwire) + //////////////////////////////////////////////////////// + + class RscStructuredText_1100: RscOverthrowStructuredText + { + idc = 1100; + text = "Base"; //--- ToDo: Localize; + x = 0.298906 * safezoneW + safezoneX; + y = 0.236 * safezoneH + safezoneY; + w = 0.402187 * safezoneW; + h = 0.033 * safezoneH; + colorBackground[] = {0,0,0,0}; + }; + class RscButton_1600: RscOverthrowButton + { + idc = 1600; + text = "+1 Rifleman"; //--- ToDo: Localize; + x = 0.37625 * safezoneW + safezoneX; + y = 0.291 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[0] spawn OT_fnc_addGarrison"; + }; + class RscButton_1601: RscOverthrowButton + { + idc = 1601; + text = "+1 Autorifleman"; //--- ToDo: Localize; + x = 0.438125 * safezoneW + safezoneX; + y = 0.291 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[1] spawn OT_fnc_addGarrison"; + }; + class RscButton_1602: RscOverthrowButton + { + idc = 1602; + text = "+1 Grenadier"; //--- ToDo: Localize; + x = 0.5 * safezoneW + safezoneX; + y = 0.291 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[13] spawn OT_fnc_addGarrison"; + }; + class RscButton_1603: RscOverthrowButton + { + idc = 1603; + text = "+1 Medic"; //--- ToDo: Localize; + x = 0.561875 * safezoneW + safezoneX; + y = 0.291 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[8] spawn OT_fnc_addGarrison"; + }; + class RscButton_1604: RscOverthrowButton + { + idc = 1604; + text = "+1 Anti-Tank"; //--- ToDo: Localize; + x = 0.37625 * safezoneW + safezoneX; + y = 0.379 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[9] spawn OT_fnc_addGarrison"; + }; + class RscButton_1605: RscOverthrowButton + { + idc = 1605; + text = "+1 Anti-Air"; //--- ToDo: Localize; + x = 0.438125 * safezoneW + safezoneX; + y = 0.379 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "[10] spawn OT_fnc_addGarrison"; + }; + class RscButton_1606: RscOverthrowButton + { + idc = 1606; + text = "+1 HMG"; //--- ToDo: Localize; + x = 0.5 * safezoneW + safezoneX; + y = 0.379 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "['HMG'] spawn OT_fnc_addGarrison"; + }; + class RscButton_1607: RscOverthrowButton + { + idc = 1607; + text = "+1 GMG"; //--- ToDo: Localize; + x = 0.561875 * safezoneW + safezoneX; + y = 0.379 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.077 * safezoneH; + action = "['GMG'] spawn OT_fnc_addGarrison"; + }; + class RscStructuredText_1101: RscOverthrowStructuredText + { + idc = 1101; + x = 0.314375 * safezoneW + safezoneX; + y = 0.489 * safezoneH + safezoneY; + w = 0.37125 * safezoneW; + h = 0.264 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + }; +}; From d028327109e96876a230d578e39b6e783d2953e2 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Fri, 12 May 2017 23:49:39 +1000 Subject: [PATCH 07/16] NATO QRF changes + chem plant --- .../AI/fn_NATOMissionDeployFOB.sqf | 19 +- .../AI/fn_NATOMissionReconDestroy.sqf | 19 +- .../Overthrow.Tanoa/UI/buyVehicleDialog.sqf | 66 +++-- .../UI/fn_reverseEngineerDialog.sqf | 4 +- .../Overthrow.Tanoa/UI/importDialog.sqf | 2 +- .../events/placeExplosives.sqf | 9 + .../Overthrow.Tanoa/factions/GUER.sqf | 9 +- .../Overthrow.Tanoa/factions/NATO.sqf | 111 +++++--- .../Overthrow.Tanoa/funcs/displayShopPic.sqf | 6 + .../missions/Overthrow.Tanoa/init.sqf | 1 + .../missions/Overthrow.Tanoa/initServer.sqf | 9 +- .../missions/Overthrow.Tanoa/initVar.sqf | 57 +++- .../missions/Overthrow.Tanoa/mission.sqm | 108 ++++---- .../AI/NPC/fn_initNATOCheckpoint.sqf | 6 +- .../functions/actions/fn_buy.sqf | 7 + .../factions/NATO/fn_NATOCounterObjective.sqf | 3 + .../factions/NATO/fn_NATOGroundForces.sqf | 39 ++- .../functions/factions/NATO/fn_NATOQRF.sqf | 257 +++++++----------- .../overthrow_main/functions/fn_loadGame.sqf | 7 + 19 files changed, 419 insertions(+), 320 deletions(-) create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf index dcd704dd..58647bdd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf @@ -16,10 +16,15 @@ private _abandoned = server getVariable["NATOabandoned",[]]; }; }; }foreach(OT_NATOobjectives); -_isHQ = false; +_isAir = false; if(isNil "_close") then { - _isHQ = true; - _close = OT_NATO_HQPos; + _isAir = true; + { + _x params ["_obpos","_name","_pri"]; + if !(_name in _abandoned) exitWith { + _close = _obpos; + }; + }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy); }; _start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; _group = [_start, WEST, OT_NATO_Group_Engineers] call BIS_fnc_spawnGroup; @@ -28,7 +33,7 @@ sleep 0.5; _dir = [_start,_posTarget] call BIS_fnc_dirTo; -if(_isHQ) then { +if(_isAir) then { _attackpos = [_posTarget,[0,150]] call SHK_pos; //Determine direction to attack from (preferrably away from water) @@ -49,7 +54,7 @@ if(_isHQ) then { _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos; _tgroup = creategroup blufor; - _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; + _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos; _veh setDir _dir; _tgroup addVehicle _veh; @@ -70,7 +75,7 @@ if(_isHQ) then { sleep 2; - _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; + _moveto = [_close,500,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; @@ -95,7 +100,7 @@ if(_isHQ) then { _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; _wp setWaypointTimeout [15,15,15]; - _moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; + _moveto = [_close,200,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "LOITER"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf index 9afa3a4f..4ea9b415 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf @@ -17,10 +17,15 @@ private _abandoned = server getVariable["NATOabandoned",[]]; }; }; }foreach(OT_NATOobjectives); -_isHQ = false; +_isAir = false; if(isNil "_close") then { - _isHQ = true; - _close = OT_NATO_HQPos; + _isAir = true; + { + _x params ["_obpos","_name","_pri"]; + if !(_name in _abandoned) exitWith { + _close = _obpos; + }; + }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy); }; _start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; _group = [_start, WEST, OT_NATO_Group_Recon] call BIS_fnc_spawnGroup; @@ -29,7 +34,7 @@ sleep 0.5; _dir = [_start,_posTarget] call BIS_fnc_dirTo; -if(_isHQ) then { +if(_isAir) then { _attackpos = [_posTarget,[0,150]] call SHK_pos; //Determine direction to attack from (preferrably away from water) @@ -50,7 +55,7 @@ if(_isHQ) then { _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos; _tgroup = creategroup blufor; - _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; + _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos; _veh setDir _dir; _tgroup addVehicle _veh; @@ -71,7 +76,7 @@ if(_isHQ) then { sleep 2; - _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; + _moveto = [_close,500,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; @@ -96,7 +101,7 @@ if(_isHQ) then { _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; _wp setWaypointTimeout [15,15,15]; - _moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; + _moveto = [_close,200,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "LOITER"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf index b64b9b94..cb961efd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf @@ -14,43 +14,57 @@ if(_obpos distance player < 250) then { }else{ _items = OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]]; }; + if(_obname == "Chemical Plant") then { + _items = OT_explosives + OT_detonators + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]]; + }; } }; if(OT_adminMode) then { - _items = OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]]; + _items = OT_explosives + OT_detonators + OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]]; }; createDialog "OT_dialog_buy"; { _cls = _x select 0; - _price = 0; - if !(_cls == "Set_HMG") then { - _price = [_town,_cls,_standing] call OT_fnc_getPrice; - }; - if("fuel depot" in (server getVariable "OT_NATOabandoned")) then { - _price = round(_price * 0.5); - }; - _name = ""; - _pic = ""; - if(_cls == "Set_HMG") then { - _p = (cost getVariable "I_HMG_01_high_weapon_F") select 0; - _p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0); - private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60; - _p = _p + _quad; - _p = _p + 150; //Convenience cost - _price = _p; - _name = "Quad Bike w/ HMG Backpacks"; - _pic = "C_Quadbike_01_F" call ISSE_Cfg_Vehicle_GetPic; - }else{ - _pic = _cls call ISSE_Cfg_Vehicle_GetPic; - _name = _cls call ISSE_Cfg_Vehicle_GetName; + if((_cls select [0,3]) != "IED") then { + _price = 0; + if !(_cls == "Set_HMG") then { + _price = [_town,_cls,_standing] call OT_fnc_getPrice; + }; + if("fuel depot" in (server getVariable "OT_NATOabandoned")) then { + _price = round(_price * 0.5); + }; + _name = ""; + _pic = ""; + call { + if(_cls == "Set_HMG") exitWith { + _p = (cost getVariable "I_HMG_01_high_weapon_F") select 0; + _p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0); + private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60; + _p = _p + _quad; + _p = _p + 150; //Convenience cost + _price = _p; + _name = "Quad Bike w/ HMG Backpacks"; + _pic = "C_Quadbike_01_F" call ISSE_Cfg_Vehicle_GetPic; + }; + if(_cls in OT_allExplosives) exitWith { + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + _name = _cls call ISSE_Cfg_Magazine_GetName; + }; + if(_cls in OT_allDetonators) exitWith { + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + _name = _cls call ISSE_Cfg_Weapons_GetName; + }; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + _name = _cls call ISSE_Cfg_Vehicle_GetName; + }; + _idx = lbAdd [1500,format["%1",_name]]; + lbSetPicture [1500,_idx,_pic]; + lbSetData [1500,_idx,_cls]; + lbSetValue [1500,_idx,_price]; }; - _idx = lbAdd [1500,format["%1",_name]]; - lbSetPicture [1500,_idx,_pic]; - lbSetData [1500,_idx,_cls]; - lbSetValue [1500,_idx,_price]; }foreach(_items); _price = [_town,OT_item_UAV,_standing] call OT_fnc_getPrice; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf index 26dcf9ad..a73b9668 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf @@ -9,7 +9,7 @@ private _numitems = 0; private _blueprints = server getVariable ["GEURblueprints",[]]; { _cls = _x select 0; - if !(_cls in _blueprints) then { + if !((_cls in _blueprints) or (_cls in OT_allExplosives)) then { _name = ""; _pic = ""; if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { @@ -32,7 +32,7 @@ private _blueprints = server getVariable ["GEURblueprints",[]]; }foreach(_playerstock); { - if (!(_x isKindOf "CaManBase") and alive _x) then { + if (!(_x isKindOf "CaManBase") and alive _x and (damage _x) == 0) then { _cls = typeof _x; _name = _cls call ISSE_Cfg_Vehicle_GetName; _pic = _cls call ISSE_Cfg_Vehicle_GetPic; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf index 11b1fb73..e68641c1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf @@ -18,7 +18,7 @@ _numitems = 0; _cls = [_x] call BIS_fnc_baseWeapon; }; - if !(_cls in _done) then { + if !((_cls in _done) or (_cls in OT_allExplosives)) then { _done pushback _cls; _price = ["Tanoa",_cls,100] call OT_fnc_getPrice; _name = ""; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf new file mode 100644 index 00000000..a822c168 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf @@ -0,0 +1,9 @@ +params ["_exp","_dir","_pitch","_unit"]; + +if !((side _unit == resistance) or (captive _unit)) exitWith {}; +if(_unit call unitSeen) then { + _unit setCaptive false; + if((random 100) > 70 and ((typeof _exp) select [0,3] == "IED")) then { + [[_exp], -3] call ace_explosives_fnc_scriptedExplosive; + }; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index c576f526..d0c1fd1f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -167,9 +167,10 @@ while {true} do { _lastmin = date select 4; _stabcounter = _stabcounter + 1; + private _abandoned = server getVariable ["NATOabandoned",[]]; if(_stabcounter >= 10) then { - private _abandoned = server getVariable ["NATOabandoned",[]]; + _stabcounter = 0; { _town = _x; @@ -190,6 +191,12 @@ while {true} do { }foreach(OT_allTowns); }; + //chemical production + if("Chemical Plant" in _abandoned) then { + private _chems = server getVariable ["reschems",0]; + server setVariable ["reschems",_chems + 1,true]; + }; + //do factory if("Factory" in (server getVariable ["GEURowned",[]])) then { private _currentCls = server getVariable ["GEURproducing",""]; 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 baf5ea75..0e61bd2c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -13,6 +13,8 @@ server setVariable ["NATOattackstart",0,true]; private _lastmin = date select 4; private _lastsched = -1; +//sleep 300 + random(300); + while {sleep 10;true} do { private _numplayers = count([] call CBA_fnc_players); if(_numplayers > 0) then { @@ -113,10 +115,9 @@ while {sleep 10;true} do { _stability = server getVariable format ["stability%1",_town]; _population = server getVariable format ["population%1",_town]; 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 200); - if(_nummil < 3 and _numres > 0) then { - if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) then { + if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) then { + _numres = {side _x == resistance or captive _x} count (_pos nearObjects 1000); + if(_numres > 0) then { server setVariable [format ["garrison%1",_town],0,true]; diag_log format["Overthrow: NATO responding to %1",_town]; [_town,_population] spawn OT_fnc_NATOResponseTown; @@ -131,6 +132,30 @@ while {sleep 10;true} do { }foreach (_sorted); }; + + //Abandon towers + { + _pos = _x select 0; + _name = _x select 1; + 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 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; + _countered = true; + }; + }; + }; + if(_countered) exitWith {}; + }foreach(OT_NATOcomms); + + //Check on FOBs _clearedFOBs = []; { @@ -159,7 +184,11 @@ while {sleep 10;true} do { _nextturn = OT_NATOwait + random OT_NATOwait; _count = 0; - //Abandon towns (under 50 pop) + //Recover resources + _resources = _resources + _resourceGain + ((count _abandoned) * 25); + + //Abandon towns (under 50 pop) and counter + _lastcounter = server getVariable ["NATOlastcounter",""]; { _town = _x; _pos = server getVariable _town; @@ -171,50 +200,50 @@ while {sleep 10;true} do { if(_nummil < 3 and _numres > 0) then { if(_population < 50) then { if(_stability < 10 and !(_town in _abandoned)) then { + //Abandon a town _abandoned pushback _town; server setVariable [format ["garrison%1",_town],0,true]; format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false]; [_town,15] call stability; }; + }else{ + if(_town != _lastcounter) then { + if((_town in _abandoned) and (_resources > _population) and (random 100) > 98) then { + //Counter a town + [_town,_population] spawn OT_fnc_NATOCounterTown; + server setVariable ["NATOlastcounter",_town,true]; + server setVariable ["NATOattacking",_town,true]; + server setVariable ["NATOattackstart",time,true]; + _resources = _resources - _population; + _countered = true; + }; + }; }; }; }; - if(_abandonedSomething) exitWith {}; + if(_abandonedSomething or _countered) exitWith {}; }foreach (OT_allTowns); - if(!_abandonedSomething) then { - //Abandon towers - { - _pos = _x select 0; - _name = _x select 1; - 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 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; - _abandonedSomething = true; - }; - }; - }; - if(_abandonedSomething) exitWith {}; - }foreach(OT_NATOcomms); - }; - - //Recover resources - _resources = _resources + _resourceGain + ((count _abandoned) * 25); + { + _x params ["_pos","_name","_pri"]; + if((_name != _lastcounter) and (_name in _abandoned) and (_resources > _pri) and (random 100) > 98) exitWith { + //Counter an objective + + [_name,_resources] spawn OT_fnc_NATOCounterObjective; + server setVariable ["NATOlastcounter",_name,true]; + server setVariable ["NATOattacking",_name,true]; + server setVariable ["NATOattackstart",time,true]; + _countered = true; + _resources = 0; + }; + }foreach (OT_allObjectiveData + OT_airportData); //Spawn missing drones { _x params ["_pos","_name"]; if !(_name in _abandoned) then { _drone = spawner getVariable [format["drone%1",_name],objNull]; - if(isNull _drone or !alive _drone) then { + if((isNull _drone or !alive _drone) and _resources > 10) then { _targets = []; { _town = _x; @@ -298,7 +327,7 @@ while {sleep 10;true} do { _spend = 1200; }; - if((_spend > 500) and (count _fobs) < 3 and (random 100) > 95) then { + if((_spend > 500) and (count _fobs) < 3 and (random 100) > _chance) then { //Deploy an FOB _lowest = ""; { @@ -335,7 +364,7 @@ while {sleep 10;true} do { _x params ["_ty","_pos","_pri","_obj","_done"]; if !(_done) then { if(_ty == "WH" or _ty == "PS" or _ty == "WS") then { - if(_spend > 250 and (random 100) > 95) then { + if(_spend > 250 and (random 100) > _chance) then { _schedule pushback ["DESTROY",_ty,_pos]; _spend = _spend - 250; _resources = _resources -250; @@ -344,7 +373,7 @@ while {sleep 10;true} do { }; }; }foreach(_targets); - if(_spend > 500 and (random 100) > 95) then { + if(_spend > 500 and (random 100) > _chance) then { _low = 50; _lowest = ""; { @@ -401,7 +430,7 @@ while {sleep 10;true} do { if(_pri > 1200) then { _max = 32; }; - if(!(_pos call OT_fnc_inSpawnDistance) and (_garrison < _max) and (_spend > 150) and (random 100 > 95)) then { + if(!(_pos call OT_fnc_inSpawnDistance) and (_garrison < _max) and (_spend > 150) and (random 100 > _chance)) then { server setvariable [format["garrison%1",_name],_garrison+4,true]; _spend = _spend - 150; _resources = _resources - 150; @@ -413,7 +442,7 @@ while {sleep 10;true} do { { _x params ["_pos","_garrison","_upgrades"]; _max = 16; - if((_garrison < _max) and (_spend > 150) and (random 100 > 95)) exitWith { + if((_garrison < _max) and (_spend > 150) and (random 100 > _chance)) exitWith { _x set [1,_garrison + 4]; _spend = _spend - 150; _resources = _resources - 150; @@ -432,19 +461,19 @@ while {sleep 10;true} do { }; _group call OT_fnc_initMilitaryPatrol; }; - if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > 95)) exitWith { + if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > _chance)) exitWith { _spend = _spend - 300; _resources = _resources - 300; _upgrades pushback "Mortar"; [_pos,["Mortar"]] spawn OT_fnc_NATOupgradeFOB; }; - if(!("Barriers" in _upgrades) and (_spend > 50) and (random 100 > 95)) exitWith { + if(!("Barriers" in _upgrades) and (_spend > 50) and (random 100 > _chance)) exitWith { _spend = _spend - 50; _resources = _resources - 50; _upgrades pushback "Barriers"; [_pos,["Barriers"]] spawn OT_fnc_NATOupgradeFOB; }; - if(!("HMG" in _upgrades) and (_spend > 150) and (random 100 > 95)) exitWith { + if(!("HMG" in _upgrades) and (_spend > 150) and (random 100 > _chance)) exitWith { _spend = _spend - 150; _resources = _resources - 150; _upgrades pushback "HMG"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf index de058e92..fbfca94c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf @@ -67,6 +67,12 @@ if !(isNil "_pic") then { ctrlSetText [1200,_pic]; }; +if(_cls in OT_allExplosives) then { + _cost = cost getVariable _cls; + _chems = server getVariable ["reschems",0]; + _desc = format["Required: %1 x chemicals (%2 available)
%3",_cost select 3,_chems,_desc]; +}; + _textctrl = (findDisplay 8000) displayCtrl 1100; _textctrl ctrlSetStructuredText parseText format[" diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf index 0045a3b5..dd8997b2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf @@ -62,6 +62,7 @@ if(!isMultiplayer) then { //ACE events ["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler; ["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler; + ["ace_explosives_place",compile preprocessFileLineNumbers "events\placeExplosives.sqf"] call CBA_fnc_addEventHandler; //Setup fuel pumps for interaction { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf index 9a9e558b..86ecc4a9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf @@ -43,11 +43,10 @@ waitUntil {!isNil "OT_economyLoadDone" and !isNil "OT_fnc_registerSpawner"}; [] execVM "virtualization\economy.sqf"; [] execVM "virtualization\factions.sqf"; -if(OT_hasAce) then { - //ACE events - ["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler; - ["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler; -}; + +["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler; +["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler; +["ace_explosives_place",compile preprocessFileLineNumbers "events\placeExplosives.sqf"] call CBA_fnc_addEventHandler; addMissionEventHandler ["HandleDisconnect",compile preprocessFileLineNumbers "events\playerDisconnect.sqf"]; addMissionEventHandler ["HandleConnnect",compile preprocessFileLineNumbers "events\playerConnect.sqf"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index bcc2cb9d..ff8f0041 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -559,6 +559,12 @@ private _allOptics = " { getNumber ( _x >> ""ItemInfo"" >> ""optics"" ) isEqualTo 1}) " configClasses ( configFile >> "cfgWeapons" ); +private _allDetonators = " + ( getNumber ( _x >> ""scope"" ) isEqualTo 2 + && + { getNumber ( _x >> ""ace_explosives_Detonator"" ) isEqualTo 1}) +" configClasses ( configFile >> "cfgWeapons" ); + private _allUniforms = " ( getNumber ( _x >> ""scope"" ) isEqualTo 2 && @@ -602,6 +608,10 @@ OT_allOptics = []; OT_allHelmets = []; OT_allHats = []; OT_allAttachments = []; +OT_allExplosives = []; +OT_explosives = []; +OT_detonators = []; +OT_allDetonators = []; { _name = configName _x; @@ -634,7 +644,7 @@ OT_allAttachments = []; }foreach(getArray(configFile >> "CfgVehicles" >> _cls >> "weapons")); //Get ammo { - if !(_x in _blacklist) then { + if !(_x in _blacklist or _x in OT_allExplosives) then { if !(_x in _weapons) then {_weapons pushback _x}; }; }foreach(getArray(configFile >> "CfgVehicles" >> _cls >> "magazines")); @@ -758,26 +768,57 @@ OT_allAttachments = []; { _name = configName _x; _m = getNumber(_x >> "mass"); - if(_name isKindOf ["CA_Magazine",configFile >> "CfgMagazines"] and _name != "NLAW_F") then { + if(_name isKindOf ["CA_Magazine",configFile >> "CfgMagazines"] and (_name != "NLAW_F") and !(_name isKindOf ["VehicleMagazine",configFile >> "CfgMagazines"])) then { _cost = round(_m * 4); _desc = getText(_x >> "descriptionShort"); + _exp = false; + _steel = 0.1; + _plastic = 0; + if(getNumber(_x >> "ace_explosives_Placeable") == 1) then { + _exp = true; + }; if((_desc find "Smoke") > -1) then { _cost = round(_m * 0.5); + }else{ + if((_desc find "Grenade") > -1) then { + _cost = round(_m * 2); + _exp = true; + }; }; - if((_desc find "Flare") > -1) then { + if((_desc find "Flare") > -1 or (_desc find "flare") > -1) then { _cost = round(_m * 0.6); + _exp = false; }; - if((_desc find "Grenade") > -1) then { - _cost = round(_m * 2); - }; + if(_name == OT_ammo_50cal) then {_cost = 50}; + + if(_exp) then { + _steel = 0; + _plastic = round(_m * 0.5); + OT_allExplosives pushback _name; + OT_explosives pushback [_name,_cost,0,_steel,_plastic]; + }else{ + OT_allMagazines pushback _name; + }; if(isServer) then { - cost setVariable [_name,[_cost,0,0.1,0],true]; + cost setVariable [_name,[_cost,0,_steel,_plastic],true]; }; - OT_allMagazines pushback _name; }; } foreach (_allAmmo); +{ + _name = configName _x; + _m = getNumber(_x >> "ItemInfo" >> "mass"); + if(getNumber(_x >> "ace_explosives_Range") > 1000) then { + _m = _m * 10; + }; + OT_allDetonators pushback _name; + OT_detonators pushback [_name,_m,0,0.1,0]; + if(isServer) then { + cost setVariable [_name,[_m,0,0.1,0],true]; + }; +} foreach (_allDetonators); + if(isServer) then { //Remainding vehicle costs { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 9d05d461..69727219 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=274; + nextID=294; }; class Camera { @@ -1205,6 +1205,7 @@ class Mission flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; name="bigboss"; description="Host"; @@ -2462,6 +2463,7 @@ class Mission flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -2661,6 +2663,7 @@ class Mission flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -2925,6 +2928,7 @@ class Mission flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3124,6 +3128,7 @@ class Mission flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3316,13 +3321,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8256.2539,2.3171685,1133.2538}; - angles[]={0,2.4981525,0}; + position[]={8256.2539,2.3174651,1133.254}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3346,7 +3352,7 @@ class Mission }; id=1788; type="I_G_Soldier_F"; - atlOffset=0.25373316; + atlOffset=0.25399995; class CustomAttributes { class Attribute0 @@ -3490,7 +3496,7 @@ class Mission { }; id=1787; - atlOffset=0.25373316; + atlOffset=0.25399995; }; class Item43 { @@ -3515,13 +3521,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8254.4824,1.3515821,1124.9368}; - angles[]={0,2.4981525,0}; + position[]={8254.4824,1.3518713,1124.937}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3545,7 +3552,7 @@ class Mission }; id=1791; type="I_G_Soldier_F"; - atlOffset=0.108729; + atlOffset=0.10899997; class CustomAttributes { class Attribute0 @@ -3689,7 +3696,7 @@ class Mission { }; id=1790; - atlOffset=0.108729; + atlOffset=0.10899997; }; class Item45 { @@ -3714,13 +3721,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8252.9834,1.5238681,1126.812}; - angles[]={0,2.4981525,0}; + position[]={8252.9834,1.5235863,1126.812}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3744,7 +3752,7 @@ class Mission }; id=1794; type="I_G_Soldier_F"; - atlOffset=0.14028168; + atlOffset=0.13999987; class CustomAttributes { class Attribute0 @@ -3888,7 +3896,7 @@ class Mission { }; id=1793; - atlOffset=0.14028168; + atlOffset=0.13999987; }; class Item47 { @@ -3913,13 +3921,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8250.415,1.6760843,1130.4153}; - angles[]={0,2.4981525,0}; + position[]={8250.415,1.6765374,1130.415}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -3943,7 +3952,7 @@ class Mission }; id=1797; type="I_G_Soldier_F"; - atlOffset=0.12352729; + atlOffset=0.12399995; class CustomAttributes { class Attribute0 @@ -4087,7 +4096,7 @@ class Mission { }; id=1796; - atlOffset=0.12352729; + atlOffset=0.12399995; }; class Item49 { @@ -4112,13 +4121,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8253.6445,2.5550501,1134.1543}; - angles[]={0,2.4981525,0}; + position[]={8253.6445,2.5549362,1134.1541}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -4142,7 +4152,7 @@ class Mission }; id=1800; type="I_G_Soldier_F"; - atlOffset=0.40408397; + atlOffset=0.40399981; class CustomAttributes { class Attribute0 @@ -4286,7 +4296,7 @@ class Mission { }; id=1799; - atlOffset=0.40408397; + atlOffset=0.40399981; }; class Item51 { @@ -4311,13 +4321,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8258.5771,0.14868355,1134.9779}; - angles[]={0,2.4981525,0}; + position[]={8258.5771,0.14835906,1134.978}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -4341,7 +4352,7 @@ class Mission }; id=1803; type="I_G_Soldier_F"; - atlOffset=-2.4196291; + atlOffset=-2.4200001; class CustomAttributes { class Attribute0 @@ -4485,7 +4496,7 @@ class Mission { }; id=1802; - atlOffset=-2.4196291; + atlOffset=-2.4200001; }; class Item53 { @@ -4510,13 +4521,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8257.6729,1.984525,1129.015}; - angles[]={0,2.4981525,0}; + position[]={8257.6729,1.9845835,1129.015}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -4540,7 +4552,7 @@ class Mission }; id=1806; type="I_G_Soldier_F"; - atlOffset=0.42794144; + atlOffset=0.42799997; class CustomAttributes { class Attribute0 @@ -4684,7 +4696,7 @@ class Mission { }; id=1805; - atlOffset=0.42794144; + atlOffset=0.42799997; }; class Item55 { @@ -6058,13 +6070,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8256.4756,1.618032,1126.9211}; - angles[]={0,2.4981525,0}; + position[]={8256.4756,1.6179008,1126.921}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=2; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -6088,7 +6101,7 @@ class Mission }; id=1809; type="I_G_Soldier_F"; - atlOffset=0.2501204; + atlOffset=0.25; class CustomAttributes { class Attribute0 @@ -6232,7 +6245,7 @@ class Mission { }; id=1808; - atlOffset=0.2501204; + atlOffset=0.25; }; class Item70 { @@ -6246,13 +6259,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8251.585,1.2179973,1124.9506}; - angles[]={0,2.4981525,0}; + position[]={8251.585,1.2179425,1124.951}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -6276,7 +6290,7 @@ class Mission }; id=1812; type="I_G_Soldier_F"; - atlOffset=0.07810235; + atlOffset=0.077999949; class CustomAttributes { class Attribute0 @@ -6420,7 +6434,7 @@ class Mission { }; id=1811; - atlOffset=0.07810235; + atlOffset=0.077999949; }; class Item71 { @@ -6445,13 +6459,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8253.5996,0.81719291,1120.6194}; - angles[]={0,2.4981525,0}; + position[]={8253.5996,0.81686687,1120.619}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -6475,7 +6490,7 @@ class Mission }; id=1940; type="I_G_Soldier_F"; - atlOffset=-0.013695061; + atlOffset=-0.014000058; class CustomAttributes { class Attribute0 @@ -6619,7 +6634,7 @@ class Mission { }; id=1939; - atlOffset=-0.013695061; + atlOffset=-0.014000058; }; class Item73 { @@ -6644,13 +6659,14 @@ class Mission dataType="Object"; class PositionInfo { - position[]={8257.1074,0.86964691,1121.6503}; - angles[]={0,2.4981525,0}; + position[]={8257.1074,0.86989158,1121.65}; + angles[]={0,2.4981596,0}; }; side="Independent"; flags=6; class Attributes { + rank="COLONEL"; init="this setCaptive true;"; isPlayable=1; class Inventory @@ -6674,7 +6690,7 @@ class Mission }; id=1943; type="I_G_Soldier_F"; - atlOffset=-0.039268434; + atlOffset=-0.038999975; class CustomAttributes { class Attribute0 @@ -6818,7 +6834,7 @@ class Mission { }; id=1942; - atlOffset=-0.039268434; + atlOffset=-0.038999975; }; class Item75 { @@ -6872,7 +6888,7 @@ class Mission "STRING" }; }; - value="zeus_guy"; + value="bigboss"; }; }; }; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf index 60e5ca2f..fa3ae4bd 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf @@ -15,6 +15,7 @@ private _bargates = _start nearobjects ["Land_BarGate_F",50]; while {!(isNil "_group") and count (units _group) > 0} do { _vehs = []; + _friendly = []; private _leader = leader _group; { @@ -29,6 +30,9 @@ while {!(isNil "_group") and count (units _group) > 0} do { _vehs pushBack _x; }; }; + if(_unit isKindOf "LandVehicle" and (side _x == west)) then { + _friendly pushback _x; + }; if !(_unit in _inrange or _unit in _searching or _unit in _searched) then { if(_unit call unitSeenNATO) then { @@ -45,7 +49,7 @@ while {!(isNil "_group") and count (units _group) > 0} do { }; }foreach(_start nearentities [["CaManBase","LandVehicle"],_outerRange]); - if((count _vehs) > 0) then { + if((count _vehs) > 0 or (count _friendly) > 0) then { { _x animate ["Door_1_rot",1]; }foreach(_bargates); diff --git a/addons/overthrow_main/functions/actions/fn_buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf index e8a79f32..dd06972a 100644 --- a/addons/overthrow_main/functions/actions/fn_buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -8,6 +8,10 @@ _standing = player getVariable format['rep%1',_town]; _price = lbValue [1500,_idx]; if(_price == -1) exitWith {}; +private _chems = server getVariable ["reschems",0]; +private _cost = cost getVariable _cls; +if(_cls in OT_allExplosives and _chems < (_cost select 3)) exitWith {format["You need %1 chemicals",_cost select 3] call OT_fnc_notifyMinor}; + _money = player getVariable "money"; if(_money < _price) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor}; @@ -150,6 +154,9 @@ call { playSound "3DEN_notificationDefault"; }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + if(_cls in OT_allExplosives) then { + _server setVariable ["reschems",_chems - (_cost select 3),true]; + }; [-_price] call money; player addMagazine _cls; playSound "3DEN_notificationDefault"; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf index d1d9b0a7..d546bece 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf @@ -22,5 +22,8 @@ _success = { _count = {(_x getVariable ["garrison",""]) == _objective} count (allunits); server setVariable [format["garrison%1",_objective],_count,true]; _objective setMarkerType "flag_NATO"; + if(_objective == "Chemical Plant") then { + server setVariable ["reschems",0,true]; + }; }; [_posObjective,_strength,_success,_fail,[_tskid,_objective],_objective] spawn OT_fnc_NATOQRF; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf index 6a888ffe..d039910f 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf @@ -8,7 +8,7 @@ private _tgroup = false; if !(_byair) then { sleep 0.2; _squadtype = OT_NATO_GroundForces call BIS_fnc_SelectRandom; - _spawnpos = [_spawnpos,[0,50]] call SHK_pos; + _spawnpos = [_frompos,[50,75]] call SHK_pos; _group2 = [_spawnpos, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> _squadtype)] call BIS_fnc_spawnGroup; }; sleep 0.5; @@ -64,19 +64,14 @@ if !(_byair) then { if(typename _tgroup == "GROUP") then { _x moveInCargo _veh; }; - [_x] joinSilent _group1; _x setVariable ["VCOM_NOPATHING_Unit",true,false]; _allunits pushback _x; _x setVariable ["garrison","HQ",false]; }foreach(units _group2); + spawner setVariable ["NATOattackforce",(spawner getVariable ["NATOattackforce",[]])+[_group2],false]; }; - - -{ - _x addCuratorEditableObjects [_allunits,true]; -} forEach allCurators; -sleep 1; +sleep 5; if(_byair and (typename _tgroup == "GROUP")) then { _wp = _tgroup addWaypoint [_frompos,0]; _wp setWaypointType "MOVE"; @@ -117,33 +112,40 @@ if(_byair and (typename _tgroup == "GROUP")) then { if(typename _tgroup == "GROUP") then { _veh setdamage 0; _dir = [_attackpos,_frompos] call BIS_fnc_dirTo; - _roads = ([_attackpos,200,_dir] call BIS_fnc_relPos) nearRoads 200; + _roads = _ao nearRoads 50; private _dropos = _ao; if(count _roads > 0) then { _dropos = getpos(_roads select (count _roads - 1)); }; _move = _tgroup addWaypoint [_dropos,0]; _move setWaypointBehaviour "CARELESS"; + _move setWaypointType "MOVE"; + + _move = _tgroup addWaypoint [_dropos,0]; _move setWaypointTimeout [30,30,30]; _move setWaypointType "TR UNLOAD"; _wp = _tgroup addWaypoint [_frompos,0]; _wp setWaypointType "MOVE"; - _wp setWaypointSpeed "LIMITED"; + _wp setWaypointBehaviour "CARELESS"; _wp setWaypointCompletionRadius 25; _wp = _tgroup addWaypoint [_frompos,0]; _wp setWaypointType "SCRIPTED"; _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"]; + + { + _x addCuratorEditableObjects [(units _tgroup)+[_veh],true]; + } forEach allCurators; }; }; sleep 10; -_wp = _group1 addWaypoint [asltoatl _attackpos,20]; +_wp = _group1 addWaypoint [_attackpos,20]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointSpeed "FULL"; -_wp = _group1 addWaypoint [asltoatl _attackpos,0]; +_wp = _group1 addWaypoint [_attackpos,0]; _wp setWaypointType "GUARD"; _wp setWaypointBehaviour "COMBAT"; @@ -151,3 +153,16 @@ _group1 call distributeAILoad; if(typename _tgroup == "GROUP") then { _tgroup call distributeAILoad; }; + +if !(_byair) then { + _wp = _group2 addWaypoint [_attackpos,20]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointSpeed "FULL"; + + _wp = _group2 addWaypoint [_attackpos,0]; + _wp setWaypointType "GUARD"; + _wp setWaypointBehaviour "COMBAT"; + + _group2 call distributeAILoad; +}; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf index 01dd2e17..aaabf1d5 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf @@ -1,15 +1,8 @@ params ["_pos","_strength","_success","_fail","_params","_garrison"]; private _numPlayers = count([] call CBA_fnc_players); -if(_numPlayers < 3) then { - _strength = round(_strength * 0.4); -}else{ - if(_numPlayers < 6) then { - _strength = round(_strength * 0.7); - }else{ - if(_numPlayers > 10) then { - _strength = round(_strength * 1.5); - }; - } + +if(_numPlayers > 3) then { + _strength = round(_strength * 1.5); }; private _diff = server getVariable ["OT_difficulty",1]; if(_diff == 0) then { @@ -20,183 +13,121 @@ if(_diff == 2) then { }; spawner setVariable ["NATOattackforce",[],false]; -//determine possible vectors for non-infantry assets and distribute strength to each - -private _isCoastal = false; -private _objectiveIsControlled = false; -private _airfieldIsControlled = false; - -private _seaStrength = 0; -private _landStrength = 0; -private _airStrength = 0; - -//Sea? -if(surfaceIsWater ([_pos,500,0] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,90] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,180] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,270] call BIS_fnc_relPos)) then { - _isCoastal = true; -}; - -if(OT_NATO_Navy_HQ in (server getvariable ["NATOabandoned",[]])) then { - _isCoastal = false; -}; - -//Land? +//determine possible vectors and distribute strength to each private _town = _pos call OT_fnc_nearestTown; private _region = server getVariable format["region_%1",_town]; -private _closestObjectivePos = []; -private _closestObjective = ""; -private _dist = 20000; + +_ground = []; +_air = []; +_abandoned = server getvariable ["NATOabandoned",[]]; { - _p = _x select 0; - _name = _x select 1; - if(_p inArea _region and !(_name in (server getvariable ["NATOabandoned",[]]))) then { - _d = (_p distance _pos); - if(_d < _dist and _d > 500) then { - _dist = _d; - _closestObjectivePos = _p; - _closestObjective = _name; + _x params ["_obpos","_name","_pri"]; + if !(_name in _abandoned) then { + if([_pos,_obpos] call OT_fnc_regionIsConnected) then { + _ground pushback _x; + }; + if(_x in OT_airportData) then { + _air pushback _x; }; }; -}foreach(OT_NATOobjectives); - -if (count _closestObjectivePos > 0) then { - _objectiveIsControlled = true; -}; - -private _closestAirfieldPos = []; -private _closestAirfield = ""; -private _dist = 20000; +}foreach([OT_objectiveData + OT_airportData,[],{_pos distance (_x select 0)},"ASCEND"] call BIS_fnc_SortBy); +diag_log format["Overthrow: NATO QRF spend is %1",_strength]; { - _p = _x select 0; - _name = _x select 1; - if(_name in OT_allAirports) then { - _d = (_p distance _pos); - if(_d < _dist and _d > 1500) then { - _dist = _d; - _closestAirfieldPos = _p; - _closestAirfield = _name; + _x params ["_obpos","_name","_pri"]; + + _dir = [_pos,_obpos] call BIS_fnc_dirTo; + _ao = [_pos,_dir] call OT_fnc_getAO; + [_obpos,_ao,_pos,false,10] spawn OT_fnc_NATOGroundForces; + diag_log format["Overthrow: NATO Sent ground forces from %1",_name]; + _strength = _strength - 150; + if((_obpos inArea _region) and _strength >= 150) then { + [_obpos,_ao,_pos,false,30] spawn OT_fnc_NATOGroundForces; + _strength = _strength - 150; + diag_log format["Overthrow: NATO Sent extra ground forces from %1",_name]; + }; + //If this is a major objective, send ground support + if(_pri > 250 and _strength >= 100) then { + _strength = _strength - 100; + _send = 100; + if(_strength >= 100 and (random 100) > 70) then { + _send = 300; + _strength = _strength - 100; }; + [_obpos,_pos,_send,0] spawn OT_fnc_NATOGroundSupport; + diag_log format["Overthrow: NATO Sent ground support from %1",_name]; }; -}foreach(OT_NATOobjectives); + if(_strength <=0) exitWith {}; +}foreach(_ground); -if (_closestAirfield != "") then { - if !(_closestAirfield in (server getvariable ["NATOabandoned",[]])) then { - _airfieldIsControlled = true; - }; -}; +if(_strength >= 75) then { + { + _x params ["_obpos","_name","_pri"]; -private _s = _strength; + _dir = [_pos,_obpos] call BIS_fnc_dirTo; + _ao = [_pos,_dir] call OT_fnc_getAO; + [_obpos,_ao,_pos,true,0] spawn OT_fnc_NATOGroundForces; + diag_log format["Overthrow: NATO Sent ground forces by air from %1",_name]; + _strength = _strength - 75; + + //If this is a major airfield, send CAS + if((_pri > 1000 and _strength >= 250) and (random 100) > 70) then { + _strength = _strength - 250; + [[_obpos,[0,100],random 360] call SHK_pos,_pos,10] spawn OT_fnc_NATOAirSupport; + diag_log format["Overthrow: NATO Sent CAS from %1",_name]; + }; -if(_isCoastal) then { - _seaStrength = round(random _s); - _s = _s - _seaStrength; + if(_strength <=0) exitWith {}; + }foreach(_air); }; -if(_s > 0 and _objectiveIsControlled) then { - _landStrength = round(random _s); - _s = _s - _landStrength; -}; -if(_s > 0) then { - _airStrength = _s; -}; -diag_log format["Overthrow: Attack start on %1 (sea:%2 land:%3 air:%4)",_pos,_seaStrength,_landStrength,_airStrength]; -private _delay = 0; +private _isCoastal = false; +private _seaAO = []; -if(_seaStrength > 0) then { - private _numgroups = 1; - if(_seaStrength > 50) then {_numgroups = 2}; - if(_seaStrength > 150) then {_numgroups = 3}; +//Sea? - private _p = getMarkerPos OT_NATO_Navy_HQ; - private _count = 0; - while {_count < _numgroups} do { - diag_log format["Overthrow: Sending sea support %1",_p]; - [[_p,[0,100],random 360] call SHK_pos,_pos,_delay] spawn OT_fnc_NATOSeaSupport; - _count = _count + 1; - _delay = _delay + 20; +call { + private _p = [_pos,500,0] call BIS_fnc_relPos; + if(surfaceIsWater _p) exitWith { + _isCoastal = true; + _seaAO = _p; }; -}; - -//Ground units - -//Send main force via HQ by air -private _dir = [_pos,OT_NATO_HQPos] call BIS_fnc_dirTo; -private _ao = [_pos,_dir] call OT_fnc_getAO; - -private _max = 5; -if(_numPlayers < 3 or _diff == 0) then { - _max = 3; -}; -if(_numPlayers > 10 or _diff > 1) then { - _max = 7; -}; -private _numgroups = 1+floor(_strength / 100); -if(_numgroups > _max) then { - _numgroups = _max; -}; -private _count = 0; -if(_delay > 0) then { - _delay = _delay + 10; -}; -while {_count < _numgroups} do { - //diag_log format["Overthrow: Sending HQ ground forces %1",_ao]; - [OT_NATO_HQPos,_ao,_pos,true,_delay] spawn OT_fnc_NATOGroundForces; - _ao = [_pos,_dir] call OT_fnc_getAO; - _count = _count + 1; - _delay = _delay + 20; -}; - -if(_objectiveIsControlled) then { - //send some units by ground from the closest objective - _dir = [_pos,_closestObjectivePos] call BIS_fnc_dirTo; - _ao = [_pos,_dir] call OT_fnc_getAO; - - [_closestObjectivePos,_pos,_landStrength,0] spawn OT_fnc_NATOGroundSupport; - - _numgroups = 1+floor(_landStrength / 250); - if(_numgroups > 2) then { - _numgroups = 2; + _p = [_pos,500,90] call BIS_fnc_relPos; + if(surfaceIsWater _p) exitWith { + _isCoastal = true; + _seaAO = _p; }; - _count = 0; - _delay = 20; - while {_count < _numgroups} do { - //diag_log format["Overthrow: Sending ground forces %1",_closestObjectivePos]; - [_closestObjectivePos,_ao,_pos,false,_delay] spawn OT_fnc_NATOGroundForces; - _ao = [_pos,_dir] call OT_fnc_getAO; - _count = _count + 1; - _delay = _delay + 10; + _p = [_pos,500,180] call BIS_fnc_relPos; + if(surfaceIsWater _p) exitWith { + _isCoastal = true; + _seaAO = _p; + }; + _p = [_pos,500,270] call BIS_fnc_relPos; + if(surfaceIsWater _p) exitWith { + _isCoastal = true; + _seaAO = _p; }; }; -if(_airfieldIsControlled) then { - //send some units by air from the closest airfield - _dir = [_pos,_closestAirfieldPos] call BIS_fnc_dirTo; - _ao = [_pos,_dir] call OT_fnc_getAO; - _numgroups = 1; - if(_airStrength < 60) then {_numgroups = 0}; - _count = 0; - _delay = 0; - while {_count < _numgroups} do { - //diag_log format["Overthrow: Sending Air support %1",_closestAirfieldPos]; - [[_closestAirfieldPos,[0,100],random 360] call SHK_pos,_pos,_delay] spawn OT_fnc_NATOAirSupport; - _count = _count + 1; - _delay = _delay + 20; - }; - _numgroups = floor(_strength / 150); - if(_numgroups > 2) then { - _numgroups = 2; - }; - _count = 0; - _delay = 0; +diag_log format["Overthrow: Attack start on %1",_pos]; +private _delay = 0; + +if(_isCoastal and !(OT_NATO_Navy_HQ in _abandoned) and (random 100) > 70) then { + private _numgroups = 1; + if(_strength > 100) then {_numgroups = 2}; + if(_strength > 200) then {_numgroups = 3}; + + private _p = getMarkerPos OT_NATO_Navy_HQ; + private _count = 0; while {_count < _numgroups} do { - [_closestAirfieldPos,_ao,_pos,true,_delay] spawn OT_fnc_NATOGroundForces; - _ao = [_pos,_dir] call OT_fnc_getAO; + diag_log format["Overthrow: NATO Sent navy support from %1",OT_NATO_Navy_HQ]; + [[_p,[0,100],random 360] call SHK_pos,_seaAO,_delay] spawn OT_fnc_NATOSeaSupport; _count = _count + 1; _delay = _delay + 20; }; }; -sleep 200; //Give NATO some time to get their shit together +sleep 300; //Give NATO some time to get their shit together private _timeout = time + 800; @@ -262,7 +193,7 @@ while {sleep 5;time < _timeout and !_won} do { }; }; }foreach(allunits); - if(_natowin and (_alivein == 0 or _enemy > 0)) then { + if(_natowin and (_alivein < _enemy)) then { _natowin = false; }; @@ -303,12 +234,12 @@ while {sleep 5;time < _timeout and !_won} do { }foreach(vehicles); _won = true; }; - if(_alivein > 0 and _enemy == 0) then { + if(_alivein > _enemy) then { sleep 30; //Buffer zone _natowin = true; }; //diag_log format["Overthrow: Win/Loss BLU %1 RES %2",_alive,_enemy]; - if(_alive < 4 or (_enemyin > 0 and _alivein < 4)) exitWith{}; + if(_alive < 4) exitWith{}; }; if !(_won) then { _params call _fail; diff --git a/addons/overthrow_main/functions/fn_loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf index a9141b0f..7370c894 100644 --- a/addons/overthrow_main/functions/fn_loadGame.sqf +++ b/addons/overthrow_main/functions/fn_loadGame.sqf @@ -14,6 +14,13 @@ private _cc = 0; { _key = _x select 0; _val = _x select 1; + if(typename _val == "ARRAY") then { + _new = []; + { + _new pushback _x; + }foreach(_val); + _val = _new; + }; _set = true; if(_key == "buildingpositions") then { { From 27ed72675afa869db98e58e25b121aee07754511 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Sat, 13 May 2017 15:06:47 +1000 Subject: [PATCH 08/16] tweaks --- .../AI/fn_NATOMissionDeployFOB.sqf | 2 +- .../AI/fn_NATOMissionReconDestroy.sqf | 2 +- .../actions/fn_addGarrison.sqf | 2 + .../actions/recruitSoldier.sqf | 2 + .../Overthrow.Tanoa/actions/recruitSquad.sqf | 4 +- .../missions/Overthrow.Tanoa/description.ext | 2 +- .../Overthrow.Tanoa/factions/NATO.sqf | 59 +++++++++---- .../Overthrow.Tanoa/funcs/unitSeen.sqf | 9 +- .../Overthrow.Tanoa/funcs/unitSeenCRIM.sqf | 9 +- .../Overthrow.Tanoa/funcs/unitSeenNATO.sqf | 9 +- .../missions/Overthrow.Tanoa/initFuncs.sqf | 43 +++++++++- .../Overthrow.Tanoa/initPlayerLocal.sqf | 2 +- .../missions/Overthrow.Tanoa/initVar.sqf | 1 + .../interaction/initObjectLocal.sqf | 4 - .../functions/actions/fn_buy.sqf | 1 + .../functions/actions/fn_recruitCiv.sqf | 2 + .../economy/fn_getRealEstateData.sqf | 4 +- .../factions/NATO/fn_NATOSupportRecon.sqf | 86 ++++++++++--------- addons/overthrow_main/ui/dialogs/main.hpp | 14 +-- 19 files changed, 170 insertions(+), 87 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf index 58647bdd..077dfa31 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf @@ -1,7 +1,7 @@ params ["_posTarget"]; private _close = nil; -private _dist = 4000; +private _dist = 3000; private _closest = ""; private _abandoned = server getVariable["NATOabandoned",[]]; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf index 4ea9b415..5aedafcd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf @@ -2,7 +2,7 @@ params ["_knownPos"]; private _posTarget = _knownPos; private _close = nil; -private _dist = 4000; +private _dist = 2000; private _closest = ""; private _abandoned = server getVariable["NATOabandoned",[]]; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf index 6d098387..ac7a835f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf @@ -9,6 +9,8 @@ if(_pos distance player > 30) then { _code = _b select 1; }; +if({side _x == west or side _x == east} count (_pos nearEntities 50)) exitWith {"You cannot garrison with enemies nearby" call OT_fnc_notifyMinor}; + _group = spawner getVariable [format["resgarrison%1",_code],grpNull]; _doinit = false; if(isNull _group) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf index c1581920..0be7b101 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf @@ -4,6 +4,8 @@ private _cls = _this select 0; private _pos = _this select 1; private _group = _this select 2; +if({side _x == west or side _x == east} count (_pos nearEntities 50) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; + _soldier = _cls call OT_fnc_getSoldier; private _money = player getVariable ["money",0]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf index 4ad33db5..c785e77f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf @@ -4,6 +4,8 @@ private _cls = _this select 0; private _pos = _this select 1; private _cc = player getVariable ["OT_squadcount",0]; +if({side _x == west or side _x == east} count (_pos nearEntities 50) > 0) exitWith {"You cannot recruit squads with enemies nearby" call OT_fnc_notifyMinor}; + _d = []; { _name = _x select 0; @@ -45,4 +47,4 @@ _recruits = server getVariable ["squads",[]]; _recruits pushback [getplayeruid player,_cls,_group,[]]; server setVariable ["squads",_recruits,true]; -hcShowBar true; +"Squad recruited, use ctrl + space to command" call OT_fnc_notifyMinor; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 12d3049f..52ca0a29 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.4.0-DEV"; +OnLoadMission = "v0.7.4.0-13May2017"; 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 0e61bd2c..4dab7e7a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -4,7 +4,7 @@ private _abandoned = []; private _resources = 0; private _diff = server getVariable ["OT_difficulty",1]; -private _nextturn = OT_NATOwait + random OT_NATOwait; +private _nextturn = 3; private _count = 0; server setVariable ["NATOattacking","",true]; @@ -13,7 +13,10 @@ server setVariable ["NATOattackstart",0,true]; private _lastmin = date select 4; private _lastsched = -1; -//sleep 300 + random(300); +sleep 100 + (random 300); + +OT_nextNATOTurn = time+(_nextturn * 10); +publicVariable "OT_nextNATOTurn"; while {sleep 10;true} do { private _numplayers = count([] call CBA_fnc_players); @@ -67,9 +70,9 @@ while {sleep 10;true} do { _x params ["_pos","_name","_cost"]; 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 or captive _x} count (_pos nearObjects 200); - if(_nummil < 3 and _numres > 0) then { + _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",500]); + _numres = {side _x == resistance or captive _x} count (_pos nearObjects 500); + if(_nummil < _numres) then { _countered = true; server setVariable ["NATOattacking",_name,true]; server setVariable ["NATOattackstart",time,true]; @@ -96,14 +99,14 @@ while {sleep 10;true} do { }foreach(_knownTargets); if !(_added) then { - _knownTargets pushback [_ty,_pos,_pri,_obj,false]; + _knownTargets pushback [_ty,_pos,_pri,_obj,false,time]; }; }foreach(_intel); _drone setVariable ["OT_seenTargets",[]]; }; }; if(_countered) exitWith {}; - }foreach(OT_NATOobjectives); + }foreach(OT_objectiveData + OT_airportData); }; //Town QRF (over 50 pop) @@ -141,7 +144,7 @@ while {sleep 10;true} do { 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 { + if(_nummil < _numres) then { _abandoned pushback _name; server setVariable ["NATOabandoned",_abandoned,true]; _name setMarkerColor "ColorGUER"; @@ -178,14 +181,35 @@ while {sleep 10;true} do { if(_count >= _nextturn and !_countered) then { + OT_lastNATOTurn = time; + publicVariable "OT_lastNATOTurn"; _resourceGain = server getVariable ["NATOresourceGain",0]; _abandonedSomething = false; //NATO turn _nextturn = OT_NATOwait + random OT_NATOwait; + OT_nextNATOTurn = time+(_nextturn * 10); + publicVariable "OT_nextNATOTurn"; + _count = 0; + _chance = 98; + _gain = 100; + _mul = 25; + if(_diff > 1) then {_gain = 200;_mul = 50}; + if(_diff < 1) then {_gain = 50;_mul = 15}; + + //expire targets + private _expired = []; + { + if((_x select 4) or (time - (_x select 5)) > 2400) then { + _expired pushback _x; + }; + }foreach(_knownTargets); + { + _knownTargets deleteAt (_knownTargets find _x); + }foreach(_expired); //Recover resources - _resources = _resources + _resourceGain + ((count _abandoned) * 25); + _resources = _resources + _gain + _resourceGain + ((count _abandoned) * _mul); //Abandon towns (under 50 pop) and counter _lastcounter = server getVariable ["NATOlastcounter",""]; @@ -224,23 +248,20 @@ while {sleep 10;true} do { if(_abandonedSomething or _countered) exitWith {}; }foreach (OT_allTowns); + //Spawn missing drones & counter objectives { _x params ["_pos","_name","_pri"]; if((_name != _lastcounter) and (_name in _abandoned) and (_resources > _pri) and (random 100) > 98) exitWith { //Counter an objective - [_name,_resources] spawn OT_fnc_NATOCounterObjective; + [_name,_pri] spawn OT_fnc_NATOCounterObjective; server setVariable ["NATOlastcounter",_name,true]; server setVariable ["NATOattacking",_name,true]; server setVariable ["NATOattackstart",time,true]; _countered = true; - _resources = 0; + _resources = _resources - _pri; }; - }foreach (OT_allObjectiveData + OT_airportData); - //Spawn missing drones - { - _x params ["_pos","_name"]; if !(_name in _abandoned) then { _drone = spawner getVariable [format["drone%1",_name],objNull]; if((isNull _drone or !alive _drone) and _resources > 10) then { @@ -313,7 +334,7 @@ while {sleep 10;true} do { }; }; if(_resources <= 0) exitWith {_resources = 0}; - }foreach(OT_NATOobjectives + OT_NATOcomms); + }foreach(OT_objectiveData + OT_airportData); //Decide on spend _spend = 0; @@ -322,9 +343,15 @@ while {sleep 10;true} do { }; if(_resources > 1000) then { _spend = 800; + _chance = 95; }; if(_resources > 1500) then { _spend = 1200; + _chance = 90; + }; + if(_resources > 2500) then { + _spend = 1500; + _chance = 80; }; if((_spend > 500) and (count _fobs) < 3 and (random 100) > _chance) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf index 6342616e..e1fea10d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf @@ -1,2 +1,9 @@ if((vehicle _this) != _this) then {_this = vehicle _this}; -({((side _x == east) or (side _x == west)) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0 + +{ + _x = driver _x; + ((side _x == east) or (side _x == west)) and ( + (_x distance _this < 7) or + ((time - ((_x targetKnowledge _this) select 2)) < 10) + ) +}count (_this nearEntities 1200) > 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf index f98e4eba..cdb8161f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf @@ -1,2 +1,9 @@ if((vehicle _this) != _this) then {_this = vehicle _this}; -({(side _x==east) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0 + +{ + _x = driver _x; + (side _x == east) and ( + (_x distance _this < 7) or + ((time - ((_x targetKnowledge _this) select 2)) < 10) + ) +}count (_this nearEntities 1200) > 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf index 5c1053b0..9ca71259 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf @@ -1,2 +1,9 @@ if((vehicle _this) != _this) then {_this = vehicle _this}; -({(side _x ==west) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0 + +{ + _x = driver _x; + (side _x == west) and ( + (_x distance _this < 7) or + ((time - ((_x targetKnowledge _this) select 2)) < 10) + ) +}count (_this nearEntities 1200) > 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 7170ae57..6c0aa033 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -102,6 +102,41 @@ menuHandler = {}; fnc_getBuildID = compileFinal preProcessFileLineNumbers "funcs\fnc_getBuildID.sqf"; OT_fnc_getBuildID = fnc_getBuildID; +OT_fnc_createSquad = { + _units = groupselectedunits player; + if(count _units < 2) exitWith {"You must select at least 2 recruits" call OT_fnc_notifyMinor}; + _group = createGroup resistance; + _cc = player getVariable ["OT_squadcount",1]; + { + if(_x != player) then { + [_x] joinSilent _group; + }; + }foreach(_units); + _group setGroupIdGlobal [format["S-%1",_cc]]; + _cc = _cc + 1; + player hcSetGroup [_group,groupId _group,"teamgreen"]; + + player setVariable ["OT_squadcount",_cc,true]; + + _recruits = server getVariable ["squads",[]]; + _recruits pushback [getplayeruid player,"CUSTOM",_group,[]]; + server setVariable ["squads",_recruits,true]; + + _remove = []; + _recruits = server getVariable ["recruits",[]]; + { + if((_x select 2) in _units) then { + _remove pushback _x; + }; + }foreach(_recruits); + { + _recruits deleteAt (_recruits find _x); + }foreach(_remove); + server setVariable ["recruits",_recruits,true]; + + "Squad created, use ctrl + space to command" call OT_fnc_notifyMinor; +}; + OT_fnc_initDrone = { _drone = _this; @@ -232,10 +267,12 @@ OT_fnc_lockVehicle = { OT_fnc_squadAssignVehicle = { _squad = (hcselected player) select 0; _veh = cursorObject; - - if((_veh isKindOf "Air") or (_veh isKindOf "Land") or (_veh isKindOf "Ship")) then { + _leader = leader _squad; + if(_leader distance _veh > 30) exitWith {"Squad leader must be within 30m of vehicle" call OT_fnc_notifyMinor}; + if((_veh isKindOf "StaticWeapon") or (_veh isKindOf "Air") or (_veh isKindOf "Land") or (_veh isKindOf "Ship")) then { _squad setVariable ["OT_assigned",_veh,false]; _squad addVehicle _veh; + (units _squad) orderGetIn true; player hcSelectGroup [_squad,false]; format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call OT_fnc_notifyMinor; }; @@ -247,6 +284,7 @@ OT_fnc_squadGetIn = { (units _x) allowGetIn true; if !(isNull _veh) then { _x addVehicle _veh; + (units _x) orderGetIn true; }; player hcSelectGroup [_x,false]; }foreach(hcSelected player); @@ -256,6 +294,7 @@ OT_fnc_squadGetOut = { { _squad = _x; { unassignVehicle _x } forEach (units _squad); + (units _x) orderGetIn false; (units _squad) allowGetIn false; player hcSelectGroup [_squad,false]; }foreach(hcSelected player); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 70500549..3e32f8d6 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -219,7 +219,7 @@ if(isMultiplayer or _startup == "LOAD") then { }foreach(OT_Squadables); }; _group = creategroup resistance; - _group setGroupIdGlobal [format["%1-%2",_name,_cc]]; + _group setGroupIdGlobal [_name]; { _x params ["_type","_pos","_loadout"]; _civ = _group createUnit [_type,_pos,[],0,"NONE"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index ff8f0041..12097cca 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -260,6 +260,7 @@ OT_NATO_Barrier_Large = "Land_HBarrier_01_wall_6_green_F"; OT_NATO_GroundForces = ["B_T_InfSquad_Weapons","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad"]; OT_NATO_Group_Recon = (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam"); OT_NATO_Group_Engineers = (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> "B_T_Support_ENG"); +OT_NATO_Group_CTRG = (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> "B_T_Support_ENG"); OT_NATO_Unit_LevelOneLeader = "B_T_Soldier_TL_F"; OT_NATO_Units_LevelOne = ["B_T_Medic_F","B_T_Soldier_F","B_T_Soldier_LAT_F","B_T_Soldier_AAT_F","B_T_Soldier_AT_F","B_T_soldier_M_F","B_T_Soldier_GL_F","B_T_Soldier_AR_F"]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf index b90c7564..b2f35b6f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf @@ -1,10 +1,6 @@ if(typeof _this == OT_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,"",""]; - _this addAction ["Options", { - closedialog 0; - _nul = createDialog "OT_dialog_options"; - },nil,0,false,true,"",""]; _this addAction ["Reset UI", { closedialog 0; [] execVM "setupPlayer.sqf"; diff --git a/addons/overthrow_main/functions/actions/fn_buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf index dd06972a..9aa9cc64 100644 --- a/addons/overthrow_main/functions/actions/fn_buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -173,6 +173,7 @@ call { if (_cls in OT_illegalItems) exitWith { [-_price] call money; player addItem _cls; + if(player call unitSeenNATO) then { [player] remoteExec ["OT_fnc_NATOsearch",2,false]; }; diff --git a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf index f781dd30..dd8da5b5 100644 --- a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf @@ -5,6 +5,8 @@ if(_standing < 10 and count (player nearObjects [OT_refugeeCamp,20]) == 0) exitW "+10 Standing required to recruit. Try building a refugee camp at an FOB." call OT_fnc_notifyMinor }; +if({side _x == west or side _x == east} count (player nearEntities 50) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; + _price = [_town,"CIV",_standing] call OT_fnc_getPrice; _money = player getVariable ["money",0]; diff --git a/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf b/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf index 3e12beb0..2eace9aa 100644 --- a/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf +++ b/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf @@ -29,8 +29,8 @@ if !(_type in OT_spawnHouses) then { }; private _price = round(_baseprice + ((_baseprice * _stability * _population) * (1+OT_standardMarkup))); private _sell = round(_baseprice + (_baseprice * _stability * _population)); -private _lease = round((_stability * _population) * (_baseprice * _totaloccupants * 0.1)); -if !(_town in (server getvariable ["NATOabandoned",[]])) then {_lease = round(_lease * 0.6)}; +private _lease = round((_stability * _population) * ((_baseprice * 0.2) * _totaloccupants * 0.1)); +if !(_town in (server getvariable ["NATOabandoned",[]])) then {_lease = round(_lease * 0.2)}; private _diff = server getVariable ["OT_difficulty",1]; if(_diff == 0) then {_lease = round(_lease * 1.2)}; if(_diff == 2) then {_lease = round(_lease * 0.8)}; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf index 7ea5b85f..779c52cf 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf @@ -1,16 +1,14 @@ -private _posTown = _this; +private _posTarget = _this; private _close = nil; -private _dist = 8000; +private _dist = 4000; private _closest = ""; private _abandoned = server getVariable["NATOabandoned",[]]; -private _town = _posTown call OT_fnc_nearestTown; -private _region = server getVariable format["region_%1",_town]; { _pos = _x select 0; _name = _x select 1; - if(_pos inArea _region and !(_name in _abandoned)) then { - _d = (_pos distance _posTown); + if(([_pos,_posTarget] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then { + _d = (_pos distance _posTarget); if(_d < _dist) then { _dist = _d; _close = _pos; @@ -18,41 +16,46 @@ private _region = server getVariable format["region_%1",_town]; }; }; }foreach(OT_NATOobjectives); -_isHQ = false; +_isAir = false; if(isNil "_close") then { - _isHQ = true; - _close = OT_NATO_HQPos; + _isAir = true; + { + _x params ["_obpos","_name","_pri"]; + if !(_name in _abandoned) exitWith { + _close = _obpos; + }; + }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy); }; _start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; -_group = [_start, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam")] call BIS_fnc_spawnGroup; +_group = [_start, WEST, OT_NATO_Group_CTRG] call BIS_fnc_spawnGroup; _group call distributeAILoad; sleep 0.5; -_dir = [_start,_posTown] call BIS_fnc_dirTo; +_dir = [_start,_posTarget] call BIS_fnc_dirTo; -if(_isHQ) then { - _attackpos = [_posTown,[0,150]] call SHK_pos; +if(_isAir) then { + _attackpos = [_posTarget,[0,150]] call SHK_pos; //Determine direction to attack from (preferrably away from water) _attackdir = random 360; - if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then { + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { _attackdir = _attackdir + 180; if(_attackdir > 359) then {_attackdir = _attackdir - 359}; - if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then { + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { _attackdir = _attackdir + 90; if(_attackdir > 359) then {_attackdir = _attackdir - 359}; - if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then { + if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then { _attackdir = _attackdir + 180; if(_attackdir > 359) then {_attackdir = _attackdir - 359}; }; }; }; _attackdir = _attackdir - 45; - _ao = [_posTown,[350,500],_attackdir + (random 90)] call SHK_pos; + _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos; _tgroup = creategroup blufor; - _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small]; - _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos; + _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_CTRGTransport]; + _veh = OT_NATO_Vehicle_CTRGTransport createVehicle _spawnpos; _veh setDir _dir; _tgroup addVehicle _veh; @@ -72,7 +75,7 @@ if(_isHQ) then { sleep 2; - _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; + _moveto = [_close,500,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; @@ -97,7 +100,7 @@ if(_isHQ) then { _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; _wp setWaypointTimeout [15,15,15]; - _moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; + _moveto = [_close,200,_dir] call SHK_pos; _wp = _tgroup addWaypoint [_moveto,0]; _wp setWaypointType "LOITER"; @@ -113,10 +116,23 @@ if(_isHQ) then { _x addCuratorEditableObjects [units _tgroup,true]; } forEach allCurators; }else{ - _moveto = [_start,50,_dir] call SHK_pos; - _wp = _group addWaypoint [_moveto,5]; - _wp setWaypointType "MOVE"; - _wp setWaypointBehaviour "SAFE"; + _convoypos = [_close,random 360,120] call SHK_pos; + private _road = [_convoypos] call BIS_fnc_nearestRoad; + if (!isNull _road) then { + _convoypos = (getpos _road); + }; + _spawnpos = _convoypos findEmptyPosition [0,100,OT_NATO_Vehicle_Transport_Light]; + _veh = OT_NATO_Vehicle_Transport_Light createVehicle _spawnpos; + _group addVehicle _veh; + + _wp = _group addWaypoint [_posTarget,700]; + _wp setWaypointType "UNLOAD"; + _wp setWaypointBehaviour "CARELESS"; + _wp setWaypointSpeed "FULL"; + + { + _x moveInAny _veh; + }foreach(units _group); }; { _x addCuratorEditableObjects [units _group,true]; @@ -128,20 +144,6 @@ sleep 2; _x setVariable ["VCOM_NOPATHING_Unit",true,false]; }foreach(units _group); - -_wp = _group addWaypoint [_posTown,100]; -_wp setWaypointType "HOLD"; -_wp setWaypointBehaviour "STEALTH"; -_wp setWaypointTimeout [60,120,600]; - -_dest = getpos([_posTown,OT_allHouses + OT_allShops + OT_offices + OT_portBuildings] call OT_fnc_getRandomBuilding); -_wp = _group addWaypoint [_posTown,100]; -_wp setWaypointType "HOLD"; -_wp setWaypointBehaviour "STEALTH"; -_wp setWaypointTimeout [60,120,600]; - -_dest = getpos([_posTown,OT_allHouses + OT_allShops + OT_offices + OT_portBuildings] call OT_fnc_getRandomBuilding); -_wp = _group addWaypoint [_posTown,100]; -_wp setWaypointType "HOLD"; -_wp setWaypointBehaviour "STEALTH"; -_wp setWaypointTimeout [60,120,600]; +_wp = _group addWaypoint [_posTarget,0]; +_wp setWaypointType "GUARD"; +_wp setWaypointBehaviour "COMBAT"; diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp index f3286717..27770a9d 100644 --- a/addons/overthrow_main/ui/dialogs/main.hpp +++ b/addons/overthrow_main/ui/dialogs/main.hpp @@ -567,19 +567,7 @@ class OT_dialog_options w = 0.118594 * safezoneW; h = 0.077 * safezoneH; tooltip = "Will completely destroy all dead bodies, wrecks and vehicles that cannot move"; //--- ToDo: Localize; - }; - class RscButton_1606: RscOverthrowButton - { - idc = 1606; - action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and ((_x call OT_fnc_getOwner) != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""OT_fnc_notifyMinor"",0,false];"; - - text = "Clean other"; //--- ToDo: Localize; - x = 0.515469 * safezoneW + safezoneX; - y = 0.412 * safezoneH + safezoneY; - w = 0.118594 * safezoneW; - h = 0.077 * safezoneH; - tooltip = "Removes all unowned civilian vehicles and civilians"; //--- ToDo: Localize; - }; + }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// From 4f7c1eb4e78f024dd335cb15adeef20eafc936d7 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Sat, 13 May 2017 19:27:15 +1000 Subject: [PATCH 09/16] Comanches should be more common --- .../functions/factions/NATO/fn_NATOQRF.sqf | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf index aaabf1d5..1f9a86fe 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf @@ -32,6 +32,30 @@ _abandoned = server getvariable ["NATOabandoned",[]]; }; }foreach([OT_objectiveData + OT_airportData,[],{_pos distance (_x select 0)},"ASCEND"] call BIS_fnc_SortBy); diag_log format["Overthrow: NATO QRF spend is %1",_strength]; + +if(_strength > 250 and (count _air) > 0) then { + //Send CAS + _obpos = (_air select 0) select 0; + _name = (_air select 0) select 1; + [[_obpos,[0,100],random 360] call SHK_pos,_pos,10] spawn OT_fnc_NATOAirSupport; + diag_log format["Overthrow: NATO Sent CAS from %1",_name]; +}; + +//Send ground support +if(count _ground > 0) then { + _obpos = (_ground select 0) select 0; + _name = (_ground select 0) select 1; + _send = 100; + if(_strength > 500) then { + _send = 300; + }; + if(_strength > 1000) then { + _send = 500; + }; + [_obpos,_pos,_send,0] spawn OT_fnc_NATOGroundSupport; + diag_log format["Overthrow: NATO Sent ground support from %1",_name]; +}; + { _x params ["_obpos","_name","_pri"]; @@ -41,21 +65,11 @@ diag_log format["Overthrow: NATO QRF spend is %1",_strength]; diag_log format["Overthrow: NATO Sent ground forces from %1",_name]; _strength = _strength - 150; if((_obpos inArea _region) and _strength >= 150) then { + _ao = [_pos,_dir] call OT_fnc_getAO; [_obpos,_ao,_pos,false,30] spawn OT_fnc_NATOGroundForces; _strength = _strength - 150; diag_log format["Overthrow: NATO Sent extra ground forces from %1",_name]; }; - //If this is a major objective, send ground support - if(_pri > 250 and _strength >= 100) then { - _strength = _strength - 100; - _send = 100; - if(_strength >= 100 and (random 100) > 70) then { - _send = 300; - _strength = _strength - 100; - }; - [_obpos,_pos,_send,0] spawn OT_fnc_NATOGroundSupport; - diag_log format["Overthrow: NATO Sent ground support from %1",_name]; - }; if(_strength <=0) exitWith {}; }foreach(_ground); @@ -69,11 +83,11 @@ if(_strength >= 75) then { diag_log format["Overthrow: NATO Sent ground forces by air from %1",_name]; _strength = _strength - 75; - //If this is a major airfield, send CAS - if((_pri > 1000 and _strength >= 250) and (random 100) > 70) then { - _strength = _strength - 250; - [[_obpos,[0,100],random 360] call SHK_pos,_pos,10] spawn OT_fnc_NATOAirSupport; - diag_log format["Overthrow: NATO Sent CAS from %1",_name]; + if(_pri > 600 and _strength >= 75) then { + _ao = [_pos,_dir] call OT_fnc_getAO; + [_obpos,_ao,_pos,true,30] spawn OT_fnc_NATOGroundForces; + _strength = _strength - 75; + diag_log format["Overthrow: NATO Sent extra ground forces by air from %1",_name]; }; if(_strength <=0) exitWith {}; From c8681f283fde436daf5d58dc24c7cabf15091dcf Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Sun, 14 May 2017 10:59:25 +1000 Subject: [PATCH 10/16] Bugfixes --- .../Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf | 14 ++++++++++++- .../actions/fn_addGarrison.sqf | 2 +- .../actions/recruitSoldier.sqf | 2 +- .../Overthrow.Tanoa/actions/recruitSquad.sqf | 2 +- .../Overthrow.Tanoa/factions/NATO.sqf | 20 ++++++++++++++----- .../functions/actions/fn_recruitCiv.sqf | 2 +- .../overthrow_main/functions/fn_getOwner.sqf | 2 +- .../overthrow_main/functions/fn_saveGame.sqf | 6 +++--- .../overthrow_main/functions/fn_setOwner.sqf | 2 +- addons/overthrow_main/ui/dialogs/main.hpp | 14 ++++++++++++- 10 files changed, 50 insertions(+), 16 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf index ff8bff81..22c49a0a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf @@ -4,6 +4,8 @@ _group = group _leader; private _targetPos = _leader getVariable ["OT_targetPos",objNull]; private _veh = vehicle _leader; +_near = false; + { unassignVehicle _x; }foreach(units _group); @@ -13,9 +15,19 @@ sleep 10; if(({alive _x} count (units _group)) == 0) exitWith {}; if(!isNull _veh) then {deleteVehicle _veh}; -_flag = OT_flag_NATO createVehicle _targetPos; private _fobs = server getVariable ["NATOfobs",[]]; + +{ + _pb = _x select 0; + if(_pb distance _targetPos < 500) then { + _near = true; + }; +}foreach(_fobs); +if(_near) exitWith {}; + +_flag = OT_flag_NATO createVehicle _targetPos; + _fobs pushback [_targetPos,count units _group,[]]; server setVariable ["NATOfobs",_fobs,true]; _group call OT_fnc_initMilitaryPatrol; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf index ac7a835f..b4f35807 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf @@ -9,7 +9,7 @@ if(_pos distance player > 30) then { _code = _b select 1; }; -if({side _x == west or side _x == east} count (_pos nearEntities 50)) exitWith {"You cannot garrison with enemies nearby" call OT_fnc_notifyMinor}; +if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot garrison with enemies nearby" call OT_fnc_notifyMinor}; _group = spawner getVariable [format["resgarrison%1",_code],grpNull]; _doinit = false; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf index 0be7b101..e4bd5e6a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf @@ -4,7 +4,7 @@ private _cls = _this select 0; private _pos = _this select 1; private _group = _this select 2; -if({side _x == west or side _x == east} count (_pos nearEntities 50) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; +if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; _soldier = _cls call OT_fnc_getSoldier; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf index c785e77f..f1979744 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf @@ -4,7 +4,7 @@ private _cls = _this select 0; private _pos = _this select 1; private _cc = player getVariable ["OT_squadcount",0]; -if({side _x == west or side _x == east} count (_pos nearEntities 50) > 0) exitWith {"You cannot recruit squads with enemies nearby" call OT_fnc_notifyMinor}; +if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit squads with enemies nearby" call OT_fnc_notifyMinor}; _d = []; { 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 4dab7e7a..a8635c11 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -192,10 +192,10 @@ while {sleep 10;true} do { _count = 0; _chance = 98; - _gain = 100; + _gain = 25; _mul = 25; - if(_diff > 1) then {_gain = 200;_mul = 50}; - if(_diff < 1) then {_gain = 50;_mul = 15}; + if(_diff > 1) then {_gain = 75;_mul = 50}; + if(_diff < 1) then {_gain = 0;_mul = 15}; //expire targets private _expired = []; @@ -354,7 +354,7 @@ while {sleep 10;true} do { _chance = 80; }; - if((_spend > 500) and (count _fobs) < 3 and (random 100) > _chance) then { + if(!(spawner getVariable ["NATOdeploying",false]) and (_spend > 500) and (count _fobs) < 3 and (random 100) > _chance) then { //Deploy an FOB _lowest = ""; { @@ -372,13 +372,23 @@ while {sleep 10;true} do { _pos set [2,0]; _bb = _pos call OT_fnc_nearestObjective; _bpos = _bb select 0; - if((_pos distance _bpos) > 400 and (_pos distance _townPos) > 250) exitWith { + + _near = false; + { + _pb = _x select 0; + if(_pb distance _pos < 500) then { + _near = true; + }; + }foreach(_fobs); + + if(!_near and (_pos distance _bpos) > 400 and (_pos distance _townPos) > 250) exitWith { _gotpos = _pos; }; }foreach (selectBestPlaces [_pp, 1000,"(1 - forest - trees) * (1 - houses) * (1 - sea)",5,4]); if(count _gotpos > 0) then { _spend = _spend - 500; _resources = _resources - 500; + spawner setVariable ["NATOdeploying",true,false]; [_gotpos] spawn OT_fnc_NATOMissionDeployFOB; }; }; diff --git a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf index dd8da5b5..b7681a1a 100644 --- a/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf +++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf @@ -5,7 +5,7 @@ if(_standing < 10 and count (player nearObjects [OT_refugeeCamp,20]) == 0) exitW "+10 Standing required to recruit. Try building a refugee camp at an FOB." call OT_fnc_notifyMinor }; -if({side _x == west or side _x == east} count (player nearEntities 50) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; +if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor}; _price = [_town,"CIV",_standing] call OT_fnc_getPrice; _money = player getVariable ["money",0]; diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf index c24dc3f1..ec4b9f3c 100644 --- a/addons/overthrow_main/functions/fn_getOwner.sqf +++ b/addons/overthrow_main/functions/fn_getOwner.sqf @@ -1,7 +1,7 @@ if(typename _this == "SCALAR") exitWith { owners getVariable [str _this,nil]; }; -if(_this isKindOf "Building") exitWith { +if((getObjectType _obj) != 8 and (_obj isKindOf "Building")) exitWith { _id = [_this] call OT_fnc_getBuildID; owners getVariable [str _id,nil]; }; diff --git a/addons/overthrow_main/functions/fn_saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf index 70ad5111..bd9f1b56 100644 --- a/addons/overthrow_main/functions/fn_saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -2,7 +2,7 @@ if(OT_saving) exitWith {"Please wait, save still in progress" remoteExec ["hint" OT_saving = true; publicVariable "OT_saving"; -"Persistent Saving..." remoteExec ["OT_fnc_notifyLong",0,true]; +"Persistent Saving..." remoteExec ["OT_fnc_notifyMinor",0,true]; sleep 0.1; waitUntil {!isNil "OT_NATOInitDone"}; @@ -71,7 +71,7 @@ _count = 10001; _vehicles pushback _params; }; if(_count > 2000) then { - "Still persistent Saving... please wait" remoteExec ["OT_fnc_notifyLong",0,true]; + "Still persistent Saving... please wait" remoteExec ["OT_fnc_notifyMinor",0,true]; _count = 0; sleep 0.01; }; @@ -199,7 +199,7 @@ _data pushback ["timedate",date]; profileNameSpace setVariable ["Overthrow.save.001",_data]; if (isDedicated) then { - "Saving to dedicated server.. not long now" remoteExec ["OT_fnc_notifyLong",0,true]; + "Saving to dedicated server.. not long now" remoteExec ["OT_fnc_notifyMinor",0,true]; sleep 0.01; saveProfileNamespace }; diff --git a/addons/overthrow_main/functions/fn_setOwner.sqf b/addons/overthrow_main/functions/fn_setOwner.sqf index a4b15d56..5534b0d7 100644 --- a/addons/overthrow_main/functions/fn_setOwner.sqf +++ b/addons/overthrow_main/functions/fn_setOwner.sqf @@ -2,7 +2,7 @@ params ["_obj","_owner"]; if(typename _obj == "SCALAR") exitWith { owners setVariable [str _obj,_owner,true]; }; -if(_obj isKindOf "Building") exitWith { +if((getObjectType _obj) != 8 and (_obj isKindOf "Building")) exitWith { _id = [_obj] call OT_fnc_getBuildID; owners setVariable [str _id,_owner,true]; }; diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp index 27770a9d..61ed1cab 100644 --- a/addons/overthrow_main/ui/dialogs/main.hpp +++ b/addons/overthrow_main/ui/dialogs/main.hpp @@ -567,7 +567,19 @@ class OT_dialog_options w = 0.118594 * safezoneW; h = 0.077 * safezoneH; tooltip = "Will completely destroy all dead bodies, wrecks and vehicles that cannot move"; //--- ToDo: Localize; - }; + }; + class RscButton_1606: RscOverthrowButton + { + idc = 1606; + action = "[[0,0],""setFog"",TRUE,FALSE] spawn BIS_fnc_MP"; + + text = "Clean fog"; //--- ToDo: Localize; + x = 0.515469 * safezoneW + safezoneX; + y = 0.412 * safezoneH + safezoneY; + w = 0.118594 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Clears fog"; //--- ToDo: Localize; + }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// From 7c6785200059497f4f3af594307030ba8271ff67 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Sun, 14 May 2017 14:53:13 +1000 Subject: [PATCH 11/16] more bugfxies --- .../Overthrow.Tanoa/UI/fn_garrisonDialog.sqf | 54 +++++++++++++++++++ .../actions/fn_addGarrison.sqf | 4 +- .../Overthrow.Tanoa/actions/placementMode.sqf | 7 +-- .../Overthrow.Tanoa/factions/GUER.sqf | 19 ++++--- .../Overthrow.Tanoa/factions/NATO.sqf | 37 +++++++++++++ .../Overthrow.Tanoa/funcs/displayShopPic.sqf | 18 ++++++- .../missions/Overthrow.Tanoa/initFuncs.sqf | 5 +- .../Overthrow.Tanoa/initPlayerLocal.sqf | 7 +++ .../missions/Overthrow.Tanoa/initVar.sqf | 9 +--- .../spawners/insertion/reGarrisonTown.sqf | 38 +++++++++---- .../spawners/militaryGarrison.sqf | 2 +- .../functions/AI/fn_createSoldier.sqf | 1 + .../functions/actions/fn_factoryRefresh.sqf | 14 ++--- .../overthrow_main/functions/fn_getOwner.sqf | 2 +- .../overthrow_main/ui/dialogs/resistance.hpp | 4 +- 15 files changed, 174 insertions(+), 47 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf index 4bd09d56..3cfb8d07 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf @@ -1 +1,55 @@ createDialog "OT_dialog_garrison"; +disableSerialization; + +_b = player call OT_fnc_nearestRealEstate; +_name = "Base"; +if(typename _b == "ARRAY") then { + if(typeof (_b select 0) == OT_item_Flag) then { + _name = ""; + { + if((_x select 0) distance (_b select 0) < 10) exitWith {_name = _b select 1}; + }foreach(server getVariable ["bases",[]]); + }; +}else{ + _ob = (position player) call OT_fnc_nearestObjective; + _name = _ob select 1; +}; + +_textctrl = (findDisplay 9000) displayCtrl 1100; +_textctrl ctrlSetStructuredText parseText format["%1",_name]; + +_btn = (findDisplay 9000) displayCtrl 1600; +_soldier = ((OT_recruitables select 0) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1601; +_soldier = ((OT_recruitables select 1) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1602; +_soldier = ((OT_recruitables select 13) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1603; +_soldier = ((OT_recruitables select 8) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1604; +_soldier = ((OT_recruitables select 9) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1605; +_soldier = ((OT_recruitables select 10) select 0) call OT_fnc_getSoldier; +_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1606; +_cost = ["Tanoa","I_HMG_01_high_weapon_F",0] call OT_fnc_getPrice; +_cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); +_cost = _cost + 300; +_btn ctrlSetTooltip format["$%1",[_cost, 1, 0, true] call CBA_fnc_formatNumber]; + +_btn = (findDisplay 9000) displayCtrl 1607; +_cost = ["Tanoa","I_GMG_01_high_weapon_F",0] call OT_fnc_getPrice; +_cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); +_cost = _cost + 300; +_btn ctrlSetTooltip format["$%1",[_cost, 1, 0, true] call CBA_fnc_formatNumber]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf index b4f35807..a7ae4c1e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf @@ -38,7 +38,7 @@ if(typename _create == "SCALAR") then { }; }else{ if(_create == "HMG") then { - _p = _pos findEmptyPosition [0,50,"I_HMG_01_high_F"]; + _p = _pos findEmptyPosition [30,80,"I_HMG_01_high_F"]; _cost = ["Tanoa","I_HMG_01_high_weapon_F",0] call OT_fnc_getPrice; _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); @@ -55,7 +55,7 @@ if(typename _create == "SCALAR") then { }foreach(crew _gun); }; if(_create == "GMG") then { - _p = _pos findEmptyPosition [0,50,"I_GMG_01_high_F"]; + _p = _pos findEmptyPosition [10,50,"I_GMG_01_high_F"]; _cost = ["Tanoa","I_GMG_01_high_weapon_F",0] call OT_fnc_getPrice; _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice); 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 2c8e755e..b98c4872 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -155,12 +155,7 @@ if(_cost > 0) then { }else{ if ([getpos player,_typecls] call OT_fnc_canPlace) then { [-_cost] call money; - modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2]; - if !((typeof modeTarget) in OT_miscables) then { - [modeTarget,true] remoteExec ["enableSimulationGlobal",2]; - }else{ - [modeTarget,false] remoteExec ["enableSimulationGlobal",2]; - }; + modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2]; [modeTarget,getPlayerUID player] call OT_fnc_setOwner; modeTarget remoteExec["initObjectLocal",0,modeTarget]; if(_typecls == "Base" or _typecls == "Camp") then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index d0c1fd1f..9b57cc4e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -209,20 +209,20 @@ while {true} do { }; _b = _base; if(_base > 240) then { - _b = 240; + _b = 30; }; if(_base > 10000) then { - _b = 360; + _b = 60; }; if(_base > 20000) then { - _b = 480; + _b = 120; }; if(_base > 50000) then { - _b = 600; + _b = 240; }; - _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10)); - if(_timetoproduce > 2880) then {_timetoproduce = 2880}; - if(_timetoproduce < 10) then {_timetoproduce = 10}; + _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 2)) + (round (_plastic * 5)); + if(_timetoproduce > 360) then {_timetoproduce = 360}; + if(_timetoproduce < 5) then {_timetoproduce = 5}; _timespent = server getVariable ["GEURproducetime",0]; _numtoproduce = 1; @@ -331,26 +331,31 @@ while {true} do { _x set [3,"CORPORAL"]; _unit setRank "CORPORAL"; format["%1 has been promoted to Corporal",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; + _unit setSkill 0.2 + (random 0.3); }; if(_rank == "CORPORAL" and _xp > (OT_rankXP select 1)) then { _x set [3,"SERGEANT"]; _unit setRank "SERGEANT"; format["%1 has been promoted to Sergeant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; + _unit setSkill 0.3 + (random 0.3); }; if(_rank == "SERGEANT" and _xp > (OT_rankXP select 2)) then { _x set [3,"LIEUTENANT"]; _unit setRank "LIEUTENANT"; format["%1 has been promoted to Lieutenant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; + _unit setSkill 0.5 + (random 0.3); }; if(_rank == "LIEUTENANT" and _xp > (OT_rankXP select 3)) then { _x set [3,"CAPTAIN"]; _unit setRank "CAPTAIN"; format["%1 has been promoted to Captain",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; + _unit setSkill 0.6 + (random 0.3); }; if(_rank == "CAPTAIN" and _xp > (OT_rankXP select 4)) then { _x set [3,"MAJOR"]; _unit setRank "MAJOR"; format["%1 has been promoted to Major",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false]; + _unit setSkill 0.8 + (random 0.2); }; }; }foreach(server getVariable ["recruits",[]]); 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 a8635c11..b232122f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -229,6 +229,7 @@ while {sleep 10;true} do { server setVariable [format ["garrison%1",_town],0,true]; format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false]; [_town,15] call stability; + _abandonedSomething = true; }; }else{ if(_town != _lastcounter) then { @@ -244,6 +245,16 @@ while {sleep 10;true} do { }; }; }; + }else{ + if(_population < 50) then { + if(_stability == 0 and !(_town in _abandoned)) then { + //Abandon a town + _abandoned pushback _town; + server setVariable [format ["garrison%1",_town],0,true]; + format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false]; + _abandonedSomething = true; + }; + }; }; if(_abandonedSomething or _countered) exitWith {}; }foreach (OT_allTowns); @@ -394,6 +405,32 @@ while {sleep 10;true} do { }; }; + if(_spend >= 20) then { + { + _town = _x; + _townPos = server getVariable _town; + _current = server getVariable format ["garrison%1",_town];; + _stability = server getVariable format ["stability%1",_town]; + _population = server getVariable format ["population%1",_town]; + if(_stability > 10 and !(_town in _abandoned)) then { + _max = round(_population / 40); + if(_max < 4) then {_max = 4}; + _garrison = 2+round((1-(_stability / 100)) * _max); + if(_town in OT_NATO_priority) then { + _garrison = round(_garrison * 2); + }; + _need = _garrison - _current; + if(_need < 0) then {_need = 0}; + if(_need > 1 and _spend >= 20) then { + _spend = _spend - 20; + _resources = _resources - 20; + _x spawn reGarrisonTown; + }; + }; + if(_spend < 20) exitWith {}; + }foreach ([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy); + }; + //Schedule some missions if(_spend > 0) then { _targets = [_knownTargets,[],{_x select 2},"DESCEND"] call BIS_fnc_sortBy; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf index fbfca94c..6e3f2903 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf @@ -48,12 +48,26 @@ if(_price > -1) then { if(_cls isKindOf "Man") exitWith { _txt = _cls call ISSE_Cfg_Vehicle_GetName; - _price = format["%1 + gear",_price]; + _soldier = _cls call OT_fnc_getSoldier; + _price = _soldier select 0; _desc = "Will recruit this soldier into your group fully equipped using the warehouse where possible."; }; if(_cls in OT_allSquads) exitWith { + _d = []; + { + if((_x select 0) == _cls) exitWith {_d = _x}; + }foreach(OT_squadables); + + _comp = _d select 1; + _price = 0; + { + _s = OT_recruitables select _x; + + _soldier = (_s select 0) call OT_fnc_getSoldier; + _price = _price + (_soldier select 0); + }foreach(_comp); + _txt = _cls; - _price = format["%1 + gear",_price]; _desc = "Will recruit this squad into your High-Command bar, accessible with ctrl-space."; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 6c0aa033..5af21114 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -109,6 +109,7 @@ OT_fnc_createSquad = { _cc = player getVariable ["OT_squadcount",1]; { if(_x != player) then { + _x setVariable ["NOAI",false,false]; [_x] joinSilent _group; }; }foreach(_units); @@ -403,7 +404,7 @@ OT_fnc_getTaxIncome = { private _population = server getVariable format["population%1",_town]; private _stability = server getVariable format["stability%1",_town]; private _garrison = server getVariable [format['police%1',_town],0]; - private _add = round(_population * 2 * (_stability/100)); + private _add = round(_population * 4 * (_stability/100)); if(_stability > 49) then { _add = round(_add * 4); }; @@ -573,7 +574,7 @@ OT_fnc_initRecruit = { [_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ]; - _civ setSkill 1.0; + _civ setSkill 0.1 + (random 0.3); _civ setRank "PRIVATE"; _civ setVariable ["NOAI",true,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index 3e32f8d6..cadd210d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -181,6 +181,12 @@ if(isMultiplayer or _startup == "LOAD") then { _civ setVariable ["OT_xp",_xp,true]; _civ setVariable ["NOAI",true,true]; _civ setRank _rank; + if(_rank == "PRIVATE") then {_civ setSkill 0.1 + (random 0.3)}; + if(_rank == "CORPORAL") then {_civ setSkill 0.2 + (random 0.3)}; + if(_rank == "SERGEANT") then {_civ setSkill 0.3 + (random 0.3)}; + if(_rank == "LIEUTENANT") then {_civ setSkill 0.5 + (random 0.3)}; + if(_rank == "CAPTAIN") then {_civ setSkill 0.6 + (random 0.3)}; + if(_rank == "MAJOR") then {_civ setSkill 0.8 + (random 0.2)}; [_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; @@ -223,6 +229,7 @@ if(isMultiplayer or _startup == "LOAD") then { { _x params ["_type","_pos","_loadout"]; _civ = _group createUnit [_type,_pos,[],0,"NONE"]; + _civ setSkill 0.5 + (random 0.4); _civ setUnitLoadout _loadout; [_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ]; [_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 12097cca..9ed75fa7 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -83,16 +83,11 @@ OT_fuelPumps = ["Land_FuelStation_02_pump_F","Land_FuelStation_01_pump_F","Land_ OT_ferryDestinations = ["destination_1","destination_2","destination_3","destination_4","destination_5","destination_6"]; -OT_miscables = ["Land_PortableLight_single_F","Land_PortableLight_double_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F", +OT_miscables = ["ACE_Wheel","ACE_Track","Land_PortableLight_double_F","Land_PortableLight_single_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","ArrowDesk_L_F", "ArrowDesk_R_F","ArrowMarker_L_F","ArrowMarker_R_F","Pole_F","Land_RedWhitePole_F","RoadBarrier_F","RoadBarrier_small_F","RoadCone_F","RoadCone_L_F","Land_VergePost_01_F", "TapeSign_F","Land_WheelChock_01_F","Land_Sleeping_bag_F","Land_Sleeping_bag_blue_F","Land_WoodenLog_F","FlagChecked_F","FlagSmall_F","Land_LandMark_F","Land_Bollard_01_F"]; -if(OT_hasACE) then { - OT_miscables pushback "ACE_Wheel"; - OT_miscables pushback "ACE_Track"; -}; - //Items you can place OT_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],"Bags filled with lots of sand. Apparently this can stop bullets or something?"], @@ -100,7 +95,7 @@ OT_Placeables = [ ["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],"Really big sandbags, basically."], ["Map",30,[OT_item_Map],[0,2,1.2],"Use these to save your game, change options or check town info."], ["Safe",50,[OT_item_Safe],[0,2,0.5],"Store and retrieve money"], - ["Misc",30,OT_miscables,[0,3,1.2],"Various other items, including lights"] + ["Misc",30,OT_miscables,[0,3,1.2],"Various other items, including spare wheels and lights"] ]; //People you can recruit, and squads are composed of 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 32741247..d405e4fe 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 @@ -17,8 +17,8 @@ private _attacking = server getVariable["NATOattacking",""]; _pos = _x select 0; _name = _x select 1; _garrison = server getVariable[format["garrison%1",_name],0]; - if(_name != _attacking and _garrison > 3) then { - if(_pos inArea _region and !(_name in _abandoned)) then { + if(_name != _attacking) then { + if(([_pos,_townPos] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then { _d = (_pos distance _townPos); if(_d < _dist) then { _dist = _d; @@ -30,14 +30,6 @@ 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 {}; @@ -45,6 +37,17 @@ if(!isNil "_close") then { _start = [_close,0,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; _group = creategroup blufor; _groups pushback _group; + _usecar = false; + _veh = objNull; + + if(((_close distance _townPos) > 2000) and (random 100) > 50) then { + _spawnpos = _start findEmptyPosition [0,100,OT_NATO_Vehicle_Police]; + _veh = OT_NATO_Vehicle_Police createVehicle _spawnpos; + _veh setDir (random 360); + _group addVehicle _veh; + _usecar = true; + _groups pushback _veh; + }; _civ = _group createUnit [OT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"]; _police pushBack _civ; @@ -73,6 +76,21 @@ if(!isNil "_close") then { [_civ,_town] call OT_fnc_initGendarm; _civ setBehaviour "SAFE"; + if(_usecar) then { + { + _x moveInAny _veh; + }foreach(units _group); + + _drop = (([_townPos, 50, 350, 1, 0, 0, 0] call BIS_fnc_findSafePos) nearRoads 500) select 0; + + _move = _group addWaypoint [_drop,0]; + _move setWaypointType "MOVE"; + _move setWaypointBehaviour "CARELESS"; + + _move = _group addWaypoint [_drop,0]; + _move setWaypointType "UNLOAD"; + }; + sleep 1; _group call OT_fnc_initGendarmPatrol; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf index 134bec24..ecef9b6b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf @@ -202,7 +202,7 @@ _road = objNull; _civ setVariable ["garrison","HQ",false]; _civ setVariable ["hvt",true,true]; _civ setVariable ["hvt_id",_id,true]; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + _civ setVariable ["NOAI",true,true]; _civ setRank "COLONEL"; _civ setBehaviour "SAFE"; diff --git a/addons/overthrow_main/functions/AI/fn_createSoldier.sqf b/addons/overthrow_main/functions/AI/fn_createSoldier.sqf index 5171ea36..2ec6b299 100644 --- a/addons/overthrow_main/functions/AI/fn_createSoldier.sqf +++ b/addons/overthrow_main/functions/AI/fn_createSoldier.sqf @@ -25,6 +25,7 @@ private _lastname = OT_lastNames_local call BIS_fnc_selectRandom; private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname]; [_civ,_fullname] remoteExec ["setCivName",0,false]; _civ setRank "LIEUTENANT"; +_civ setSkill 0.5 + (random 0.4); [_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ]; diff --git a/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf b/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf index abaebaac..a992949f 100644 --- a/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf +++ b/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf @@ -33,20 +33,20 @@ if(_currentCls != "") then { }; _b = _base; if(_base > 240) then { - _b = 240; + _b = 30; }; if(_base > 10000) then { - _b = 360; + _b = 60; }; if(_base > 20000) then { - _b = 480; + _b = 120; }; if(_base > 50000) then { - _b = 600; + _b = 240; }; - _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10)); - if(_timetoproduce > 2880) then {_timetoproduce = 2880}; - if(_timetoproduce < 10) then {_timetoproduce = 10}; + _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 2)) + (round (_plastic * 5)); + if(_timetoproduce > 360) then {_timetoproduce = 360}; + if(_timetoproduce < 5) then {_timetoproduce = 5}; _timespent = server getVariable ["GEURproducetime",0]; diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf index ec4b9f3c..6533f4f4 100644 --- a/addons/overthrow_main/functions/fn_getOwner.sqf +++ b/addons/overthrow_main/functions/fn_getOwner.sqf @@ -1,7 +1,7 @@ if(typename _this == "SCALAR") exitWith { owners getVariable [str _this,nil]; }; -if((getObjectType _obj) != 8 and (_obj isKindOf "Building")) exitWith { +if((getObjectType _this) != 8 and (_this isKindOf "Building")) exitWith { _id = [_this] call OT_fnc_getBuildID; owners getVariable [str _id,nil]; }; diff --git a/addons/overthrow_main/ui/dialogs/resistance.hpp b/addons/overthrow_main/ui/dialogs/resistance.hpp index abafe945..b5cee0f7 100644 --- a/addons/overthrow_main/ui/dialogs/resistance.hpp +++ b/addons/overthrow_main/ui/dialogs/resistance.hpp @@ -176,9 +176,9 @@ class OT_dialog_garrison movingenable=false; class controlsBackground { - class RscStructuredText_1100: RscOverthrowStructuredText + class RscStructuredText_1199: RscOverthrowStructuredText { - idc = 1100; + idc = 1199; text = ""; //--- ToDo: Localize; x = 0.288594 * safezoneW + safezoneX; From 753fcea1dfbe27f3b71c4547f58f75a05af642d8 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 15 May 2017 18:08:04 +1000 Subject: [PATCH 12/16] bugfixes --- .../UI/fn_resistanceDialog.sqf | 14 +++- .../Overthrow.Tanoa/actions/exportAll.sqf | 4 +- .../missions/Overthrow.Tanoa/description.ext | 2 +- .../Overthrow.Tanoa/events/somethingDied.sqf | 11 ++- .../Overthrow.Tanoa/factions/GUER.sqf | 2 + .../Overthrow.Tanoa/funcs/dumpStuff.sqf | 5 +- .../Overthrow.Tanoa/funcs/unitSeenAny.sqf | 9 +++ .../missions/Overthrow.Tanoa/initFuncs.sqf | 5 +- .../Overthrow.Tanoa/initPlayerLocal.sqf | 2 +- .../missions/Overthrow.Tanoa/intelSystem.sqf | 4 +- .../missions/Overthrow.Tanoa/mission.sqm | 10 +-- .../missions/Overthrow.Tanoa/wantedSystem.sqf | 7 ++ .../functions/AI/NPC/fn_initPolice.sqf | 71 ++++++++----------- .../functions/actions/fn_sell.sqf | 14 ++-- .../functions/actions/fn_sellAll.sqf | 15 ++-- .../factions/NATO/fn_NATOAirSupport.sqf | 5 ++ .../factions/NATO/fn_NATOGroundForces.sqf | 4 ++ .../factions/NATO/fn_NATOGroundSupport.sqf | 5 ++ .../factions/NATO/fn_NATOSupportRecon.sqf | 5 ++ 19 files changed, 121 insertions(+), 73 deletions(-) create mode 100644 addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf index d0cd4d33..5d8ebbef 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf @@ -80,10 +80,16 @@ _totaxper = round(_totax / _numPlayers); private _perhr = (["Tanoa","WAGE",0] call OT_fnc_getPrice)*6; private _wages = 0; +private _income = 0; { if(_x != "Factory") then { _num = server getVariable [format["%1employ",_x],0]; _wages = _wages + (_num * _perhr); + if(_num > 20) then {_num = 20}; + _data = _x call OT_fnc_getEconomicData; + if(count _data == 2) then { + _income = _income + ((_num * 200) * 6); + }; }; }foreach(server getVariable ["GEURowned",[]]); @@ -106,14 +112,16 @@ if(isMultiplayer) then { }else{ _text = _text + format["Tax Income: $%1
",[_taxtotal, 1, 0, true] call CBA_fnc_formatNumber]; }; +_text = _text + format["Business Income: $%1 (6 hrs)
",[_income, 1, 0, true] call CBA_fnc_formatNumber]; + private _minus = ""; if(_wages > 0) then {_minus = "-"}; -_text = _text + format["Wages: $%1%2
",_minus,[_wages, 1, 0, true] call CBA_fnc_formatNumber]; +_text = _text + format["Wages: $%1%2 (6 hrs)
",_minus,[_wages, 1, 0, true] call CBA_fnc_formatNumber]; if(isMultiplayer) then { - _text = _text + format["Balance (Resistance): $%1
",[_balance, 1, 0, true] call CBA_fnc_formatNumber]; + _text = _text + format["Balance (Resistance): $%1
",[_balance+_income, 1, 0, true] call CBA_fnc_formatNumber]; _text = _text + format["Balance (You): $%1
",[_lease + (_taxper-_totaxper), 1, 0, true] call CBA_fnc_formatNumber]; }else{ - _text = _text + format["Balance: $%1
",[_lease + (_taxper-_totaxper) + _balance, 1, 0, true] call CBA_fnc_formatNumber]; + _text = _text + format["Balance: $%1
",[_lease + (_taxper-_totaxper) + _balance + _income, 1, 0, true] call CBA_fnc_formatNumber]; }; disableSerialization; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf index 51189ccc..21e9e188 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf @@ -21,7 +21,9 @@ _total = 0; _cls = _x select 0; _num = _x select 1; if(_doillegal or _cls in (OT_allItems + OT_allBackpacks + OT_Resources + OT_allClothing)) then { - _costprice = ["Tanoa",_cls,0] call OT_fnc_getSellPrice; + _baseprice = ["Tanoa",_cls,0] call OT_fnc_getSellPrice; + _costprice = round(_baseprice * 0.4); //The cost of export + _total = _total + (_costprice * _num); call { if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 52ca0a29..c1d86224 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.4.0-13May2017"; +OnLoadMission = "v0.7.4.0-15May2017"; loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg"; onLoadMissionTime = 1; allowSubordinatesTakeWeapons= 1; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf index 75a457f0..dd46bc41 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf @@ -183,7 +183,16 @@ call { }; }; }; - +if(_standingChange < 0) then { + { + if(captive _x) then {_x setCaptive false}; + if(_x isKindOf "AllVehicles") then { + { + if(captive _x) then {_x setCaptive false}; + }foreach(units _x); + }; + }foreach (_me nearObjects 15); +}; if((_killer call unitSeen) or (_standingChange < -9)) then { _killer setCaptive false; if(vehicle _killer != _killer) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index 9b57cc4e..2ab0a07c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -158,6 +158,8 @@ while {true} do { }; }; }; + }else{ + format["Resistance was unable to pay wages at %1",_x] remoteExec ["OT_fnc_notifyMinor",0,false]; }; }; }foreach(server getVariable ["GEURowned",[]]); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf index 0c7b4d12..1a6d7336 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf @@ -39,10 +39,11 @@ if(headgear _unit != "") then { if(_full and !_istruck) exitWith {false}; if(backpack _unit != "") then { - if !(_t canAdd backpack _unit) exitWith { + _cls = (backpack _unit) call BIS_fnc_basicBackpack; + if !(_t canAdd _cls) exitWith { _full = true; }; - _t addBackpackCargoGlobal [backpack _unit,1]; + _t addBackpackCargoGlobal [_cls,1]; removeBackpack _unit; }; if(_full and !_istruck) exitWith {false}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf new file mode 100644 index 00000000..8821e2c1 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf @@ -0,0 +1,9 @@ +if((vehicle _this) != _this) then {_this = vehicle _this}; + +{ + _x = driver _x; + ((side _x == east) or (side _x == west) or (side _x == civilian)) and ( + (_x distance _this < 7) or + ((time - ((_x targetKnowledge _this) select 2)) < 10) + ) +}count (_this nearEntities 1200) > 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 5af21114..1c579465 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -88,6 +88,7 @@ placementMode = compileFinal preProcessFileLineNumbers "actions\placementMode.sq unitSeen = compileFinal preProcessFileLineNumbers "funcs\unitSeen.sqf"; unitSeenCRIM = compileFinal preProcessFileLineNumbers "funcs\unitSeenCRIM.sqf"; unitSeenNATO = compileFinal preProcessFileLineNumbers "funcs\unitSeenNATO.sqf"; +unitSeenAny = compileFinal preProcessFileLineNumbers "funcs\unitSeenAny.sqf"; wantedSystem = compileFinal preProcessFileLineNumbers "wantedSystem.sqf"; //Other Systems @@ -509,10 +510,10 @@ OT_fnc_getEconomicData = { OT_fnc_getBusinessPrice = { private _data = _this call OT_fnc_getEconomicData; - private _baseprice = 300000; + private _baseprice = 100000; if(count _data == 2) then { //turns nothing into money - _baseprice = round(_baseprice * 1.8); + _baseprice = round(_baseprice * 1.5); }; if(count _data == 3) then { //turns something into money diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index cadd210d..a9ee1dce 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -384,7 +384,7 @@ player addEventHandler ["GetInMan",{ if !(_veh call OT_fnc_hasOwner) then { [_veh,getplayeruid player] call OT_fnc_setOwner; _veh setVariable ["stolen",true,true]; - if(_veh getVariable ["ambient",false]) then { + if((_veh getVariable ["ambient",false]) and (player call unitSeenAny)) then { [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing; }; }else{ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf index 19388be8..2d6afe9e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf @@ -261,10 +261,10 @@ _handler = { getdir _x ]; }; - if((_x isKindOf "StaticWeapon") and isNull attachedTo _x) then { + if((_x isKindOf "StaticWeapon") and (isNull attachedTo _x) and (alive _x)) then { if(side _x == civilian or side _x == resistance or captive _x) then { _col = [0.5,0.5,0.5,1]; - if(!isNull gunner _x) then {_col = [0,0.5,0,1]}; + if(!(isNull gunner _x) and (alive gunner _x)) then {_col = [0,0.5,0,1]}; _i = "\A3\ui_f\data\map\markers\nato\o_art.paa"; if(_x isKindOf "StaticMortar") then {_i = "\A3\ui_f\data\map\markers\nato\o_mortar.paa"}; if !(someAmmo _x) then {_col set [3,0.4]}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 69727219..54c80adf 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=294; + nextID=299; }; class Camera { pos[]={12880.063,4.9866929,4514.0859}; - dir[]={0.7855866,-0.51558232,0.34234276}; - up[]={0.47268483,0.85680676,0.20598541}; - aside[]={0.39953578,-1.2495075e-006,-0.91682374}; + dir[]={-0.39422134,-0.028979944,0.91865265}; + up[]={-0.011464994,0.99956822,0.026719522}; + aside[]={0.919052,-4.5984052e-009,0.39439592}; }; }; binarizationWanted=0; @@ -6888,7 +6888,7 @@ class Mission "STRING" }; }; - value="bigboss"; + value="zeus_guy"; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf index 15eab8cc..a8df6816 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf @@ -299,6 +299,13 @@ while {alive _unit} do { _unit setCaptive false; _unit spawn revealToNATO; }; + if (hmd _unit != "") exitWith { + if(isPlayer _unit) then { + "NATO has spotted your NV Goggles" call OT_fnc_notifyMinor; + }; + _unit setCaptive false; + _unit spawn revealToNATO; + }; _base = (getpos player) call OT_fnc_nearestObjective; if !(isNil "_base") then { _base params ["_obpos","_obname"]; diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf index 2215f05c..d96cb266 100644 --- a/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf +++ b/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf @@ -24,60 +24,53 @@ _unit addEventHandler ["HandleDamage", { _src = _this select 3; if(captive _src) then { if((vehicle _src) != _src or (_src call unitSeenNATO)) then { - _src setCaptive false; - }; - }; + _src setCaptive false; + }; + }; }]; removeAllWeapons _unit; -_numweap = (count OT_NATO_weapons_Police)-1; -_idx = _numweap - 4; - -if(_stability > 85) then { - _idx = _numweap; +private _cost = 0; +private _wpn = ["SubmachineGun"] call OT_fnc_findWeaponInWarehouse; +if(_wpn == "") then { + _possible = []; + { + _weapon = [_x] call BIS_fnc_itemType; + _weaponType = _weapon select 1; + if(_weaponType == "AssaultRifle" and (_x find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"}; + if(_weaponType == _primary) then {_possible pushback _x}; + }foreach(OT_allWeapons); + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy; + _wpn = _sorted select 0; +}else{ + _warehouseWpn = true; }; +_unit addWeapon _wpn; + +[_wpn,1] call OT_fnc_removeFromWarehouse; + _hour = date select 3; -if(_stability > 80) then { - if(_hour > 17 or _hour < 6) then { - _unit linkItem "NVGoggles_OPFOR"; - }; - _unit addGoggles "G_Bandanna_aviator"; - _unit addWeapon "Rangefinder"; - _idx = _numweap - 1; - if(OT_hasAce) then { - _unit addItemToUniform "ACE_rangeCard"; - _unit addItem "ACE_morphine"; - }; -}else{ - if(_stability > 70) then { - _idx = _numweap - 2; - }else{ - if(_stability > 60) then { - _idx = _numweap - 3; - _unit linkItem "ItemGPS"; - }; - }; -}; + +_unit addPrimaryWeaponItem "acc_flashlight"; +_unit addGoggles "G_Bandanna_aviator"; +_idx = _numweap - 1; +_unit addItem "ACE_morphine"; +_unit addItem "ACE_epinephrine"; + if(OT_hasACE) then { _unit addItem "ACE_fieldDressing"; _unit addItem "ACE_fieldDressing"; }; -_weapon = OT_NATO_weapons_Police select round(random(_idx)); -_base = [_weapon] call BIS_fnc_baseWeapon; +_base = [_wpn] call BIS_fnc_baseWeapon; _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0; _unit addMagazine _magazine; _unit addMagazine _magazine; _unit addMagazine _magazine; _unit addMagazine _magazine; _unit addMagazine _magazine; -_unit addWeapon _weapon; - -if(_hour > 17 or _hour < 6) then { - _unit addPrimaryWeaponItem "acc_flashlight"; -}; _weapon = OT_NATO_weapons_Pistols call BIS_fnc_selectRandom; _base = [_weapon] call BIS_fnc_baseWeapon; @@ -85,9 +78,3 @@ _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select _unit addMagazine _magazine; _unit addMagazine _magazine; _unit addWeapon _weapon; - -if(_stability > 80) then { - _unit addPrimaryWeaponItem "optic_Holosight_blk_F"; -}else{ - _unit addPrimaryWeaponItem "optic_Aco"; -}; diff --git a/addons/overthrow_main/functions/actions/fn_sell.sqf b/addons/overthrow_main/functions/actions/fn_sell.sqf index 5d39df26..b9246aa3 100644 --- a/addons/overthrow_main/functions/actions/fn_sell.sqf +++ b/addons/overthrow_main/functions/actions/fn_sell.sqf @@ -30,9 +30,9 @@ if(isNil "_price") exitWith {OT_selling = false}; { _c = _x select 0; - if(_c == _cls) exitWith {_mynum = _x select 1}; + if(_c == _cls) exitWith {_mynum = _x select 1}; }foreach(_s); - + if(_mynum > 50) then { _price = ceil(_price * 0.75); }; @@ -45,9 +45,9 @@ if(_mynum > 200) then { if(_price <= 0) then {_price = 1}; _stockidx = 0; -{ +{ if(((_x select 0) == _cls) && ((_x select 1) > 0)) exitWith { - _num = (_x select 1)+1; + _num = (_x select 1)+1; _x set [1,_num]; _done = true; }; @@ -61,10 +61,12 @@ if !(_done) then { [_price] call money; _b setVariable ["stock",_s,true]; +if(_price > 1000) then {[_town,1] call standing}; + if(OT_hasTFAR) then { _c = _cls splitString "_"; if((_c select 0) == "tf") then { - { + { if(_x find _cls == 0) exitWith {_cls = _x}; }foreach(items player); }; @@ -73,4 +75,4 @@ player removeItem _cls; lbClear 1500; _mystock = player call OT_fnc_unitStock; [_mystock,_town,_standing,_s] call sellDialog; -OT_selling = false; \ No newline at end of file +OT_selling = false; diff --git a/addons/overthrow_main/functions/actions/fn_sellAll.sqf b/addons/overthrow_main/functions/actions/fn_sellAll.sqf index 41f71b43..a44149df 100644 --- a/addons/overthrow_main/functions/actions/fn_sellAll.sqf +++ b/addons/overthrow_main/functions/actions/fn_sellAll.sqf @@ -31,16 +31,16 @@ if(isNil "_price") exitWith {OT_selling = false}; _qty = 0; { _c = _x select 0; - if(_c == _sellcls) exitWith {_qty = _x select 1}; + if(_c == _sellcls) exitWith {_qty = _x select 1}; }foreach(player call OT_fnc_unitStock); if(_qty == 0) exitWith {[_mystock,_town,_standing,_s] call sellDialog}; { _c = _x select 0; - if(_c == _sellcls) exitWith {_mynum = _x select 1}; + if(_c == _sellcls) exitWith {_mynum = _x select 1}; }foreach(_s); - + if(_mynum > 50) then { _price = ceil(_price * 0.75); }; @@ -54,9 +54,9 @@ if(_price <= 0) then {_price = 1}; _done = false; _stockidx = 0; -{ +{ if(((_x select 0) == _sellcls) && ((_x select 1) > 0)) exitWith { - _num = (_x select 1)+_qty; + _num = (_x select 1)+_qty; _x set [1,_num]; _done = true; }; @@ -68,17 +68,18 @@ if !(_done) then { }; [(_price*_qty)] call money; +if((_price*_qty) > 1000) then {[_town,1] call standing}; _ocls = _sellcls; _b setVariable ["stock",_s,true]; for "_i" from 0 to _qty do { if(OT_hasTFAR) then { _c = _ocls splitString "_"; if((_c select 0) == "tf") then { - { + { if(_x find _ocls == 0) exitWith {_sellcls = _x}; }foreach(items player); }; - }; + }; player removeItem _sellcls; }; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf index f396f7ad..067662d4 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf @@ -10,6 +10,11 @@ _group = creategroup blufor; _veh = createVehicle [_vehtype, _pos, [], 0,""]; _veh setVariable ["garrison","HQ",false]; +clearWeaponCargoGlobal _veh; +clearMagazineCargoGlobal _veh; +clearItemCargoGlobal _veh; +clearBackpackCargoGlobal _veh; + _veh setDir (_dir); _group addVehicle _veh; createVehicleCrew _veh; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf index d039910f..81a89dcd 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf @@ -34,6 +34,10 @@ if(_frompos distance _attackpos > 600) then { _veh = createVehicle [_vehtype, _pos, [], 0,""]; _veh setVariable ["garrison","HQ",false]; + clearWeaponCargoGlobal _veh; + clearMagazineCargoGlobal _veh; + clearItemCargoGlobal _veh; + clearBackpackCargoGlobal _veh; _veh setDir (_dir); _tgroup addVehicle _veh; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf index adf27dde..d9a01d2f 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf @@ -17,6 +17,11 @@ while {_count < _num} do { _veh = createVehicle [_vehtype, _pos, [], 0,""]; _veh setVariable ["garrison","HQ",false]; + clearWeaponCargoGlobal _veh; + clearMagazineCargoGlobal _veh; + clearItemCargoGlobal _veh; + clearBackpackCargoGlobal _veh; + _veh setDir (_dir); _group addVehicle _veh; createVehicleCrew _veh; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf index 779c52cf..9444a87c 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf @@ -56,6 +56,11 @@ if(_isAir) then { _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_CTRGTransport]; _veh = OT_NATO_Vehicle_CTRGTransport createVehicle _spawnpos; + clearWeaponCargoGlobal _veh; + clearMagazineCargoGlobal _veh; + clearItemCargoGlobal _veh; + clearBackpackCargoGlobal _veh; + _veh setDir _dir; _tgroup addVehicle _veh; From 9b52d8a9bd9ad5c96f29a28783718cb02fbab3a4 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 15 May 2017 21:09:14 +1000 Subject: [PATCH 13/16] final tweaks --- .../missions/Overthrow.Tanoa/description.ext | 2 +- .../functions/AI/orders/fn_orderLoot.sqf | 8 +------- .../functions/factions/NATO/fn_NATOQRF.sqf | 3 +++ addons/overthrow_main/functions/fn_loadGame.sqf | 12 +++++++++++- addons/overthrow_main/functions/fn_saveGame.sqf | 8 +++++++- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index c1d86224..c7600782 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.4.0-15May2017"; +OnLoadMission = "v0.7.4.0-RC1"; loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg"; onLoadMissionTime = 1; allowSubordinatesTakeWeapons= 1; diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf index 7ae1294c..c60c7047 100644 --- a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf +++ b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf @@ -74,14 +74,8 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl if((!alive _unit) or (_timeOut < time)) exitWith {}; [_deadguy,_unit] call takeStuff; - [_deadguy] spawn { - sleep 30; - _n = _this select 0; - if !(isNil "_n") then { - hideBody (_this select 0); - } - }; sleep 2; + hideBody _deadguy; if(primaryWeapon _unit == "") then { _weapon = objNull; { diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf index 1f9a86fe..0ea1f379 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf @@ -12,6 +12,9 @@ if(_diff == 2) then { _strength = round(_strength * 2); }; +if(_strength < 150) then {_strength = 150}; +if(_strength > 2500) then {_strength = 2500}; + spawner setVariable ["NATOattackforce",[],false]; //determine possible vectors and distribute strength to each private _town = _pos call OT_fnc_nearestTown; diff --git a/addons/overthrow_main/functions/fn_loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf index 7370c894..60795493 100644 --- a/addons/overthrow_main/functions/fn_loadGame.sqf +++ b/addons/overthrow_main/functions/fn_loadGame.sqf @@ -79,16 +79,26 @@ private _cc = 0; if(count _x > 7) then { (_x select 7) params ["_fuel","_dmg"]; + //Fuel in tank _veh setFuel _fuel; { - _veh setHitPointDamage [_x, (_dmg select 2) select _forEachIndex] + _veh setHitPointDamage [_x, (_dmg select 2) select _forEachIndex,false] }foreach(_dmg select 0); if(count (_x select 7) > 2) then { + //ACE refuel (fuel trucks) [_veh, (_x select 7) select 2] call ace_refuel_fnc_setFuel; }; if(count (_x select 7) > 3) then { + //Lock/unlock _veh setVariable ["OT_locked",(_x select 7) select 3,true]; }; + if(count (_x select 7) > 4) then { + //Ammo + _ammo = (_x select 7) select 4; + { + _veh setAmmo [_x select 0,_x select 1]; + }foreach((_x select 7) select 4); + }; }; _veh setPosATL _pos; diff --git a/addons/overthrow_main/functions/fn_saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf index bd9f1b56..0d0adb07 100644 --- a/addons/overthrow_main/functions/fn_saveGame.sqf +++ b/addons/overthrow_main/functions/fn_saveGame.sqf @@ -60,13 +60,19 @@ _count = 10001; if(!(_x isKindOf "Man") and (alive _x) and (_x call OT_fnc_hasOwner) and (typeof _x != OT_item_Flag)) then { _owner = _x call OT_fnc_getOwner; _s = _x call OT_fnc_unitStock; + if(typeof _x == OT_item_safe) then { _s pushback ["money",_x getVariable ["money",0]]; _s pushback ["password",_x getVariable ["password",""]]; }; _params = [typeof _x,getposatl _x,[vectorDir _x,vectorUp _x],_s,_owner,_x getVariable ["name",""],_x getVariable ["OT_init",""]]; if(_x isKindOf "AllVehicles") then { - _params pushback [fuel _x,getAllHitPointsDamage _x,_x call ace_refuel_fnc_getFuel,_x getVariable ["OT_locked",false]]; + _ammo = []; + _veh = _x; + { + _ammo pushback [_x,_veh ammo _x]; + }foreach(_x weaponsTurret [0]); + _params pushback [fuel _x,getAllHitPointsDamage _x,_x call ace_refuel_fnc_getFuel,_x getVariable ["OT_locked",false],_ammo]; }; _vehicles pushback _params; }; From 99ec089ea086a8760cfc17960e4811ea32a347f0 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 15 May 2017 22:11:10 +1000 Subject: [PATCH 14/16] more bugfixes --- .../Overthrow.Tanoa/events/somethingDied.sqf | 13 +- .../Overthrow.Tanoa/funcs/takeStuff.sqf | 2 +- .../missions/Overthrow.Tanoa/initFuncs.sqf | 2 +- .../missions/Overthrow.Tanoa/wantedSystem.sqf | 141 ++++++++++-------- .../functions/actions/fn_buy.sqf | 2 +- .../factions/NATO/fn_NATOGroundForces.sqf | 18 +++ 6 files changed, 106 insertions(+), 72 deletions(-) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf index dd46bc41..1a18b9ac 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf @@ -183,12 +183,19 @@ call { }; }; }; -if(_standingChange < 0) then { +if(_standingChange != 0) then { + { - if(captive _x) then {_x setCaptive false}; + if(captive _x) then { + _x setCaptive false; + }; + _x spawn revealToNATO; if(_x isKindOf "AllVehicles") then { { - if(captive _x) then {_x setCaptive false}; + if(captive _x) then { + _x setCaptive false; + _x spawn revealToNATO; + }; }foreach(units _x); }; }foreach (_me nearObjects 15); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf index a9e38b89..a679b6e6 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf @@ -10,7 +10,7 @@ if(headgear _unit != "") then { _t addHeadgear headgear _unit; }; if(backpack _unit != "") then { - _t addBackpack backpack _unit; + _t addBackpack (backpack _unit) call BIS_fnc_basicBackpack; }; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 1c579465..7c20e444 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -705,7 +705,7 @@ setupKeyHandler = { }; assignedKey = { - (cba_keybinding_dikDecToStringTable select ((actionKeys _this) select 0)+1) select 1 + (cba_keybinding_keynames) getVariable [str ((actionKeys _this) select 0),""]; }; standing = { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf index a8df6816..166c7b48 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf @@ -49,80 +49,89 @@ _unit addEventHandler ["Fired", { }; }]; -private _delay = 3; -while {alive _unit} do { - sleep 3; - //check wanted status - if(isplayer _unit and !(_unit getVariable["OT_healed",false])) then { - if(_unit getVariable ["ACE_isUnconscious", false]) then { - //Look for a medic - private _medic = objNull; - private _havepi = false; - if((items player) find "ACE_epinephrine" > -1) then {_havepi = true}; - { - if(_havepi or ((side _x == resistance or (_x call OT_fnc_hasOwner)) and !(isPlayer _x))) then { - if(_havepi or ((items _x) find "ACE_epinephrine" > -1)) then { - _medic = _x; - }; - }; - if(!isNull _medic) exitWith{}; - }foreach(player nearentities["CAManBase",50]); - if(!isNull _medic) then { - _medic globalchat "On my way to help you"; - [_medic,_unit] call OT_fnc_orderRevivePlayer; - }else{ - if(isMultiplayer) then { - _numplayers = count([] call CBA_fnc_players); - if(_numplayers > 1) then { - format["%1 is unconscious",name player] remoteExec ["systemChat",0,false]; - _unit setVariable ["OT_healed",true,true]; - }else{ - "You are unconscious, there is no one nearby with Epinephrine to revive you" call OT_fnc_notifyMinor; - sleep 5; - _unit setDamage 1; //rip - } - }else{ - player allowdamage false; - titleText ["You are unconscious, there is no one nearby with Epinephrine to revive you. Respawning...", "BLACK FADED", 2]; +if(isPlayer _unit) then { + [] spawn { + private _unit = player; + while {sleep 0.1;alive _unit} do { + if!(_unit getVariable["OT_healed",false]) then { + if(_unit getVariable ["ACE_isUnconscious", false]) then { + //Look for a medic + private _medic = objNull; + private _havepi = false; + if((items player) find "ACE_epinephrine" > -1) then {_havepi = true}; { - if((_x select [0,4]) == "ace_") then { - player setVariable [_x,nil]; + if(_havepi or ((side _x == resistance or (_x call OT_fnc_hasOwner)) and !(isPlayer _x))) then { + if(_havepi or ((items _x) find "ACE_epinephrine" > -1)) then { + _medic = _x; + }; }; - }foreach(allvariables player); - player setdamage 0; - player setCaptive true; - sleep 5; - player setpos (player getVariable "home"); - removeAllWeapons player; - removeAllItems player; - removeAllAssignedItems player; - removeBackpack player; - removeVest player; - removeGoggles player; - removeHeadgear player; + if(!isNull _medic) exitWith{}; + }foreach(player nearentities["CAManBase",50]); + if(!isNull _medic) then { + _medic globalchat "On my way to help you"; + [_medic,_unit] call OT_fnc_orderRevivePlayer; + }else{ + if(isMultiplayer) then { + _numplayers = count([] call CBA_fnc_players); + if(_numplayers > 1) then { + format["%1 is unconscious",name player] remoteExec ["systemChat",0,false]; + _unit setVariable ["OT_healed",true,true]; + }else{ + "You are unconscious, there is no one nearby with Epinephrine to revive you" call OT_fnc_notifyMinor; + sleep 5; + _unit setDamage 1; //rip + } + }else{ + player allowdamage false; + titleText ["You are unconscious, there is no one nearby with Epinephrine to revive you. Respawning...", "BLACK FADED", 2]; + { + if((_x select [0,4]) == "ace_") then { + player setVariable [_x,nil]; + }; + }foreach(allvariables player); + player setdamage 0; + player setCaptive true; + sleep 5; + player setpos (player getVariable "home"); + removeAllWeapons player; + removeAllItems player; + removeAllAssignedItems player; + removeBackpack player; + removeVest player; + removeGoggles player; + removeHeadgear player; - { - if((_x select [0,4]) == "ace_") then { - player setVariable [_x,nil]; - }; - }foreach(allvariables player); - player setDamage 0; + { + if((_x select [0,4]) == "ace_") then { + player setVariable [_x,nil]; + }; + }foreach(allvariables player); + player setDamage 0; - -1 call influence; - sleep 2; - player setDamage 0; - player linkItem "ItemMap"; - player switchMove ""; - titleText ["", "BLACK IN", 5]; - sleep 10; - player allowdamage true; + -1 call influence; + sleep 2; + player setDamage 0; + player linkItem "ItemMap"; + player switchMove ""; + titleText ["", "BLACK IN", 5]; + sleep 10; + player allowdamage true; + }; + } + }else{ + _unit setVariable ["OT_healed",false,true]; }; - } - }else{ - _unit setVariable ["OT_healed",false,true]; + }; }; }; +}; + +private _delay = 3; + +while {alive _unit} do { + sleep 3; + //check wanted status if !(captive _unit) then { //CURRENTLY WANTED diff --git a/addons/overthrow_main/functions/actions/fn_buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf index 9aa9cc64..d0732ede 100644 --- a/addons/overthrow_main/functions/actions/fn_buy.sqf +++ b/addons/overthrow_main/functions/actions/fn_buy.sqf @@ -9,7 +9,7 @@ _price = lbValue [1500,_idx]; if(_price == -1) exitWith {}; private _chems = server getVariable ["reschems",0]; -private _cost = cost getVariable _cls; +private _cost = cost getVariable [_cls,[0,0,0,0]]; if(_cls in OT_allExplosives and _chems < (_cost select 3)) exitWith {format["You need %1 chemicals",_cost select 3] call OT_fnc_notifyMinor}; _money = player getVariable "money"; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf index 81a89dcd..c9f63c36 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf @@ -156,6 +156,24 @@ _wp setWaypointBehaviour "COMBAT"; _group1 call distributeAILoad; if(typename _tgroup == "GROUP") then { _tgroup call distributeAILoad; + [_veh,_tgroup] spawn { + params ["_veh","_tgroup"]; + private _done = false; + while{sleep 10;!_done} do { + if(isNil "_veh") exitWith {}; + if(isNil "_tgroup") exitWith {}; + if((damage _veh) > 0 and ((getpos _veh) select 2) < 2) then { + while {(count (waypoints _tgroup)) > 0} do { + deleteWaypoint ((waypoints _tgroup) select 0); + }; + commandStop (driver _veh); + { + commandGetOut _x; + }foreach(units _veh); + _done = true; + }; + }; + }; }; if !(_byair) then { From 406d9b87124d261ea7ded6c90b6b4d95286d2af4 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 15 May 2017 23:04:37 +1000 Subject: [PATCH 15/16] very final tweaks --- .../Overthrow.Tanoa/factions/NATO.sqf | 25 +++++++++--------- .../Overthrow.Tanoa/initPlayerLocal.sqf | 4 +-- .../functions/actions/fn_transferFrom.sqf | 2 +- .../factions/NATO/fn_NATOGroundForces.sqf | 26 ++++++++++++++----- .../overthrow_main/functions/fn_cleanup.sqf | 2 +- 5 files changed, 35 insertions(+), 24 deletions(-) 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 b232122f..8e1815dc 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -118,17 +118,16 @@ while {sleep 10;true} do { _stability = server getVariable format ["stability%1",_town]; _population = server getVariable format ["population%1",_town]; if(_pos call OT_fnc_inSpawnDistance) then { - if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) then { - _numres = {side _x == resistance or captive _x} count (_pos nearObjects 1000); - if(_numres > 0) then { - server setVariable [format ["garrison%1",_town],0,true]; - diag_log format["Overthrow: NATO responding to %1",_town]; - [_town,_population] spawn OT_fnc_NATOResponseTown; - server setVariable ["NATOattacking",_town,true]; - server setVariable ["NATOattackstart",time,true]; - _countered = true; - _resources = _resources - _population; - }; + if(_population > 50 and _stability < 10 and !(_town in _abandoned)) then { + server setVariable [format ["garrison%1",_town],0,true]; + diag_log format["Overthrow: NATO responding to %1",_town]; + _strength = _population; + if(_population > _resources) then {_strength = _resources}; + [_town,_strength] spawn OT_fnc_NATOResponseTown; + server setVariable ["NATOattacking",_town,true]; + server setVariable ["NATOattackstart",time,true]; + _countered = true; + _resources = _resources - _strength; }; }; if(_countered) exitWith {}; @@ -233,7 +232,7 @@ while {sleep 10;true} do { }; }else{ if(_town != _lastcounter) then { - if((_town in _abandoned) and (_resources > _population) and (random 100) > 98) then { + if((_town in _abandoned) and (_resources > _population) and (random 100) > 99) then { //Counter a town [_town,_population] spawn OT_fnc_NATOCounterTown; server setVariable ["NATOlastcounter",_town,true]; @@ -262,7 +261,7 @@ while {sleep 10;true} do { //Spawn missing drones & counter objectives { _x params ["_pos","_name","_pri"]; - if((_name != _lastcounter) and (_name in _abandoned) and (_resources > _pri) and (random 100) > 98) exitWith { + if((_name != _lastcounter) and (_name in _abandoned) and (_resources > _pri) and (random 100) > 99) exitWith { //Counter an objective [_name,_pri] spawn OT_fnc_NATOCounterObjective; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index a9ee1dce..3e77e376 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -404,7 +404,7 @@ player addEventHandler ["GetInMan",{ _veh setVariable ["vehgarrison",nil,true]; { _x setCaptive false; - }foreach(units _veh); + }foreach(crew _veh); _veh spawn revealToNATO; }; _g = _v getVariable ["airgarrison",false]; @@ -415,7 +415,7 @@ player addEventHandler ["GetInMan",{ _veh setVariable ["airgarrison",nil,true]; { _x setCaptive false; - }foreach(units _veh); + }foreach(crew _veh); _veh spawn revealToNATO; }; }]; diff --git a/addons/overthrow_main/functions/actions/fn_transferFrom.sqf b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf index 49fbf81b..e70cd452 100644 --- a/addons/overthrow_main/functions/actions/fn_transferFrom.sqf +++ b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf @@ -17,7 +17,7 @@ if(_veh call unitSeen) then { if(typename (_target getVariable ["stockof",""]) == "SCALAR") then { { _x setCaptive false; - }foreach(units _veh); + }foreach(crew _veh); _veh spawn revealToNATO; hint "You were caught stealing!"; }; diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf index c9f63c36..5d436b8f 100644 --- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf +++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf @@ -136,6 +136,7 @@ if(_byair and (typename _tgroup == "GROUP")) then { _wp = _tgroup addWaypoint [_frompos,0]; _wp setWaypointType "SCRIPTED"; + _wp setWaypointCompletionRadius 25; _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"]; { @@ -144,7 +145,7 @@ if(_byair and (typename _tgroup == "GROUP")) then { }; }; sleep 10; -_wp = _group1 addWaypoint [_attackpos,20]; +_wp = _group1 addWaypoint [_attackpos,100]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointSpeed "FULL"; @@ -156,28 +157,39 @@ _wp setWaypointBehaviour "COMBAT"; _group1 call distributeAILoad; if(typename _tgroup == "GROUP") then { _tgroup call distributeAILoad; - [_veh,_tgroup] spawn { - params ["_veh","_tgroup"]; + [_veh,_tgroup,_frompos] spawn { + params ["_veh","_tgroup","_frompos"]; private _done = false; while{sleep 10;!_done} do { - if(isNil "_veh") exitWith {}; - if(isNil "_tgroup") exitWith {}; + if(isNull _veh) exitWith {}; + if(isNull _tgroup) exitWith {}; if((damage _veh) > 0 and ((getpos _veh) select 2) < 2) then { while {(count (waypoints _tgroup)) > 0} do { deleteWaypoint ((waypoints _tgroup) select 0); }; commandStop (driver _veh); { + unassignVehicle _x; commandGetOut _x; - }foreach(units _veh); + }foreach((crew _veh) - (units _tgroup)); _done = true; + + _wp = _tgroup addWaypoint [_frompos,0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "CARELESS"; + _wp setWaypointCompletionRadius 50; + + _wp = _tgroup addWaypoint [_frompos,0]; + _wp setWaypointType "SCRIPTED"; + _wp setWaypointCompletionRadius 50; + _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"]; }; }; }; }; if !(_byair) then { - _wp = _group2 addWaypoint [_attackpos,20]; + _wp = _group2 addWaypoint [_attackpos,100]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointSpeed "FULL"; diff --git a/addons/overthrow_main/functions/fn_cleanup.sqf b/addons/overthrow_main/functions/fn_cleanup.sqf index 37ae6b9f..805b9804 100644 --- a/addons/overthrow_main/functions/fn_cleanup.sqf +++ b/addons/overthrow_main/functions/fn_cleanup.sqf @@ -29,7 +29,7 @@ if(_vehicle isKindOf "CAManBase") then { if !(_x call OT_fnc_hasOwner) then { deleteVehicle _x; }; - }foreach(units _vehicle); + }foreach(crew _vehicle); }; if !(_vehicle call OT_fnc_hasOwner) then { deleteVehicle _vehicle; From 1bbf3081dc3beca539d124be90b4f59ae4ddcf31 Mon Sep 17 00:00:00 2001 From: ARMAzac Date: Mon, 15 May 2017 23:11:06 +1000 Subject: [PATCH 16/16] Readme update --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 70038e19..c24eb033 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,13 @@ A dynamic and persistent revolution campaign mod for ARMA 3 Apex * Buy and sell just about in any-game item/vehicle/weapon for currency at local shops and gun dealers * Capture towns and military objectives one by one * Dynamic economy/Regional pricing/Trade -* Buy, sell and lease real estate with prices affected by regional politics +* 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 * Recruit civilians simply just to loot for you * Designed to work in both single player and multiplayer -# Coming Features -* Recruit and command entire squads -* Player-based economy/production -* Mid and end-game mechanics - # Required DLC * APEX @@ -28,9 +23,9 @@ A dynamic and persistent revolution campaign mod for ARMA 3 Apex * VCOM AI by genesis92x https://forums.bistudio.com/topic/166374-vcom-ai-v20-ai-overhaul/ * Advanced Towing by Duda http://www.armaholic.com/page.php?id=30575 -# Recommended Addons +# Required Addons * ACE3 (Fully integrated) [(Steam Workshop)](https://steamcommunity.com/sharedfiles/filedetails/?id=463939057) # To install -Overthrow is available on the [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=774201744) - +* Overthrow is available on the [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=774201744) +* or from [Github](https://github.com/ArmaOverthrow/Overthrow.Tanoa/releases/latest)