Skip to content

Commit

Permalink
Add general settings for mission
Browse files Browse the repository at this point in the history
  • Loading branch information
James Kingsley committed Jun 4, 2017
1 parent e18f71e commit 88d1810
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
12 changes: 12 additions & 0 deletions ARCMF.VR/config.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
class CfgARCMF {
/*
-----------------------------------------------------------------------------------------------------------------
GENERAL CONFIGURATION
Description: This is the section where you can define general settings for the mission.
-----------------------------------------------------------------------------------------------------------------
*/
class General {
// 0: Time is not frozen
// 1: Time is frozen indefinitely
// 2: Time is frozen only during briefing stage
freezeTime = 0;
};
/*
-----------------------------------------------------------------------------------------------------------------
BRIEFING CONFIGURATION
Description: This is the section where you define the text content for the briefing on each team.
Expand Down
22 changes: 13 additions & 9 deletions ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,44 +28,48 @@ publicVariable "acex_fortify_mode";

ARC_briefingIntervalPFH = [{
params ["_args","_handlerID"];

if (f_var_mission_timer > 0 && {ARC_briefingTimeMinutes >= f_var_mission_timer}) then {
ARC_briefingTimeEnd = true;
publicVariable "ARC_briefingTimeEnd";
};

if (ARC_briefingTimeEnd) exitWith {
[_handlerID] call CBA_fnc_removePerFrameHandler;

ARC_briefingEndInterval = 5;

ARC_briefingEndIntervalPFH = [{
params ["_args","_handlerID"];

if (ARC_briefingEndInterval <= 0) exitWith {
["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";

if (getNumber (missionConfigFile >> "CfgARCMF" >> "General" >> "freezeTime") == 2) then {
setTimeMultiplier 1;
};
};

format [
"Weapons are live in %1 second%2",
ARC_briefingEndInterval,
["s",""] select (ARC_briefingEndInterval == 1)
] remoteExecCall ["hintSilent", 0];

ARC_briefingEndInterval = ARC_briefingEndInterval - 1;
}, 1, []] call CBA_fnc_addPerFrameHandler;
};

if (ARC_briefingInterval == 60) exitWith {
ARC_briefingTimeMinutes = ARC_briefingTimeMinutes + 1;
[0, ARC_briefingTimeMinutes] call ARC_fnc_displayBriefingTime;
ARC_briefingInterval = 0;
};

ARC_briefingInterval = ARC_briefingInterval + 1;
}, 1, []] call CBA_fnc_addPerFrameHandler;
}, [], 5] call CBA_fnc_waitAndExecute;
6 changes: 6 additions & 0 deletions ARCMF.VR/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ if (isServer) then {
// Chat Commands
[] call ARC_fnc_registerCommands;

if (isServer) then {
if (getNumber (missionConfigFile >> "CfgARCMF" >> "General" >> "freezeTime") in [1,2]) then {
setTimeMultiplier 0.1;
};
};

// You are free to add/edit/delete anything below this line.
3 changes: 1 addition & 2 deletions ARCMF.VR/onPlayerKilled.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Executed when player is killed in singleplayer or in multiplayer mission.
// [<oldUnit>, <killer>, <respawn>, <respawnDelay>]
#include "f\common\f_saveLoadouts.sqf"

// You are free to add/edit/delete anything below this line.
// You are free to add/edit/delete anything below this line.
3 changes: 1 addition & 2 deletions ARCMF.VR/onPlayerRespawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
// [<newUnit>, <oldUnit>, <respawn>, <respawnDelay>]
#include "f\common\f_loadLoadouts.sqf"
if (ARC_adversarialMode) then {[(_this select 0), (_this select 1), (_this select 2), (_this select 3), true] call f_fnc_CamInit};

// You are free to add/edit/delete anything below this line.
// You are free to add/edit/delete anything below this line.

0 comments on commit 88d1810

Please sign in to comment.