Results 1 to 5 of 5

Thread: What i'm doing wrong?

  1. #1

    Unhappy

    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
    ?&#33;&#40;local server&#41; &#58; goto &#34;wait&#34;


    changetime=1200+&#40;random 1200&#41;

    weather=random 1



    ?&#40;weather &#62;= .52&#41; &#58; goto &#34;foghigh&#34;
    ?&#40;weather &#60; .52&#41; &#58; goto &#34;foglow&#34;


    #foghigh
    fog=.44+&#40;random .41&#41;

    goto &#34;continue&#34;


    #foglow
    fog=.075+&#40;random .25&#41;

    goto &#34;continue&#34;




    #continue

    ;here the problem starts...
    publicVariable &#34;changetime&#34;
    publicVariable &#34;weather&#34;
    publicVariable &#34;fog&#34;


    #wait
    ;code executed on all machines...

    @&#40;changetime &#33;= 0&#41;
    ~1

    changetime setOvercast weather
    changetime setFog fog


    goto &#34;start&#34;

    #end
    exit
    [/QUOTE]

    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&#33;

  2. #2
    I just ran your script and didn&#39;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
    [/QUOTE]

    RED

  3. #3
    Private First Class
    Join Date
    Apr 27 2002
    Location
    Germany
    Posts
    39
    Author of the Thread

    Thumbs up

    Thank you for your time, RED&#33;

    I just found the bug, it was my init.sqs&#33; :

    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&#39;t cause too much excitement just because of this...

    Greetings&#33;

  4. #4
    It is fine 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

  5. #5
    Private First Class
    Join Date
    Apr 27 2002
    Location
    Germany
    Posts
    39
    Author of the Thread
    ...sounds interesting, i&#39;ll have a look at ECP.


    Thank you again for your time&#33;***

    Greetings &#33;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •