celery 8 Posted January 30, 2011 I've seen a lot of people using disposable script handles like nul, nill or 0, but what exactly is the reason nil isn't used? I've used nil as a spawn handle in numerous simultaneous loops and other things, and so far there hasn't been a single conflict. Share this post Link to post Share on other sites
SaOk 112 Posted January 30, 2011 I have heard that the best would be to use "local" _nul. My guess is that if you use nil the system may mix the orginal meaning of nil. Share this post Link to post Share on other sites
celery 8 Posted January 30, 2011 I did a test and nil does indeed seem to change instead of staying as nil. Share this post Link to post Share on other sites
xeno 230 Posted January 30, 2011 If you create a global variable nil, either by assigning a script handle to it or another value, you "overwrite" the engine nil. Now if you want to mark a variable for the VM to be collected with nil, for example somearray = nil, you assign the script handle to somearray. An isNil "somearray" check will then always return false as somearray points to the scripthandle, means it isn't nil and you can't nilify a variable anymore. The same is true for player. player = 0 will create a global variable called player. If you use player in a script the global variable with value 0 is used instead of the engine player reference. Xeno Share this post Link to post Share on other sites
galzohar 31 Posted January 30, 2011 Yeah basically any engine variable will get messed up when you assign a new value for it, so you should avoid it in order to not break scripts that might use that variable. Share this post Link to post Share on other sites