Dayz_dawn and Dayz_dusk not working;

i have never seen those values or any use of them.

this has come,up a few times and the solution would,be in setting the dayzsetdate to a special value.. the server syncs the time every few minutes. so the code needs to be replaced to change the hour.

if hour is between 3 and 7 set hour to 8
if hour is between 18 and 23 set hour to 17

but i think when a player joins they get the hour from the server and then its updated during server monitor so they would see a time shift 5 minutes after joining. .. need to have code to update client time upon joining immediately
 
lol
its like a lesson in programming :D its up to you to provide the code.

now this is off the top of my head and based on pre-1.8.3 code SO I MAY BE WRONG

in the server_monitor.sqf is a bit of code where it queries the operating system for the system date time and saves it in _date.
then it sets the current time on the server to that date-time.
then it sets the publicvariable _date which will then sync the date on all clients.
you need to change the _date variable before setdate is used.
the code you write will find the hour in the _date variable and use an if clause to set the hour to what you want.

if _hour is 3 then set hour to 7
if _hour is 20 then ser hour to 14
etcetera

check the server_functions i think for code on how to extract the hour from the _date variable... i would use 'find in files' searching for setdate

as i said there will be a visible time shift. perhaps a better solution would be to start setting the clock backwards at 10pm. so at 10:10 we set time 9:50 and 10:20 set time to 9:40 ... this would give you a gradual day to night, then night to day progression

this method is intriguing, i may work on this if i have time.

has anyone ever tried the skiptime functions?https://community.bistudio.com/wiki/skipTime of course you would,have o override the server_monitor time updates as above
 
i understand your code, but i am a bit lost where i have to do it, in init? separated sqf file? server_functions and server_clenaup.sqm?
if you help me or do this, will be great, because none has a solution for short nights, and i know people want to use local time, with short nights.
for exemple night starting at 23 hours and stoping at 4 hours
 
i am,at,work and will have to review some later.

but i think the code should be right,wherebyou are setting the time in those 2 files. just change,the time,based on,current,time
 
how i do that without get a loop?
Code:
so at 10:10 we set time 9:50 and 10:20 set time to 9:40 ... this would give you a gradual day to night, then night to day progression
because if i set every 10:10 to 9:50, this will be a loop infinite. (time never will 10:11)

anyway to use a while in this language?
for exemple
Code:
count = 0
whilte (count <= 1)  do
{
       if (_hour == 3) then {
             exemple
             count++
       };
};
or using a count += 1?

then this will happen only once, can i do this?
 
Last edited:
I think we have to step back here and start over. I have myself confused at this point :D

We can do this, but lets nail down exactly what you do including your restart schedule. And i think you had mentioned wanting to stay with local time, but thats not going to work if you are accelerating time. Unless you just want to accellerate the night, in which case whats the point of even having night? I thought a good solution was to just have the server time be 2pm when you restart then it runs for 6-7 hours and you get in about an hour of night, then it restarts into 2pm again. so you get a short night every time. I always disliked the twilight, so you could use this method but accellerate time so the twilight doesnt last so long and then have an hour of night. So bright day, 5pm start accelerating time, 8pm its dark and we stop acclerating time, restart the server at 9pm. Have to set it so that 3 hours from 5pm to 8pm takes maybe 1 hour? Plus 1 hour of night, so server start time would be 1pm for a 6 hour restart schedule.

But tell us exactly what you want to happen (taking restarts into consideration too).
 
in my tests, the game is going to very very dark at 5pm, i want he go dark only at 11pm, and is dawn at 7-8am i want he go dawn at 4am, (dawn like my region) (sunset later, for those who work all day can still play day.)
^^ after http://opendayz.net/threads/cant-seem-to-get-bright-sunny-days.21459/#post-116786
i need to re-test, 30 min.

im trying to get a shorter night,that I can still see the sunset and sunrise (using local time)
 
Last edited:
Okay, so you want a sunset at your local time and dawn at your local time. But you want a short night. So what do you expect between? just a single night or multiple short nights? You have about 10 hours of 'night' to use up until dawn.
 
i was trying to get only dawn at local time, not dusk.
--
in last tests after fix "cant seem to get bright sunny days" i got dusk at 8pm at dawn at 3pm so i think i can set offest +3;
so all working fine dusk at 11pm and dawn at 5am, and we don't need work on code.

(my bad not test this after last changes).
 
Last edited:
i have the feeling that you have not gotten exactly what you want and have kind of given up. this is a complex issue really. maybe someone will work out a script to allow more customization of day night settings ...
 
not really, before i fix "cant seem to get bright sunny days" my game was going to dusk at 4pm using local date and time, so 5pm without full moon night is very very dark, and dawn at 7-8 am, so this was impossible to keep night in server,
but now i have only 5hours of night + 1 hour of dusk + 1hour of dawn and this is fine for me.
i think is something relative with _date = [2012,7,2,_hour,_minute];
 
well yes. in the summer months dawn is early and sunset is late. In winter, dawn is later and sunset is earlier. So if you set the date for the longest day of the year, you will have less night .
 
Back
Top