Schalldampfer Posted July 4, 2017 Report Share Posted July 4, 2017 Now I think I made it work... I hope this script can be the time control script for 1.0.6.1. Installation: 1. in dayz_server\init\server_functions.sqf, add at the bottom: Spoiler //time ctrl [] spawn { private ["_dayTime","_speed","_interval"]; _interval = 10; waitUntil {(!isNil "sm_done")}; waitUntil {sm_done}; while {true} do { _dayTime = dayTime; //========================TIME FUNCTION============================ _speed = 4.000; if (_dayTime >= 8 && _dayTime <= 16) then {_speed = 4.000;}; if (_dayTime > 4 && _dayTime < 8) then {_speed = 6.666;}; if (_dayTime > 16 && _dayTime < 20) then {_speed = 6.666;}; if (_dayTime <= 4 || _dayTime >= 20) then {_speed = 10.000;}; //================================================================= skipTime (_interval*(_speed - 1.0)/3600); dayzSetDate = date; publicVariable "dayzSetDate"; sleep _interval; }; }; This will accelerate the time "_speed" times every "_interval" seconds.In this sample, x4.000 for daytime and x6.666 for dawn and dusk, and x10.000 for night. skipTime will accelerate the time for the server, and dayzSetDate will synchronize the time between the server and clients. 2. in dayz_server\system\scheduler\sched_init.sqf, delete or comment out: Spoiler [ 900, 0, sched_sync ], This will disable default time synchronization. Now sched_init.sqf will be: Spoiler _base="z\addons\dayz_server\system\scheduler\"; call compile preprocessFileLineNumbers (_base+"sched_corpses.sqf"); call compile preprocessFileLineNumbers (_base+"sched_lootpiles.sqf"); call compile preprocessFileLineNumbers (_base+"sched_sync.sqf"); call compile preprocessFileLineNumbers (_base+"sched_safetyVehicle.sqf"); call compile preprocessFileLineNumbers (_base+"sched_lootCrates.sqf"); [ // period offset code <-> ctx init code ->ctx [ 60, 224, sched_corpses ], [ 60, 240, sched_lootCrates ], [ 300, 336, sched_lootpiles_5m, sched_lootpiles_5m_init ], [ 6, 340, sched_lootpiles ], // [ 900, 0, sched_sync ], [ 120, 48, sched_safetyVehicle ] ] execFSM ("z\addons\dayz_code\system\scheduler\scheduler.fsm"); //diag_log [ __FILE__, "Scheduler started"]; /* // (see ViralZeds.hpp -> zombie_agent.fsm -> zombie_findOwner.sqf), called when a zombie becomes "local" to the server after the player disconnected zombie_findOwner = { (_this select 0) call fa_deleteVehicle; }; */ That's all! I hope it works well... This is the link to Joelma's Time Control by @Donnovan : gernika, juandayz, looter809 and 4 others 5 2 Link to comment Share on other sites More sharing options...
WagnerMello Posted July 5, 2017 Report Share Posted July 5, 2017 After putting the script of step 1 the server does not load the database is stopped in game started Link to comment Share on other sites More sharing options...
Schalldampfer Posted July 5, 2017 Author Report Share Posted July 5, 2017 11 minutes ago, WagnerMello said: After putting the script of step 1 the server does not load the database is stopped in game started show me your .rpt Link to comment Share on other sites More sharing options...
WagnerMello Posted July 6, 2017 Report Share Posted July 6, 2017 RPT LOG https://pastebin.com/bYEVJ4fG Link to comment Share on other sites More sharing options...
Schalldampfer Posted July 6, 2017 Author Report Share Posted July 6, 2017 54 minutes ago, WagnerMello said: RPT LOG https://pastebin.com/bYEVJ4fG remove joelma's time ctrl. it's no need anymore. and, you seem to have broken other files you need not touch. you'd better read the rpt yourself, you have some error on installing other script. eg, you forgot ";" after calling yRunCleanup.sqf in server_function.sqf juandayz 1 Link to comment Share on other sites More sharing options...
juandayz Posted July 7, 2017 Report Share Posted July 7, 2017 i not try it yet... but great work @Schalldampfer replacing the old time_control.sqf and tnks for share it! gernika 1 Link to comment Share on other sites More sharing options...
gernika Posted July 13, 2017 Report Share Posted July 13, 2017 so its working @Schalldampfer? Link to comment Share on other sites More sharing options...
Schalldampfer Posted July 14, 2017 Author Report Share Posted July 14, 2017 23 hours ago, gernika said: so its working @Schalldampfer? Most time it works, sometime not. gernika 1 Link to comment Share on other sites More sharing options...
Schalldampfer Posted July 15, 2017 Author Report Share Posted July 15, 2017 Updated a bit juandayz 1 Link to comment Share on other sites More sharing options...
WagnerMello Posted July 25, 2017 Report Share Posted July 25, 2017 Hello friend, is it working normally? Link to comment Share on other sites More sharing options...
Schalldampfer Posted July 26, 2017 Author Report Share Posted July 26, 2017 7 hours ago, WagnerMello said: Hello friend, is it working normally? it's working well in my server now. Link to comment Share on other sites More sharing options...
RylanGivens Posted July 26, 2017 Report Share Posted July 26, 2017 It works on our server too, and thanks for sharing it :) But it stutters for us everytime that the script updates the changes, ie when going from day to night. I dont know if thats a problem for others tho, but is for us. Link to comment Share on other sites More sharing options...
WagnerMello Posted July 31, 2017 Report Share Posted July 31, 2017 Hello my server restart every 4 hours do I need to change anything? Because it is not making the effect of day and night Would using Infistar have any problems? Link to comment Share on other sites More sharing options...
Schalldampfer Posted August 9, 2017 Author Report Share Posted August 9, 2017 On 2017年8月1日 at 5:04 AM, WagnerMello said: Hello my server restart every 4 hours do I need to change anything? Because it is not making the effect of day and night Would using Infistar have any problems? Infistar seems to have something to do with this script, I dont know what do as I dont have one. Link to comment Share on other sites More sharing options...
Mylly Posted October 18, 2017 Report Share Posted October 18, 2017 Hello! Thank you for sharing this, However it lags everytime it updates it. Example the in game clock jumps forward and it lags for 0.5-1 second. Any idea why? Could it help if i change the speed lower? chi 1 Link to comment Share on other sites More sharing options...
Schalldampfer Posted October 18, 2017 Author Report Share Posted October 18, 2017 55 minutes ago, Mylly said: Hello! Thank you for sharing this, However it lags everytime it updates it. Example the in game clock jumps forward and it lags for 0.5-1 second. Any idea why? Could it help if i change the speed lower? I had heard of lags in higher multiplier. Changing it to slower seems to help the issue. Link to comment Share on other sites More sharing options...
Mylly Posted October 18, 2017 Report Share Posted October 18, 2017 5 minutes ago, Schalldampfer said: I had heard of lags in higher multiplier. Changing it to slower seems to help the issue. Hmm, Do i need to change the //========================TIME FUNCTION============================ _speed = 4.000; When i lower the values in day,dusk,dawn and night? Im pretty new with scripting :D Thanks for the fast reply! Link to comment Share on other sites More sharing options...
Mylly Posted October 18, 2017 Report Share Posted October 18, 2017 Ok well, I lowered the values and it is still freezing for 1 second everytime the ingame clock "warps" forward sadly... Could there be any way to have 2 different HiveExt.ini files with basically day and night values and make it so lets say first 2 hours of restart is day and then it changes to night? I might be explaining it a bit weird but hopefully everyone understands what i mean XD Link to comment Share on other sites More sharing options...
Bricktop Posted November 26, 2017 Report Share Posted November 26, 2017 First off thanks for this! I've been wanting to add fast nights since the 106 update I do have a couple of issues though. 1) The watch is not reflecting accelerated time is it supposed to ? (fast second hand spinning around) 2) The time update happens only after death (Once I respawn the watch updates the server time updates) Not sure if I missed something or what Thanks for any advice Link to comment Share on other sites More sharing options...
l1nkrx7 Posted November 26, 2017 Report Share Posted November 26, 2017 im using the old time control from 1.0.5.1 but modified for 1.0.6.1 works perfectly no flashes when it updates and time accelerates properly Schalldampfer 1 Link to comment Share on other sites More sharing options...
l1nkrx7 Posted November 26, 2017 Report Share Posted November 26, 2017 time control mission file time_control.sqf donn_sleep = 0.02; donn_multi = 4/3; drn_fnc_DynamicWeather_SetWeatherLocal = {}; //0 setOvercast 0; //0 setFog 0.05; if (!isDedicated) then { "cad_pvar_server_date" addPublicVariableEventHandler {(_this select 1) call donn_setdate;}; donn_setdate = { private ["_dateSer","_dateCli","_date_diff"]; donn_speed = _this select 1; 0 setOvercast 0; _dateSer = dateToNumber (_this select 0); _dateCli = dateToNumber date; _date_diff = (_dateSer-_dateCli)*12*31*24; if (abs _date_diff > 5/60) then {setDate (_this select 0);}; }; }; [] spawn { //LAST CHANGE WAS IN THIS SPAWN private ["_tm","_tmLen"]; _tm = diag_tickTime; waitUntil {!isNil "donn_speed"}; while {true} do { sleep donn_sleep; _tmLen = diag_TickTime - _tm; _tm = _tm + _tmLen; skipTime ((_tmLen*(donn_speed*donn_multi-1))/3600); }; }; if (!isDedicated) then { [] spawn { for "_x" from 1 to 10 do { "infiSTAR_SetDate" addPublicVariableEventHandler {}; "dayzSetDate" addPublicVariableEventHandler {}; cad_pvar_send_owner = player; publicVariableServer "cad_pvar_send_owner"; sleep 0.5; }; }; }; init.sqf at bottom call compile preprocessFileLineNumbers "scripts\time_control.sqf"; server side server_functions.sqf //time ctrl [] spawn { while {true} do { _dayTime = dayTime; //========================TIME FUNCTION============================ if (_dayTime >= 8 && _dayTime <= 16) then {donn_speed = 4.000;}; if (_dayTime > 4 && _dayTime < 8) then {donn_speed = 6.666;}; if (_dayTime > 16 && _dayTime < 20) then {donn_speed = 6.666;}; if (_dayTime <= 4 || _dayTime >= 20) then {donn_speed = 10.000;}; //================================================================= cad_pvar_server_date = [date, donn_speed]; publicVariable "cad_pvar_server_date"; sleep 30; }; }; "cad_pvar_send_owner" addPublicVariableEventHandler { cad_pvar_server_date = [date, donn_speed]; owner (_this select 1) publicVariableClient "cad_pvar_server_date"; }; sched_init.sqf alter like this //[ 900, 0, sched_sync ], Bricktop and juandayz 1 1 Link to comment Share on other sites More sharing options...
Bricktop Posted November 26, 2017 Report Share Posted November 26, 2017 8 hours ago, l1nkrx7 said: time control mission file time_control.sqf donn_sleep = 0.02; donn_multi = 4/3; drn_fnc_DynamicWeather_SetWeatherLocal = {}; //0 setOvercast 0; //0 setFog 0.05; if (!isDedicated) then { "cad_pvar_server_date" addPublicVariableEventHandler {(_this select 1) call donn_setdate;}; donn_setdate = { private ["_dateSer","_dateCli","_date_diff"]; donn_speed = _this select 1; 0 setOvercast 0; _dateSer = dateToNumber (_this select 0); _dateCli = dateToNumber date; _date_diff = (_dateSer-_dateCli)*12*31*24; if (abs _date_diff > 5/60) then {setDate (_this select 0);}; }; }; [] spawn { //LAST CHANGE WAS IN THIS SPAWN private ["_tm","_tmLen"]; _tm = diag_tickTime; waitUntil {!isNil "donn_speed"}; while {true} do { sleep donn_sleep; _tmLen = diag_TickTime - _tm; _tm = _tm + _tmLen; skipTime ((_tmLen*(donn_speed*donn_multi-1))/3600); }; }; if (!isDedicated) then { [] spawn { for "_x" from 1 to 10 do { "infiSTAR_SetDate" addPublicVariableEventHandler {}; "dayzSetDate" addPublicVariableEventHandler {}; cad_pvar_send_owner = player; publicVariableServer "cad_pvar_send_owner"; sleep 0.5; }; }; }; init.sqf at bottom call compile preprocessFileLineNumbers "scripts\time_control.sqf"; server side server_functions.sqf //time ctrl [] spawn { while {true} do { _dayTime = dayTime; //========================TIME FUNCTION============================ if (_dayTime >= 8 && _dayTime <= 16) then {donn_speed = 4.000;}; if (_dayTime > 4 && _dayTime < 8) then {donn_speed = 6.666;}; if (_dayTime > 16 && _dayTime < 20) then {donn_speed = 6.666;}; if (_dayTime <= 4 || _dayTime >= 20) then {donn_speed = 10.000;}; //================================================================= cad_pvar_server_date = [date, donn_speed]; publicVariable "cad_pvar_server_date"; sleep 30; }; }; "cad_pvar_send_owner" addPublicVariableEventHandler { cad_pvar_server_date = [date, donn_speed]; owner (_this select 1) publicVariableClient "cad_pvar_server_date"; }; sched_init.sqf alter like this //[ 900, 0, sched_sync ], Great man - thank you - Installed and working on overpoch 1061 Link to comment Share on other sites More sharing options...
gernika Posted November 28, 2017 Report Share Posted November 28, 2017 @Schalldampfer @l1nkrx7 works great. Just a doubt. How can I use it on my 4-hour server? What value do I need here? donn_multi = 4/3; Link to comment Share on other sites More sharing options...
l1nkrx7 Posted November 28, 2017 Report Share Posted November 28, 2017 I've been tweaking trying to get 3 hours day and 1 hour night think you need to test with server start time Link to comment Share on other sites More sharing options...
gernika Posted November 28, 2017 Report Share Posted November 28, 2017 Just now, l1nkrx7 said: I've been tweaking trying to get 3 hours day and 1 hour night think you need to test with server start time ask because in the donnova´s post found that: To have a 3 hours day, change the line "donn_multi = 2;" in time_control.sqf: donn_multi = 1; -> 4 hours day donn_multi = 4/3; -> 3 hours day donn_multi = 2; -> 2 hours day Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now