About thread's

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Klaus
Sergeant
Posts: 64
Joined: Fri Jun 07, 2002 6:11 am
Location: Chile

About thread's

Post by Klaus »

Hi All :P

I am looking for any example using thread's , using on info_player allied or axis , on entity description on radiant (N) I see :

--------------------------------------------------------------------------------

Values:

=======

"angle" - the direction the player should face

"thread" - the thread that should be called when spawned at this position

"arena" - the arena that this start point is located in

--------------------------------------------------------------------------------

The description in red mark is my doubth , I need any example for make this type thread works .

Trigger teleport

In this trigger has the same thread option called teleportthread .

--------------------------------------------------------------------------------

Values:

=======

"key" The item needed to activate this. (default nothing)

"teleportthread" The thread that is run when the player is teleported

--------------------------------------------------------------------------------

Somebody have an idea to make both that threads work or example ???

Any Help is Welcome :wink:

Thanks

Klaus
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Re: About thread's

Post by Bjarne BZR »

Klaus wrote:"thread" - the thread that should be called when spawned at this position
If you set thread / look_a_spawning on the start entity:

Then the method with the label look_a_spawning will be called in a thread. This just means that the code of that method will be executed.

Such a method would look something like this:

Code: Select all

look_a_spawning:
    // Some cool code here
end
... and appear somewherre after the end of the main: method.
Klaus wrote:"teleportthread" The thread that is run when the player is teleported
If you set teleportthread / look_a_teleport on the trigger entity:

Then the method with the label look_a_teleport will be called in a thread.

Such a method would look something like this:

Code: Select all

look_a_teleport:
    // Some cool code here
end
... and appear somewherre after the end of the main: method.
Admin .MAP Forums
Image
Head above heels.
User avatar
Klaus
Sergeant
Posts: 64
Joined: Fri Jun 07, 2002 6:11 am
Location: Chile

Post by Klaus »

Hi Bjarne BZR

I tryed this method , but not work at his moment . :(
Please check my scripts :oops:

My info player entity on map :

Code: Select all

angle/90
classname/info_player_allied
origin/1242 35 97
thread/look_a_spawning
My thread on script :

Code: Select all

level waittill roundstart

end

look_a_spawning:

local.player=parm.other
if (local.player.dmteam == "allies")
{
local.player.model = models/player/allied_pilot.tik
}
thread look_a_spawning
end
This script worked when I used a trigger :D , but not yet on spawn :cry:

Thanks for Help

Klaus
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

In my experience thread and teleportthread don't work :(
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well, he is saying the spawn threading dosent work jv... but I seem to remember you telling me that it does not work either when I was experimenting with the Liberation game mode...
Admin .MAP Forums
Image
Head above heels.
User avatar
Klaus
Sergeant
Posts: 64
Joined: Fri Jun 07, 2002 6:11 am
Location: Chile

Post by Klaus »

Hi :P

Thanks guys for help me :wink: , well the only way is to use trigger multiple thread but this is reliable to use it on a server with 16 players per side ??? :roll:

Byes

Klaus
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well, depends on how you use it... if it is all over the map and calls a thread that does a lot of computation, it may be a problem.
Admin .MAP Forums
Image
Head above heels.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

put a trigger multiple at each spawn point

and have

spawned:
if ((parm.other.dmteam == "allies") && !(parm.other.triggered == 1))
parm.other model models/player/allied_pilot.tik
parm.other.triggered = 1

while (isAlive parm.other)
waitframe

parm.other.triggered = 0
hope this helps, prob not cos it's all foreign 2 me :-/
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Maby put a delay / 1 on the triggers to avoid a few unnessesary triggerings... but else I think there will be no probs.
Admin .MAP Forums
Image
Head above heels.
User avatar
Klaus
Sergeant
Posts: 64
Joined: Fri Jun 07, 2002 6:11 am
Location: Chile

Post by Klaus »

WoW thanks nuggets , I try using this script and work very well , and is more simple that mine , and I will try putting delay / 1 on trigger like info from Bjarne BZR 8-) .
Really thanks guys for support :P

Byes

Klaus
Image
Post Reply