Jump to content
  • 0

Accelerated time


BetterDeadThanZed

Question

With Exile, I was able to use this script to accelerate time:

if (!isServer) exitWith {};

while {true} do
{
	if (daytime >= 18 || daytime < 6) then   // after 7pm and before 5am time multiplier changes
	{
		setTimeMultiplier 13      // adjust this value for slower or faster night cycle ( 24 hours will take 1 hour )
	}
	else
	{
		setTimeMultiplier 5      // adjust this value for slower or faster day cycle  ( 12 hours will take 1 hour )
	};

	uiSleep 30;
};

I called it from init.sqf:

[] execVM "custom\time\time.sqf";			    // Time

This doesn't seem to work with Epoch. Do I need to change something with the code?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

That should work, the only time we set the setTimeMultiplier server side is at startup. I would however suggest that instead of spawning another thread (exevVM)  with an infinite loop (while {true} do...) you could do it with a Epoch Event server side.

https://github.com/EpochModTeam/Epoch/commit/9a1751177ca3cdbd1a2cd33caca91d3e0c02c8bc

FastNights.sqf
 

if (sunOrMoon < 0.99) then { // adjust this lower to change sooner. Note: "0.99 value, the twilight is still quite dark" https://community.bistudio.com/wiki/sunOrMoon
	setTimeMultiplier 13      // adjust this value for slower or faster night cycle ( 24 hours will take 1 hour )
} else {
	setTimeMultiplier 5      // adjust this value for slower or faster day cycle  ( 12 hours will take 1 hour )
};

FYI, I am using sunOrMoon here  as it is better at determining day or night as the different latitude and longitudes will result in different sunset and sunrise times. 

 

This file will be a part of the settings pbo starting build 437 or you can grab the epoch_server_settings.pbo now and then add the line below to your epochconfig.hpp https://github.com/EpochModTeam/Epoch/blob/master/Server_Install_Pack/%40epochhive/epochconfig.hpp#L14-L20

{ 600, "FastNights" },

This would execute FastNights.sqf every 10 minutes server side to make the time multiplier faster at nighttime.

Link to comment
Share on other sites

  • 0
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
  • Discord

×
×
  • Create New...