Jump to content
Sign in to follow this  
Sgt_Wilson

Global variables

Recommended Posts

Can I update a global variable defined in one script, from within another script?

------------------- CallingScript.sqs

GlobalList = [1,22,3]

[] exec "Update.sqs"

hint Format["%1",GlobalList select 1]

------------------- Update.sqs

GlobalList set [1,2]

Exit

-------------------

I cant get this to work, the new value added to GlobalList array only shows up from within the UpDate.sqs script.

Cheers

P.S I did try and search through the old post, to no avail.

Share this post


Link to post
Share on other sites
Guest jacobaby

have you tried a pause after exec'ing the update sqs, for a second or so? I think the hint is exec'd before the new array value can be set.

you CAN have a global array, if you want it broadcast for MP games you have to do that too.

TJ

Share this post


Link to post
Share on other sites

Yes, thanks.

That did the trick, I managed to get it down to something silly like 0.0001.

Share this post


Link to post
Share on other sites
Guest jacobaby

if you want it to work in MP you have to allow for the broadcasting, so use an @ to wait unti the array is changed

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  

×