Thread calling

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Thread calling

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Yay!

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes both right, like mohaa_rox said:

waitthread global/items.scr::add_item
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Sorry then. I must have misread the post again. :oops: But he's right alright.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

?

Post by Rookie One.pl »

But is it right (in map script):
thread global/hostage.scr::follow_disable
:?:
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: ?

Post by jv_map »

Rookie One wrote:But is it right (in map script):
thread global/hostage.scr::follow_disable
:?:
Yup 8)
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

:)

Post by Rookie One.pl »

Thanks 8)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

hostage.scr? :?:
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Yeah that looks like ......... wow.
Post Reply