Jump to content

Shortened day/night cycles?


Recommended Posts

I wish I could get this working :/ Unfortunately DayZ.ST doesn't allow you to modify the hiveext.ini file so I'm somewhat at a loss as to how to fix this. It ultimately forces me to run an all day-time server which is unfortunate because night time brings an entirely different feel to the game. Has anyone managed to get this to work?

Link to comment
Share on other sites

For all it's worth my start up batch file runs a wscript that alters the hour in the hivext.ini before every restart.  This ensures that every restart we might have night or day.  It can be expanded to to simulate other times as well.  I've made it so that night time never repeats on the next restart.  With 3 hour restarts we were able to achieve variety in the game lighting.  Change was frequent enough that people got to experience different lighting regardless of their actual time of day yet not have to be married to lighting that they didn't like.

 

For the most part people have liked it.  If anyone is interested I can post the change.  Mind you it's cheap and cheerful since it was never meant to be published.

Link to comment
Share on other sites

For all it's worth my start up batch file runs a wscript that alters the hour in the hivext.ini before every restart.  This ensures that every restart we might have night or day.  It can be expanded to to simulate other times as well.  I've made it so that night time never repeats on the next restart.  With 3 hour restarts we were able to achieve variety in the game lighting.  Change was frequent enough that people got to experience different lighting regardless of their actual time of day yet not have to be married to lighting that they didn't like.

 

For the most part people have liked it.  If anyone is interested I can post the change.  Mind you it's cheap and cheerful since it was never meant to be published.

 

I'm interested, please PM me if you don't want to post it.  I've been looking for this.

Link to comment
Share on other sites

No concern's about sharing.  Actually wasn't sure if people would be interested.

 

Here is my restart.cmd file:  What's unique here is the bolded call to the vbs alters the hivext.ini.  I've enclosed the vbs script that does the randomizer below that.  For now it switches from noon to 10:00 pm with a 1 in 3 chance it's 10:00 pm with it never repeating 2 restarts at 10:00 pm.  Anyone with some vbs scripting should be able to add more logic to add more times (i.e. like dusk and dawn).

 

c:
@echo off
echo.
echo KILL arma2oaserver.exe
taskkill /im arma2oaserver.exe
echo.
ping 127.0.0.1 -n 10 >NUL
echo.
echo randomizing day/night
cscript "C:\Program Files (x86)\Steam\SteamApps\common\arma 2 operation arrowhead\timechange.vbs"
cd "C:\Program Files (x86)\Steam\SteamApps\common\arma 2 operation arrowhead"
@start "arma2" /min "Expansion\beta\arma2oaserver.exe" "-port=2302" "-config=instance_11_Chernarus\config.cfg" "-cfg=instance_11_Chernarus\basic.cfg" "-profiles=instance_11_Chernarus" -name=instance_11_Chernarus "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" "-world=Chernarus" "-maxmem=2047" "-noCB"
echo.
ping 127.0.0.1 -n 20 >NUL
echo START BEC
echo.
:: start bec
cd "C:\Program Files (x86)\Steam\SteamApps\common\arma 2 operation arrowhead\Bec"
start "" "bec.exe" -f config.cfg
 
Here is the timechange.vbs script
 
Option Explicit
'Create an instance of the FileSystemObject object
Dim objFSO
Dim objTextStream
Dim objString
Dim objNum
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile("C:\Program Files (x86)\Steam\steamapps\common\arma 2 operation arrowhead\instance_11_Chernarus\HiveExt.ini", 1)
 
objString = objTextStream.ReadAll
objTextStream.Close
 
Randomize 
objNum = Int(3 * Rnd + 1)
 
'Don't repeat night time
if objNum = 1 and instr(objString, "Hour = 22") = 0 then
objString = Replace(objString,"Hour = 12", "Hour = 22")
wscript.echo "Night Time!"
else
objString = Replace(objString,"Hour = 22", "Hour = 12")
wscript.echo "Day Time!"
end if
 
Set objTextStream = objFSO.OpenTextFile("C:\Program Files (x86)\Steam\steamapps\common\arma 2 operation arrowhead\instance_11_Chernarus\HiveExt.ini", 2)
objTextStream.WriteLine objString
objTextStream.Close

 

 

Edit: Feel free to PM if you have questions.

Link to comment
Share on other sites

I am using this

