Jump to content

Joelma's Time Control


Donnovan

Recommended Posts

Hello guys, couldn't find an answer to my question, sorry if this has been asked already.

 

Our thrist goes down faster since we are using the script. How can I tunne it? I would like let's say to decrease the thirst loss, blood, etc by 3 times, does anyone know how I can do that?

 

Thanks.

 

I can't say that I've ever noticed my thirst going down any quicker with this script.

Link to comment
Share on other sites

I've spent an extensive amount of time killing zombies from my base and I haven't noticed an increase in their presence. I'm also pretty sure you can't "clear" an area of zombies. They will keep spawning as long as you are near places they spawn from.

 

Also, something I've encountered the last two days... I put up a new server and of course I'm using this. On two occasions, I've noticed that the time was off when I logged in. Since it's a new server, there aren't as many players on, and the server may go for a while without anyone on it. Yesterday I logged in about 50 minutes before server restart and it was 2am server time. It should have been around 10am server time. Today I logged in with around the same amount of time left and it was around 6am. If players aren't on the server, does the acceleration work properly?

Link to comment
Share on other sites

I am NOT SURE AT ALL, but I think server function is called once one player has joined? Not sure.

 

ATM I have set a day/night cycle of 3hours day light & 1h night.

 

I have set that between  8 am and 4 PM( we are on an origins server, need to set "night time" to  4PM it seems instead of ~6) that 1SEC RT == 2.7 or so and then when its  4PM++ ration is 6.66X

 

All working great, got one or two ppl asking about thurst, but in the end nothing to worry about.

 

THank you again for this it rocks  defo on origins servers

Link to comment
Share on other sites

BetterDeadThanZed,

Time start to pass when the first player join the server, because it's when the server load the mission file for itself, and the time acelerator is in the mission file.

Interesting: with server on, before first player to join, you still can modify the mission files, this proove the server have not loaded it.

If this player logoff the server, and no more players login (empty server), time continue to pass.

-- // --

I have done some nice improovement on the scrips, mostly making if more "elegant" HAHA! Will release soon, and it can fix those last and exporadic errors.

Link to comment
Share on other sites

Maybe an alternative, have the script check the server uptime, then adjust it based on the static start time and your set multiplier, then set the mission time and start acceleration. Example, I have a 4 hour restart set, but if nobody logs in for an hour the time acceleration wouldn't start at the right time, it would be 7am instead of noon in game(im assuming that it would run normal time from the hive.ini until this script starts) if the script checked uptime it woukd say"server has been up for 1hour, time should be x" and set that.

Link to comment
Share on other sites

My solution would be:

 

When state of  initialSend changes. You could check the difference between the actual time elapsed * donn_mul * don_spped and serverTime/diag_TIme IF this difference is better than some CONSTANT. Then you call correct the hour: )

 

 

what do you thhink of that @Donnovan ?

 

is it at all possible to get this working with weather?
yes but then you got weird things, since the times is accelerating each 0.X sec the weather is weird
Link to comment
Share on other sites

  • 4 weeks later...

BetterDeadThanZed,

 

Try this time_control.sqf, but i believe you will have a big FPS impact:

donn_sleep = 0.001;
donn_multi = 2;

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;
        _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 {
    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 {};
            "PVDZE_plr_SetDate" addPublicVariableEventHandler {};
            cad_pvar_send_owner = player;
            publicVariableServer "cad_pvar_send_owner";
            sleep 0.5;
        };
    };
};

donn_sleep = 0.001; gives the max smoothnes and the worst fps.

 

You can try greater values like 0.005 or 0.01 or even 0.02.

 

Also, the most faster the time is the most easy is to see jumping clouds. For a 2 hours day, i believe 0.02 is ok, but you can play with it.

Link to comment
Share on other sites

Also, i did a update that remove this part of the code:

if (!isDedicated) then {
    [] spawn {
        for "_x" from 1 to 10 do {
            "infiSTAR_SetDate" addPublicVariableEventHandler {};
            "PVDZE_plr_SetDate" addPublicVariableEventHandler {};
            cad_pvar_send_owner = player;
            publicVariableServer "cad_pvar_send_owner";
            sleep 0.5;
        };
    };

};

Just need some time to put it here. It also fix sync check to maximum precision, avoiding unnecessary ajusts in player time (what gives a small freeze).

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...