Page 1 of 1

Thread calling

Posted: Tue Feb 04, 2003 1:04 pm
by Rookie One.pl
H! TH3R3,

Just wanted to ask: what's the difference between exec, thread and waitthread? I suppose that thread executes the thread in the same time, without stopping the script/object that calls that thread, and waitthread executes that thread, but stops the calling script until the thread has finished, is that right? Correct me if I'm wrong.

Rookie One

Posted: Tue Feb 04, 2003 1:32 pm
by mohaa_rox
I think exec is to execute some .scr, like missioncomplete, ai, weather, friendly etc.

Thread is used in scripts for like to store info seperately, for example, thread objectives, thread levelend etc.

Waitthread is used to add info, how do I say this, e.g, waitthread global/objectives.scr::add_objectives, waitthread global/items.scr::add_item.

Posted: Tue Feb 04, 2003 2:04 pm
by jv_map
Rookie one was right, you're certainly wrong rox.

You can call threads by using 'thread', which will be started as a seperate script process. 'Waitthread' runs the thread in the same process. Therefore, waitthread is better for performance and should be used whenever possible.

'exec' can only be used to execute other script files. 'waitexec' is the same as exec but waits till all threads in the executed script file have finished.

Yay!

Posted: Tue Feb 04, 2003 2:12 pm
by Rookie One.pl
Yay! I was right :D What a surprise :lol: I want to ask one more question. Can I execute a thread from another script file by thread command? Oh, I forgot - exec command executes main thread, is that right?

Rookie One

Posted: Tue Feb 04, 2003 2:14 pm
by jv_map
Yes both right, like mohaa_rox said:

waitthread global/items.scr::add_item

Posted: Tue Feb 04, 2003 2:14 pm
by mohaa_rox
Sorry then. I must have misread the post again. :oops: But he's right alright.

?

Posted: Tue Feb 04, 2003 2:23 pm
by Rookie One.pl
But is it right (in map script):
thread global/hostage.scr::follow_disable
:?:

Re: ?

Posted: Tue Feb 04, 2003 3:25 pm
by jv_map
Rookie One wrote:But is it right (in map script):
thread global/hostage.scr::follow_disable
:?:
Yup 8)

:)

Posted: Tue Feb 04, 2003 4:45 pm
by Rookie One.pl
Thanks 8)

Posted: Wed Feb 05, 2003 6:28 am
by mohaa_rox
hostage.scr? :?:

Posted: Wed Feb 05, 2003 2:19 pm
by small_sumo
Yeah that looks like ......... wow.