Spawn a trigger_hurt after an event?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Spawn a trigger_hurt after an event?

Post by Waylander76 »

Is it possible to spawn a trigger_hurt or any sort of trigger that will hurt the player after an event has happened?

Basically i've created an OBJ map where the allies have to steal some docs and launch a V2. The V2 moves to over a launch pit, there there is a fire effect and the V2 takes off.
What I want is a way to hurt the player if he is in the V2 launch pit under
the flames.

This would only happen after the flames have started.

I don't mind if it has to be done in Radiant or scripted.

Any ideas anyone?

Thanks
@(...:.:...)@
Corporal
Posts: 37
Joined: Wed Nov 23, 2005 3:42 pm
Location: Cambridge UK

Post by @(...:.:...)@ »

Hi,

I would make it a mixture of both, but you could do it purely with scripting.

Radiant & script would be easiest. Ok, do it like this:

1) Make your trigger hurt in radiant. In the entity options thing, setup the damage type and amount. Also set a targetname of whatever you want. eg

targetname
firehurt

Ok, then compile your map etc etc.

Now, in your map script, put this line under wait till prespawn:

Code: Select all

$firehurt nottriggerable
That will mean the trigger cannot be triggered, so it won't hurt anyone.

Now, go to the section of your script which makes the fire appear, and the rocket take off. Put this line where the fire appears:

Code: Select all

$firehurt triggerable
That will make the trigger triggerable so that it can hurt people.

I don't know how your script works with the fire, but if you have a set delay of say 10 seconds, then the flames are removed; put the nottriggerable line where the flames are removed.

Code: Select all

$firehurt nottriggerable
If the flames just disappear by themself, you could do this:

Instead of the

Code: Select all

$firehurt triggerable
line, start a thread instead:

Code: Select all

thread firehurt
The thread firehurt should be like this:

Code: Select all

firehurt:
$firehurt triggerable
wait 10  //wait until the fire has gone
$firehurt nottriggerable
//or you could just remove it if you don't need it again
//$firehurt remove
end
Cya
Image

<3 arrays.
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

exactly what I wanted! thanks!
@(...:.:...)@
Corporal
Posts: 37
Joined: Wed Nov 23, 2005 3:42 pm
Location: Cambridge UK

Post by @(...:.:...)@ »

Any time. 8-)
Image

<3 arrays.
Post Reply