Page 1 of 1

how do i make the trigger work twice?

Posted: Thu Apr 15, 2004 9:52 pm
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

:(

Posted: Thu Apr 15, 2004 10:01 pm
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

Posted: Thu Apr 15, 2004 10:07 pm
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*

all confuzzled

Posted: Thu Apr 15, 2004 10:13 pm
by Elgan
count:S..never heard that before...

can u give me an example?:P

Posted: Thu Apr 15, 2004 11:31 pm
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

Posted: Fri Apr 16, 2004 1:23 am
by Elgan
i tried that before. but as does now using the code above it doesnt call the thread:S

Posted: Fri Apr 16, 2004 1:45 am
by nuggets
send me the .bsp and .scr files and i'll ahve a look for ya ;)

Posted: Fri Apr 16, 2004 2:02 am
by Elgan
lol omg. u sure?!. its for stalingrad..how do i send u ther script.soz. n00b

Posted: Fri Apr 16, 2004 2:09 am
by Elgan
can i add u to msn messenger?, i can send it tha way:P

Posted: Fri Apr 16, 2004 1:35 pm
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

hmmm

Posted: Fri Apr 16, 2004 2:46 pm
by tltrude
Well if the fire starts when the explosion finishes, the "thread burn_player" line should be after that in the script.

sorry

Posted: Fri Apr 16, 2004 5:16 pm
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

Posted: Sat Apr 17, 2004 10:07 am
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 .