Yes.
Local variables are only defined within threads (ie. between a label and the 'end' command). However they can be passed on as arguments to other threads. The 'end' command actually 'deletes' the scriptthread (since it's a class and it has to be "spawned", so to speak.) And also uninitializes all local variables. Since local variables are in fact 'properties' of the scriptthread. Jv knows more about this and parm.previousthread.
Group variables are defined in threadgroups and do survive end commands. However if the end marks the last thread in the group then they get killed.
A threadgroup is this:
Code: Select all
main:
//blah...
level waittill prespawn
//blah...
level waittill spawn
thread mythread1
end
mythread1:
group.var = 1
println group.var
thread anotherthread
end
anotherthread:
println group.var
end // the group of threads ends here since no other thread gets activated.
Even multiple activated threads are all part of a group:
Code: Select all
mythread:
group.var = "lol"
println group.var
thread t1
thread t2
end
t1:
println group.var
end
t2:
println group.var
thread t3
end
t3:
println group.var
end
Level variables as the name suggests are 'levelwide'. Meaning they get 'killed' when the round/map ends.
Game vars are map-persistent (in regular cases, for some reason roundrestarts and maprestarts kill them) meaning game.var = 1 in mohdm1 will stay 1 when the map changes to mohdm2. However this only works for simple values such as arrays, integers, floats, strings...