http://opendayz.net/threads/night-on-every-third-restart.14418/#post-77127

 

so far works perfectly fine on restarts.

 

since i restart the server using FireDaemon i made changes to day.bat and night.bat that runs 1 min before server restart with BEC scheduling

@echo off
 
xcopy /Y C:\Servers\dayz_epoch\instance_11_Chernarus\day\HiveExt.ini C:\Servers\dayz_epoch\instance_11_Chernarus\
timeout 5

It's a very simple solution but only works for restarts

Link to comment
Share on other sites

  • 3 months later...

I use this http://mckooter.com/mck/core_time.rar

 

Add this in your init.sqf

[5,true,10,1,true,7] execFSM "Scripts\core_time.fsm";

You can change the values to your liking. The example above means: Skip 5 minutes every 1 minutes at Daytime and 7 minutes every 1minute at Nighttime and sync it every 10 Minutes. (10Minutes Realtime = 50 Minutes ingame Day/ 10 Minutes Realtime = 70 Ingame Night)

 

In your server_cleanup.fsm look for the "time_sync" part and delete it. It looks lik:

 

/*%FSM</LINK>*/
/*%FSM<LINK "time_sync">*/
class time_sync
{
priority=3.000000;
to="sync_the_time";
precondition=/*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(time - _lastTimeSync) > 300"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastTimeSync=time;"/*%FSM</ACTION""">*/;
};

 

This will solve the problem where the server is resetting/or stucking at a special time.

 

It works great. Only Thing: It takes 10 minutes that all player at the server are synced with the time. So its possible that some has night and a fresh log in has day - he will get the real server time (night for example) just after 10 minutes.

Link to comment
Share on other sites

  • 2 weeks later...

I use this http://mckooter.com/mck/core_time.rar

 

Add this in your init.sqf

[5,true,10,1,true,7] execFSM "Scripts\core_time.fsm";

You can change the values to your liking. The example above means: Skip 5 minutes every 1 minutes at Daytime and 7 minutes every 1minute at Nighttime and sync it every 10 Minutes. (10Minutes Realtime = 50 Minutes ingame Day/ 10 Minutes Realtime = 70 Ingame Night)

 

In your server_cleanup.fsm look for the "time_sync" part and delete it. It looks lik:

 

/*%FSM</LINK>*/

/*%FSM<LINK "time_sync">*/

class time_sync

{

priority=3.000000;

to="sync_the_time";

precondition=/*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;

condition=/*%FSM<CONDITION""">*/"(time - _lastTimeSync) > 300"/*%FSM</CONDITION""">*/;

action=/*%FSM<ACTION""">*/"_lastTimeSync=time;"/*%FSM</ACTION""">*/;

};

 

This will solve the problem where the server is resetting/or stucking at a special time.

 

It works great. Only Thing: It takes 10 minutes that all player at the server are synced with the time. So its possible that some has night and a fresh log in has day - he will get the real server time (night for example) just after 10 minutes.

Link is dead. Could you upload to another host. Thanks would be much appreciated.

 

Nevermind!! Found it.

Link to comment
Share on other sites

in what does this result... 2hr day, 1 hr night? or 2hr day, 2hr night? if its night does night continue after restart or does it starts with day again?

 

or How can i tune it so i have 2 hr day and 1 hr night every 3hr restartcycle...

Link to comment
Share on other sites

in what does this result... 2hr day, 1 hr night? or 2hr day, 2hr night? if its night does night continue after restart or does it starts with day again?

 

or How can i tune it so i have 2 hr day and 1 hr night every 3hr restartcycle...

 

i thought to have read anywhere else that daytime is from 6am to 8pm and night from 8pm to 6am but i m not sure. I have never really tested it but you can try to set it up like this:

 

[6,true,10,1,true,10] execFSM "Scripts\core_time.fsm";

this should nearly be 2hr day and 1 hr night.

 

Im using a static server time on every restart and the starting time is depending to you cycle you want to run. So you maybe need to fine-tune BEC a lil bit for your automatic restarts and a nearly full day/night cycle.

Link to comment
Share on other sites

I actually have a really easy way of doing this.  It works for me but before I put it out to the public, I would love to have another person or 2 test it.  I have no desire to keep it private, just would like a couple testers to vet it for me.  It does require you have access to your HiveExt.ini and BEC scheduler.xml

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...