how do i make the trigger work twice?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

how do i make the trigger work twice?

Post by Elgan »

hello
in stock map
i have an airstrike called by binoc's then it drops the bomb where u clicked wiht binoculars. it explodes on what it hits. if nothing then ur target.

fire is then left when the explosion finishes. if somoone walks into the fire. they catch alite and slowly burn to death.. this only works once. i want to get the fire bit working more then once thne maybe i can get the airstrike working many times 2.

Code: Select all

fire_hurt:
local.fire_hurt = spawn trigger_multiple 
local.fire_hurt.origin = $fire.origin
local.fire_hurt targetname fire_hurt
local.fire_hurt setsize ( -30 -30 -30 ) ( 30 30 30 )
$fire_hurt waittill trigger 
local.player=parm.other	
	
	local.fire2 = spawn script_model "targetname" "fire2"
	local.fire2 model "static/fire.tik"
	local.fire2.origin = local.player.origin
	local.fire2.scale = 1.0
	local.fire2 notsolid
	local.fire2 glue local.player
	thread burn_player
end

burn_player:
	local.fire_burn = spawn trigger_multiple "targetname" "burn_player"
	local.fire_burn.origin = $fire2.origin
	local.fire_burn targetname fire_burn
	local.fire_burn message "You Will Die Soon"
	local.fire_burn setsize ( -30 -30 -30 ) ( 30 30 30 )
	$fire_burn waittill trigger 
	$burn_player glue $fire2
	local.player=parm.other
	local.player hurt 10
	wait 1
	local.player hurt 20
	wait 1 //hurt them again because only 1 hurt works the 1 time:S
	local.player hurt 20
	wait 1
	local.player hurt 20
	wait 1
	local.player hurt 20
	wait 1
	local.player hurt 20
	$fire2 hide
end
thats the code i use. and the guy walks into the fire on the floor. the guy has fire spawn on him. then a trigger spawns on him making him die. then the fire hides. i used hide so maybe i could make it move to the next guy then re-apear..but then only 1 guy at a time can be on fire. any ideas?


do i use triggerable again?. this is my first ever script so i is a n00b.hehe. sorry
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

:(

Post by Elgan »

ok. no 1 seems to have a answer:(

if no does ill just make it so the fire omn the floor dissapears 2. so no fire after the guy dies
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well, the only thought i had was placing the key/values in the trigger...... but it might not work.

cnt - 32

because unless it's only used 32 times it would stop then, no more fire effects. it might work. *shrug*
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

all confuzzled

Post by Elgan »

count:S..never heard that before...

can u give me an example?:P
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Don't use waittill trigger instead make a thread and use the setthread key on the trigger to run the thread each time the trigger is triggered

burn_player:
local.fire_burn = spawn trigger_multiple "targetname" "burn_player"
local.fire_burn.origin = $fire2.origin
local.fire_burn targetname fire_burn
local.fire_burn message "You Will Die Soon"
local.fire_burn setsize ( -30 -30 -30 ) ( 30 30 30 )
$fire_burn.setthread = ouch
end

ouch:
local.player=parm.other
while(local.player istouching self)
{
local.player hurt 20
wait 2
}
end
Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

i tried that before. but as does now using the code above it doesnt call the thread:S
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 »

send me the .bsp and .scr files and i'll ahve a look for ya ;)
hope this helps, prob not cos it's all foreign 2 me :-/
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

lol omg. u sure?!. its for stalingrad..how do i send u ther script.soz. n00b
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

can i add u to msn messenger?, i can send it tha way:P
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

you still have to put

thread burn_player

in your script to start that thread or move that part of the script up to the main thread . Try this put it in the main thread at the top of your script .
The .... just means other lines that are in that thread already .

main:
....
....
....
....
thread burn_player
....
end
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

hmmm

Post by tltrude »

Well if the fire starts when the explosion finishes, the "thread burn_player" line should be after that in the script.
Tom Trude,

Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

sorry

Post by Elgan »

ok ok ok

i should of said last night. i got it working. but then my mum fou nd my up at 6am agfain so i whent to bed,, the reason it didnit work is....................................


burn_player:
local.fire_burn = spawn trigger_multiple "targetname" "burn_player"
local.fire_burn.origin = $fire2.origin
local.fire_burn targetname fire_burn
local.fire_burn message "You Will Die Soon"
local.fire_burn setsize ( -30 -30 -30 ) ( 30 30 30 )
$fire_burn.setthread = ouch <----------------THIS. i changed it to $fire_burn setthread ouch <-----------that and it worked fine...cheers:P
end

ouch:
local.player=parm.other
while(local.player istouching self)
{
local.player hurt 20
wait 2
}
end
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

ya thats what I ment :) . The burn player thread just makes the trigger it does not trigger it , so it does not matter when you run it as long as the trigger is where it is suppose to be when it is needed .
Image
Post Reply