4ntifa 0 Posted January 5, 2002 If unit X has activated a trigger, which runs a script, what happens if unit Y then also activates the trigger while the previously launched script is still running? Does another instance of the script begin running, totally independent of the one already running? Or does the previous script terminate and then run again, from the beginning? Or something else? Share this post Link to post Share on other sites
Gaswell 1 Posted January 5, 2002 I've had multiple instances of the same script running, without any problems. Just keep your vars local. Share this post Link to post Share on other sites
4ntifa 0 Posted January 5, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Gaswell @ Jan. 05 2002,15:41)</td></tr><tr><td id="QUOTE">I've had multiple instances of the same script running, without any problems. Just keep your vars local.<span id='postcolor'> This whole local/global stuff is pretty much undocumented. How does it work? Prefixing varnames with an _underscore makes a variable local, right? So, without it, it's global? And a global variable would be "visible" to other instances or even totally different scripts? Share this post Link to post Share on other sites
Snake1999 0 Posted January 5, 2002 Yes, it's like in any programming language; A local variable in a script exist only when the host script is called. Once the script terminates, the local variables gets removed, thus losing their data. A global variable on the other hand is alwayes there, and can be checked from outside a script (if it's located in a script). You can have a global variable in script A that's being checked in script B, and so on. They're known and stored by the "world" (meaning everyone knows about it). Share this post Link to post Share on other sites