From 64e749b21e6b81165ed6e52d21341258c9e161c0 Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Mon, 19 Dec 2016 23:56:12 -0500 Subject: [PATCH] New Settings and Bug Fixes Added configuration settings so that you can disable the time acceleration module, map addons, and static loot crate spawner. Fixed a big in the time acceleration module. --- .../Compiles/TimeAccel/GMS_fnc_Time.sqf | 39 ++++++++++--------- .../Configs/blck_configs_epoch.sqf | 16 ++++++++ .../Configs/blck_configs_exile.sqf | 17 ++++++++ 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/@epochhive/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf b/@epochhive/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf index 745d740..b1923cc 100644 --- a/@epochhive/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf +++ b/@epochhive/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf @@ -4,24 +4,27 @@ // Creds to AWOL, A3W, LouD and Creampie for insights. if (!isServer) exitWith {}; -private["_startTime"]; -_startTime = diag_tickTime; -_world = toLower format ["%1", worldName]; -private["_nightAccel","_dayAccel","_duskAccel"]; -switch (_world) do { - case "altis":{_nightAccel = 3;_dayAccel=0.5; _duskAccel = 3;}; - case "napf":{_nightAccel = 12; _dayAccel = 2;_duskAccel = 6;}; - case "namalsk":{_nightAccel = 12; _dayAccel = 2;_duskAccel = 6;}; - case "tanoa":{_nightAccel = 12; _dayAccel = 3.2;_duskAccel = 6;}; -}; -switch (sunOrMoon) do { - // Nighttime - case {sunOrMoon < 0.1}: {setTimeMultiplier _nightAccel; diag_log format["time accel updated to %1; sunOrMoon = %2; time of day = %3",_nightAccel,sunOrMoon,dayTime];}; - // Daylight - case {sunOrMoon > 0.5}: {setTimeMultiplier _dayAccel;diag_log format["time accel updated to %1; sunOrMoon = %2; time of day = %3",_dayAccel,sunOrMoon,dayTime];}; - // Dusk - default {setTimeMultiplier _duskAccel;diag_log format["time accel updated to %1; sunOrMoon = %2; time of day = %3",_duskAccel,sunOrMoon,dayTime];}; - }; +/* + blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. + blck_timeAccelerationDay = 1; // Daytime time accelearation + blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation + blck_timeAccelerationNight = 6; // Nighttim time acceleration +*/ +private ["_arr","_sunrise","_sunset","_time"]; +_arr = date call BIS_fnc_sunriseSunsetTime; +_sunrise = _arr select 0; +_sunset = _arr select 1; +_time = dayTime; +diag_log format["_fnc_Time:: -- > _sunrise = %1 | _sunset = %2 | _time = %3",_sunrise,_sunset,_time]; + +// Night +if (_time > (_sunset + 0.5) || _time < (_sunrise - 0.5)) exitWith {setTimeMultiplier blck_timeAccelerationNight; diag_log format["NIGHT TIMGE ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];}; + +// Day +if (_time > (_sunrise + 0.5) && _time < (_sunset - 0.5)) exitWith {setTimeMultiplier blck_timeAccelerationDay; diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];}; + +// default +setTimeMultiplier blck_timeAccelerationDusk; diag_log format["DUSK ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime]; diff --git a/@epochhive/addons/custom_server/Configs/blck_configs_epoch.sqf b/@epochhive/addons/custom_server/Configs/blck_configs_epoch.sqf index 6d2bae0..8d7ac6e 100644 --- a/@epochhive/addons/custom_server/Configs/blck_configs_epoch.sqf +++ b/@epochhive/addons/custom_server/Configs/blck_configs_epoch.sqf @@ -7,6 +7,22 @@ Last modified 8/1/15 if (blck_debugON) then {diag_log "[blckeagls] Loading blck_configs_epoch.sqf";}; + /* + Configuration for Addons that support the overall Mission system. + These are a module to spawn map addons generated with the Eden Editor + And a moduel to spawn static loot crates at specific location + A time acceleration module. + */ + + blck_spawnMapAddons = false; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf + blck_spawnStaticLootCrates = false; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent). + + // Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf + blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. + blck_timeAccelerationDay = 1; // Daytime time accelearation + blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation + blck_timeAccelerationNight = 6; // Nighttim time acceleration + //blck_configsLoaded = false; /************************************************************** diff --git a/@epochhive/addons/custom_server/Configs/blck_configs_exile.sqf b/@epochhive/addons/custom_server/Configs/blck_configs_exile.sqf index 3c31789..8c6c0be 100644 --- a/@epochhive/addons/custom_server/Configs/blck_configs_exile.sqf +++ b/@epochhive/addons/custom_server/Configs/blck_configs_exile.sqf @@ -6,6 +6,23 @@ Last modified 8/1/15 */ blck_configsLoaded = false; + + /* + Configuration for Addons that support the overall Mission system. + These are a module to spawn map addons generated with the Eden Editor + And a moduel to spawn static loot crates at specific location + A time acceleration module. + */ + + blck_spawnMapAddons = false; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf + blck_spawnStaticLootCrates = false; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent). + + // Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf + blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. + blck_timeAccelerationDay = 1; // Daytime time accelearation + blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation + blck_timeAccelerationNight = 6; // Nighttim time acceleration + /************************************************************** BLACKLIST LOCATIONS