need help with all of those level and local variables

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

need help with all of those level and local variables

Post by erick »

does anyone know where a document is that explains all the level and local variables. :?
EX: What does level.elepos mean? I know that it is for checking elevator position but other than that i know nothing
Could someone help me :?:

<edit> And could someone post the ubersound work around global script?
I dont have it and the download link doesnt work anymore.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Code: Select all

thread1:

local.box = $box1

end

thread2:

local.box = $box2

end
In those two threads local.box is not the same entity because a "local" variable only has meaning inside the thread it is in if I had used

Code: Select all

thread1:

level.box = $box1

end

thread2:

level.box = $box2

end
then when thread1 runs level.box is $box1 but as soon as thread2 runs then level.box is then equal to $box2 a level variable can be used in any part of the script and it will have only one meaning unlike a local variable that can have different meanings in different threads outside of the thread you can't use it the script won't know what it is . If I try this

Code: Select all

thread1:

local.box = $box1

end

thread2:

if (local.box = $box1)

end
I will get an error that says that local.box is NIL or NULL in thread2
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Doc

Post by tltrude »

The document is named "Script Files.txt" and its in MOHAATools\docs. But, it is not very easy to read. There are scripting tutorials around.
Tom Trude,

Image
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

Post by erick »

thanks i will look at the document
thanks for the explanation bdbodger, it helped me understand the variable meanings
Post Reply