Jump to content
Sign in to follow this  
*-HWS-*SubZero

Custom Weathers & Timing

Recommended Posts

Hi there dudes, I was wondering about a question...

I would like to have a choice for the weather and the time before starting a MP mission.

*-My description.ext is set up like this

//////////////////////////////

titleParam1 = "Wetter";

valuesParam2[] = {1, 2, 3, 4, 5, 6};

defValueParam2 = 6;

textsParam2[] = {"Clear", "Cloudy", "Fog", "Rain", "Wind", "Random"};

//////////////////////////////

*-My init.sqs is this way:

[] exec "server.sqs"

*-And I got a script named server.sqs with this in:

#weather

? param1 == 2: 0 setovercast 0.9

? param1 == 3: 0 setfog 0.8

? param1 == 4: 0 setovercast 0.75; 0 setrain 0.9

? param1 == 5: 0 setovercast 1; 0 setrain 1

? param1 == 6: 0 setfog (random 1); 0 setovercast (random 1); 0 setrain (random 1)

exit

But It doesn't seems to work at all, so am I missing something out there or maybe theres something missing...

Thanks for help!

Share this post


Link to post
Share on other sites

Well here is my setup for the time. You can change it around for the weather.

Init.sqs.......

[] exec "settime.sqs"

settime .sqs.......

_timevalue = Param2

;// Set time to 00:00

_ZeroTime = 24 - DayTime

SkipTime _ZeroTime

;//Set New Time

SkipTime _timevalue

exit

Description.ext.......

TitleParam2 = "Time Of Day:";

ValuesParam2[]=

{

5.2,

12,

19,

24,

};

TextsParam2[]=

{

"Sunrise",

"Noon",

"Sunset",

"Midnight",

};

defValueParam2 = 12;

Share this post


Link to post
Share on other sites

@ *-HWS-*SubZero: Follow the BAS f link in my signature - there is a time and weather selector built into BAS f, plus full instructions in the accompanying manual. There are also another 23 components designed specifically for MP missions which you may find useful ...

wink_o.gif

Share this post


Link to post
Share on other sites
@ *-HWS-*SubZero: Follow the BAS f link in my signature - there is a time and weather selector built into BAS f, plus full instructions in the accompanying manual. There are also another 23 components designed specifically for MP missions which you may find useful ...

wink_o.gif

Oh come on, he's almost got it, let him finish.  mad_o.gif

*-HWS-*SubZero, take another look at that description.ext...

titleParam1 = "Wetter";

valuesParam2[] = {1, 2, 3, 4, 5, 6};

defValueParam2 = 6;

textsParam2[] = {"Clear", "Cloudy", "Fog", "Rain", "Wind", "Random"};

You want Param1, not Param2 (underlined & bolded).  wink_o.gif

Share this post


Link to post
Share on other sites

Just a sidenote:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">*-My init.sqs is this way:

[] exec "server.sqs"

This will launch your script everywhere,in combination with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? param1 == 6: 0 setfog (random 1); 0 setovercast (random 1); 0 setrain (random 1)

you might end up with different weather for each client...

unless thats no prob for your mission.

(Because random will generate different values for each client)

Share this post


Link to post
Share on other sites

@ *-HWS-*SubZero: I fear Platoon_Patton is right to draw your attention to the use of random. What you need to do is generate the random numbers on the server only, and then broadcast them to the clients before running your weather script. That way you avoid the collision when clients generate different random values.

If you are making the mission for v1.07 or above, you can force a script to run only on the server using the isServer command. If you are making the mission for v1.05/06, you can use the old method of checking whether a game logic is local (there is an example of this in BAS f).

Oh come on, he's almost got it, let him finish. mad_o.gif

@ KyleSarnik: Oh no, I'm confused - how come Op4 BuhBye doesn't get an angry face too?!?! lol, if you're gonna flame, at least be equitable about it! Anyway, *-HWS-*SubZero isn't obliged to use the BAS f version, but it works (and in 7 languages too), so perhaps he can rip it apart and build something that suits his own needs? It's how most of us learnt. ... Okay, that and asking Rom.

wink_o.gif

Share this post


Link to post
Share on other sites

Well thx to everyone for this fast reply, really nice from you guys.

Im Fixed!

Don't have a lot of time to edit like I used to have in ofp...

Thx Again!

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  

×