Question
Moderator: Moderators
- martijn_NL
- Map Reviewer
- Posts: 156
- Joined: Mon Apr 14, 2003 5:33 pm
- Location: The Netherlands
- Contact:
Question
What is the different between goto and thread?
this is what i think it is:
they are roughly about the same, and their use can be the same.
BUT
goto normally used in loops, like in a thread itself, if we wanna repeat that action over and over again, called a loop, we use goto threadname.
but thread can also be used, that's when i tried.
let's see what the others have to say.........
they are roughly about the same, and their use can be the same.
BUT
goto normally used in loops, like in a thread itself, if we wanna repeat that action over and over again, called a loop, we use goto threadname.
but thread can also be used, that's when i tried.
let's see what the others have to say.........
Live to map, not map to live.
-mohaa_rox, .map
moderator
-mohaa_rox, .map
moderator
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
goto will stop running the current thread
i.e
line 1
line 2
line 3
goto line 1
line 4
line 4 will never be reached, with thread however it'll still read the rest of the thread irrelevant of what else is happening,
if it's finding a variable (from the new thread being threaded) and needed in the next line
i.e
line 1
line 2
thread finder
if (level.dunno == blah blah blah
line 3
finder:
level.dunno = 1
end
you should always use waitthread, so the script will hold until the previous statement has been completed
i.e
line 1
line 2
line 3
goto line 1
line 4
line 4 will never be reached, with thread however it'll still read the rest of the thread irrelevant of what else is happening,
if it's finding a variable (from the new thread being threaded) and needed in the next line
i.e
line 1
line 2
thread finder
if (level.dunno == blah blah blah
line 3
finder:
level.dunno = 1
end
you should always use waitthread, so the script will hold until the previous statement has been completed
Last edited by nuggets on Fri Jun 27, 2003 5:43 pm, edited 1 time in total.
hope this helps, prob not cos it's all foreign 2 me :-/
- martijn_NL
- Map Reviewer
- Posts: 156
- Joined: Mon Apr 14, 2003 5:33 pm
- Location: The Netherlands
- Contact:
Goto Hell
jv_map hates goto, ha ha.
my_script:
$foulup_trigger waittill trigger
if (local.script == "bad")
{
goto hell
}
if (local.script == "good")
{
goto heaven
}
end
hell:
$myscript remove
end
heaven:
thread my_script
end
my_script:
$foulup_trigger waittill trigger
if (local.script == "bad")
{
goto hell
}
if (local.script == "good")
{
goto heaven
}
end
hell:
$myscript remove
end
heaven:
thread my_script
end

