Jump to content
Sign in to follow this  
Von Quest

Random Start Time BUT MOSTLY Day Missions?

Recommended Posts

Ok, been digging around for over an hour now...

Looking for a snippet of code for mostly daytime Start Times.

The one below should be equal, but oddly enough we mostly got

Night Start Times. Looking for maybe 10% to be after dark.

We want ANY Time to be OK, but with near 90% (or so) to be

Daylight Mission Start Times. I'm guessing I'll have to do an Array?

if (isServer) then
{
myNewTime = random 24;
publicVariable "myNewTime";
};
waitUntil{not isNil "myNewTime"};
skipTime myNewTime;

So, to be clear, we want some Night Missions. Just very rarely.

Share this post


Link to post
Share on other sites

if (isServer) then
{
    myTime = [8, 9, 10, 14, 16, 21, 20]call bis_fnc_selectRandom;
    publicVariable "myTime "; 
}; 
waitUntil{not isNil "myTime "}; 
skipTime myTime;

would that work? and of course to get more day times, just add more in and less night ;D

Share this post


Link to post
Share on other sites

if (isServer) then {
if (random 1 <= 0.90) then {
	myNewTime = 5.5 + random 13; // day
} else {
	if (random 1 <= 0.66) then {
		myNewTime = random 5.5; // night 
	} else {
		myNewTime = 18.5 + random 5.5; // evening
	};
};
publicVariable "myNewTime";
};	
waitUntil{not isNil "myNewTime"};
skipTime myNewTime;

---------- Post added at 21:06 ---------- Previous post was at 20:45 ----------

Obviously your mission time has to be 00:00 for this to work properly

  • Like 1

Share this post


Link to post
Share on other sites

Obviously your mission time has to be 00:00 for this to work properly

And it'll vary slightly depending on the time of year and light-wise depending on weather conditions at dawn and dusk. But not by much.

Share this post


Link to post
Share on other sites

Rgr that guys...

Thank you so much!

DudeGuyManBro, that's EXACTLY what I was looking for. Thank You! o7

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
Sign in to follow this  

×