Jump to content
Sign in to follow this  
marcusm

What i'm doing wrong?

Recommended Posts

Hi!

inspired of some dynamic-weather topics in the past months,

i'm trying to write my own dynamic weather script for MP missions. Here it is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

changetime=0

#start

~changetime+30

;servercode

?!(local server) : goto "wait"

changetime=1200+(random 1200)

weather=random 1

?(weather >= .52) : goto "foghigh"

?(weather < .52) : goto "foglow"

#foghigh

fog=.44+(random .41)

goto "continue"

#foglow

fog=.075+(random .25)

goto "continue"

#continue

;here the problem starts...

publicVariable "changetime"

publicVariable "weather"

publicVariable "fog"

#wait

;code executed on all machines...

@(changetime != 0)

~1

changetime setOvercast weather

changetime setFog fog

goto "start"

#end

exit

and now my problem: when the three variables (changetime, weather and fog) shall be declared as public variables, i get

the "unknown operator"-message. Does anybody know why?

Thank you all very much for your help! smile_o.gif

Share this post


Link to post
Share on other sites

I just ran your script and didn't get any errors? You might want to do this though:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#start

changetime=0

RED

Share this post


Link to post
Share on other sites

Thank you for your time, RED!

I just found the bug, it was my init.sqs! smile_o.gif:

In the init.sqs i wrote:

publicVariable = "variable" instead of

publicvariable "variable"...

hmm, it was just a stupid/small mistake so i hope that i didn't cause too much excitement just because of this... biggrin_o.gif

Greetings!

Share this post


Link to post
Share on other sites

It is fine smile_o.gif If you are interested, the ECP has a random weather script included that can be altered to suit mission editors needs. The ECP can be found here.

Good luck with your mission marcusm.

RED

Share this post


Link to post
Share on other sites

...sounds interesting, i'll have a look at ECP. smile_o.gif

Thank you again for your time! wink_o.gif

Greetings !

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  

×