Skip to content

Commit

Permalink
Add fortifications config (fix #90)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Kingsley committed May 11, 2017
1 parent a93b2b7 commit 2fcd38a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ARCMF.VR/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,38 @@ class CfgARCMF {
};
};
};
/*
-----------------------------------------------------------------------------------------------------------------
FORTIFY CONFIGURATION
Description: This is the section where you define fortification settings.
Notes:
1. Make sure to give units the fortify tool in their loadouts ("ACE_Fortify")
2. For no budget at all, use -1
3. Objects can only be placed while in briefing stage
Example:
budget = 5000;
objects[] = {
{"Land_BagFence_01_long_green_F", 50},
{"Land_HBarrier_01_tower_green_F", 500}
};
-----------------------------------------------------------------------------------------------------------------
*/
class Fortify {
class BLUFOR {
budget = -1;
objects[] = {};
};
class OPFOR {
budget = -1;
objects[] = {};
};
class INDFOR {
budget = -1;
objects[] = {};
};
class CIVILIAN {
budget = -1;
objects[] = {};
};
};
};
17 changes: 17 additions & 0 deletions ARCMF.VR/f/fortify/register.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if (!isServer) exitWith {};

private _config = (missionConfigFile >> "CfgARCMF" >> "Fortify");

{
_x params ["_faction", "_side"];

private _budget = getNumber (_config >> _faction >> "budget");
private _objects = getArray (_config >> _faction >> "objects");

[_side, _budget, _objects] call acex_fortify_fnc_registerObjects;
} forEach [
["BLUFOR", west],
["OPFOR", east],
["INDFOR", resistance],
["CIVILIAN", civilian]
];
5 changes: 5 additions & 0 deletions ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if (f_var_mission_timer > 0) then {
ARC_briefingTimeEnd = false;
publicVariable "ARC_briefingTimeEnd";

acex_fortify_mode = true;
publicVariable "acex_fortify_mode";

[{
ARC_briefingTimeMinutes = 0;
ARC_briefingInterval = 0;
Expand All @@ -43,6 +46,8 @@ publicVariable "ARC_briefingTimeEnd";
["Weapons are live!", 5] remoteExecCall ["ARC_fnc_hint", 0];
[false] remoteExec ["f_fnc_safety", (playableUnits + switchableUnits)];
[_handlerID] call CBA_fnc_removePerFrameHandler;
acex_fortify_mode = false;
publicVariable "acex_fortify_mode";
};

format [
Expand Down
3 changes: 3 additions & 0 deletions ARCMF.VR/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ call compile preprocessFileLineNumbers "f\briefing\f_orbatNotes.sqf";
// Mission Timer/Safe Start
call compile preprocessFileLineNumbers "f\safeStart\f_safeStart.sqf";

// Fortifications
call compile preprocessFileLineNumbers "f\fortify\register.sqf";

// Adversarial Mode
if (isNil "ARC_adversarialMode") then {
ARC_adversarialMode = false;
Expand Down

0 comments on commit 2fcd38a

Please sign in to comment.