From 88d1810fafda3bb580ab8d5d55025902df1aec7c Mon Sep 17 00:00:00 2001 From: James Kingsley Date: Sun, 4 Jun 2017 17:35:53 +0100 Subject: [PATCH] Add general settings for mission --- ARCMF.VR/config.hpp | 12 ++++++++++++ ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf | 22 +++++++++++++--------- ARCMF.VR/init.sqf | 6 ++++++ ARCMF.VR/onPlayerKilled.sqf | 3 +-- ARCMF.VR/onPlayerRespawn.sqf | 3 +-- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/ARCMF.VR/config.hpp b/ARCMF.VR/config.hpp index 02fb4db..81d92b9 100644 --- a/ARCMF.VR/config.hpp +++ b/ARCMF.VR/config.hpp @@ -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. diff --git a/ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf b/ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf index cf89908..c836e7d 100644 --- a/ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf +++ b/ARCMF.VR/f/safeStart/fn_safeStartLoop.sqf @@ -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; diff --git a/ARCMF.VR/init.sqf b/ARCMF.VR/init.sqf index 2722de0..e9eb00f 100644 --- a/ARCMF.VR/init.sqf +++ b/ARCMF.VR/init.sqf @@ -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. diff --git a/ARCMF.VR/onPlayerKilled.sqf b/ARCMF.VR/onPlayerKilled.sqf index 366f3e3..573d43c 100644 --- a/ARCMF.VR/onPlayerKilled.sqf +++ b/ARCMF.VR/onPlayerKilled.sqf @@ -1,5 +1,4 @@ // Executed when player is killed in singleplayer or in multiplayer mission. // [, , , ] #include "f\common\f_saveLoadouts.sqf" - -// You are free to add/edit/delete anything below this line. \ No newline at end of file +// You are free to add/edit/delete anything below this line. diff --git a/ARCMF.VR/onPlayerRespawn.sqf b/ARCMF.VR/onPlayerRespawn.sqf index daadd72..fb8ac7b 100644 --- a/ARCMF.VR/onPlayerRespawn.sqf +++ b/ARCMF.VR/onPlayerRespawn.sqf @@ -2,5 +2,4 @@ // [, , , ] #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. \ No newline at end of file +// You are free to add/edit/delete anything below this line.