De-targeting players

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

then if the trigger set a thread, we'd have to make that thread in the script, and it would have to somehow tell another thread that somebody is in it.. more complicated. :D
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 »

more complicated? that's the whole point of parm.other

it's using while istouching self, where self is the trigger... the reason u've just replied of if the trigger set a thread, is the way it's working with setthread loading the script
hope this helps, prob not cos it's all foreign 2 me :-/
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

I dunno, not much on this make sense to me, but it works. I think it was the parm.other and setaimtarget NULL which sorted it for me.

Bilko.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

parm.other sets the aimtarget to the player that triggers the trigger . The point of istouching is so that he remains the target until he is no longer touching the trigger because he has moved out of the area or has died otherwise when he respawns he will still be the aimtarget unless the aimtarget is reset to something else . One other thing you might do is to set a variable so that if another player enters the area the aimtarget is not reset until the first player dies or leaves . I know you don't need to keep resetting the aimtarget inside the loop but if the player is waiting to be targeted when the loop starts he will them become the aimtarget . The while loop will act like an if statement .

gunaimer:

local.guntarget=parm.other

while (level.gun1_has_target=1)
waitframe

level.gun1_has_target=1

while(local.guntarget istouching self)
$gun1 setaimtarget local.guntarget
.....
.....
}
level.gun1_has_target=0
$gun1 setaimtarget null

end
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 »

isalive checks on life, not istouching
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Yes and istouching checks that the player is still in the trigger area so that he is not the aimtarget when he is a spectator
Post Reply