Jump to content
easyeb

Random time at mission start + faster day/night cycle

Recommended Posts

Hi all!

I'm scratching my head trying to figure out what I'm doing wrong.

I have two snippets I try to run in the init field. One is to set mission start time as random, and the other is to make time go faster. Now, my problem is I'm having trouble getting them to run at the same time.

The first bit is:

while {true} do {skiptime 0.00033; sleep 0.1};

Makes time go a bit faster. Is nice.

The second part is:

if (isServer) then

{

myNewTime = random 24;

publicVariable "myNewTime";

};

waitUntil{not isNil "myNewTime"};

skipTime myNewTime;

Now, how would one go about getting these to run togeather? What am I doing wrong?

Cheers!

Share this post


Link to post
Share on other sites

Hey, it worked! Thanks alot Greenfist!

Share this post


Link to post
Share on other sites

you should skiptime on server only, or better setdate on server before the mission start

Share this post


Link to post
Share on other sites

I need start mission in any interval time not 24 but  from 6 to 18

what is the syntax here myNewTime = random 24; ???

 

i try: myNewTime = 6 + random 12; but not working, mission start at 22:15 and not in interval 6 - 18

 

thx so much.

Share this post


Link to post
Share on other sites

Scratch the first part (hidden inside the spoiler) it seems using preprocessors inside the mission.sqm does no longer work in Arma3!

For random mission start time:

File: Mission.sqm

	class Intel
	{
		timeOfChanges=1800.0002;
		startWeather=0.30000001;
		startWind=0.1;
		startWaves=0.1;
		forecastWeather=0.30000001;
		forecastWind=0.1;
		forecastWaves=0.1;
		forecastLightnings=0.1;
		year=2035;
		month=7;
		day=6;
		hour=__EVAL(round(6+(random 12));
		minute=__EVAL(round(random 59));
		startFogDecay=0.013;
		forecastFogDecay=0.013;
	};
Wiki page:

https://community.bistudio.com/wiki/PreProcessor_Commands#EVAL

For faster time:

File: init.sqf

if(isServer)then{setTimeMultiplier <#>};
Or file: initServer.sqf

setTimeMultiplier <#>;
Wiki pages:

https://community.bistudio.com/wiki/Event_Scripts

https://community.bistudio.com/wiki/setTimeMultiplier

Greez Kilo

Share this post


Link to post
Share on other sites

Scratch the first part (hidden inside the spoiler) it seems using preprocessors inside the mission.sqm does no longer work in Arma3!

For random mission start time:

File: Mission.sqm

	class Intel
	{
		timeOfChanges=1800.0002;
		startWeather=0.30000001;
		startWind=0.1;
		startWaves=0.1;
		forecastWeather=0.30000001;
		forecastWind=0.1;
		forecastWaves=0.1;
		forecastLightnings=0.1;
		year=2035;
		month=7;
		day=6;
		hour=__EVAL(round(6+(random 12));
		minute=__EVAL(round(random 59));
		startFogDecay=0.013;
		forecastFogDecay=0.013;
	};
Wiki page:

https://community.bistudio.com/wiki/PreProcessor_Commands#EVAL

For faster time:

File: init.sqf

if(isServer)then{setTimeMultiplier <#>};
Or file: initServer.sqf

setTimeMultiplier <#>;
Wiki pages:

https://community.bistudio.com/wiki/Event_Scripts

https://community.bistudio.com/wiki/setTimeMultiplier

Greez Kilo

 

in your example missing ")"

hour=__EVAL(round(6+(random 12));

i correct but not working

 

the server restarting mission with this parameters in config.cpp:

class Time

    {

        // Uses Dedicated Server time as ingame Time

        useRealTime = 0;

        // Will overide RealTime

        useStaticTime = 1;

        // time in ARMA FORMAT << CONFIG

        // https://community.bistudio.com/wiki/setDate

        

        staticTime[] = {2040,06,30,9,20};

        

    };

 

 

maybe is need to change some other parameters?

i deleted in init.sqf the second part of first post becouse server starting mssion at 1:35 and this is not right.

the server has to starting from 6 to 18.

 

i set this parameter setTimeMultiplier 4;

server restarting every 3 hrs, so in game 12 hours have passed.

 

thx.

sorry for my english ;)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×