Page 1 of 2

Setting dead players on fire

Posted: Thu Sep 04, 2003 11:53 pm
by tltrude
In the Elite Force 2 map I am converting to Mohaa there is a new type of function entity called "func_explodeobject" and it seem to work in mohaa.

Anyway, I have a window set with it that explodes when players break it. There is a setthread that sets off a hall fire model and kills the player, but I would like the player's body to burn untill it vanishes. The problem is that the fire appears where the player died (on the healthpack) and not on the body. Any help would be great!

Code: Select all

//*** --------------------------------------------
//*** "Gas Window threads"
//*** --------------------------------------------

gas_window:
	
	wait .2
	$gas_window_fire anim start
	iprintln "GAS! GAS! GAS!"
	wait .2
	local.nothappy = parm.other
	local.fire = spawn script_model angle "-1"
	local.fire model "emitters/firegood.tik"
	local.fire.origin = local.nothappy.origin + (0 0 24)
	local.fire.scale = .75
	local.nothappy damage local.nothappy 110 local.nothappy (0 0 0) (0 0 0) (0 0 0) 1 2 6 0
	$gas_killer1 remove // trigger in front of window
	wait 10
	local.fire remove
	thread gaskill  // gas leak inside the window room
end

gaskill:

while (1)
	{
	wait 1
	radiusdamage $gas_killer2.origin 20 48
	}
	waitframe

end
If anyone has the game "Elite Force 2" I could sure use the .cpp file (code folder file) for the func_explodeobject--because I have no idea what the spawnflags for it do.

Posted: Fri Sep 05, 2003 2:33 am
by Alcoholic
The origin of the player is at his feet, so maybe you should try putting the fire in the chestal area. Try adding these lines:

Code: Select all

local.where = local.nothappy gettagposition "Bip01 Spine2"
local.fire.origin = local.where

spine2

Posted: Fri Sep 05, 2003 7:08 am
by tltrude
I already added 24 units on the Z axis to bring it up off the floor. Using your lines just moves the fire to where the players back was when he died.



Image

There is a code for making it stick with the player at death:

local.fire.detach_at_death = 0

But, using it makes the fire stay with the player when he respawns, and not on the body. A player can respawn before his dead body vanishes, which is how I took the screenshot by the way. I guess what I need is the targetname the game assigns to the body, or a way to leave the fire behind when the player respawns.

Posted: Fri Sep 05, 2003 2:40 pm
by bdbodger
what about this ?

local.fire attach local.nothappy "Bip01 Spine2"

I did a map where I attached JV's avatar to a dogs head this way . When the dog died the avatar disappeared a few seconds after the body.

no fire

Posted: Fri Sep 05, 2003 3:29 pm
by tltrude
That didn't work at all because the fire did not even show up.

Code: Select all

//*** --------------------------------------------
//*** "Gass Window threads"
//*** --------------------------------------------

gas_window:
	
	wait .2
	$gas_window_fire anim start
	iprintln "GAS! GAS! GAS!"
	wait .2
	local.nothappy = parm.other
	if (local.nothappy istouching $gas_killer1)
	{
		local.fire = spawn script_model angle "-1"
		local.fire model "emitters/firegood.tik"
		//local.where = local.nothappy gettagposition "Bip01 Spine2" 
		//local.fire.origin = local.where
		//local.fire.origin = local.nothappy.origin + (0 0 24)
		local.fire attach local.nothappy "Bip01 Spine2"
		local.fire.scale = .75
		//local.fire.detach_at_death = 0
		local.nothappy damage local.nothappy 110 local.nothappy (0 0 0) (0 0 0) (0 0 0) 1 2 6 0
		$gas_killer1 remove
		wait 9.5
		local.fire remove
	}
	thread gaskill
end

gaskill:

while (1)
	{
	wait 1
	radiusdamage $gas_killer2.origin 20 48
	}
	waitframe

end

Posted: Fri Sep 05, 2003 11:42 pm
by nuggets
have you tried vectoring the angles and then moving up the height of the body required?

Posted: Sat Sep 06, 2003 12:00 am
by Alcoholic
so basically, you want it to stay on the dead guy's back?

Posted: Sat Sep 06, 2003 12:38 am
by tltrude
nuggets - How do I vector the angles to the body if I don't know the targetname for it? The body does not always fall the same direction, but I can get the fire at the right height above the floor.


Alcoholic - Yes, I want it to look like he was set on fire by the (hall fire) explosion.

Posted: Sat Sep 06, 2003 2:59 am
by Alcoholic
Try to make your own sort of "glue" or "bind". In your gas_window thread add this:

Code: Select all

local.nothappy thread fire_glue local.fire
And have your fire_glue thread like this:

Code: Select all

fire_glue local.fire:

local.starttime = level.time
local.stoptime = (level.time + 4)

while (1)
{
     waitframe
     if (isalive self) //player respawned
     {
          end
     }

     if (level.time >= local.stoptime) //if its been 4 seconds
     {
          end
          //we stop because i dont think any death anims last 4 seconds...
     }

     local.where = self gettagposition "Bip01 Spine2"
     local.fire.origin = local.where.origin
}
end

Posted: Sat Sep 06, 2003 3:55 pm
by bdbodger
Alcoholic's way is probably the best . I was wrong anyway the avatars didn't dissapear I removed them after death . I had a simular problem with binding a trigger only way seemed to be to just keep moveing the trigger binding or glueing didn't work too well .

respawn

Posted: Sun Sep 07, 2003 12:03 am
by tltrude
That's fine, but I wanted the fire to stay with the body and not vanish when the player respawns. A body will last about 8-10 seconds after a player dies.

The map is almost done, so I may have to scrap the whole idea.

EF2 Axis Station
Image

Posted: Sun Sep 07, 2003 3:39 pm
by bdbodger
Maybe if you do this

fire_glue local.fire:
while (isalive self)
{
waitframe
local.where = self gettagposition "Bip01 Spine2"
local.fire.origin = local.where.origin
}
waitframe
local.fire droptofloor // I have never tried this but may work
wait 10
local.fire remove
end

the thread will end leaveing the local.fire on the floor at the last origin of the player

Posted: Mon Sep 08, 2003 12:10 am
by nuggets
while !(isalive self)
{local.fire.angles = (vector_toangles (self.origin - attacker.origin))}

Posted: Mon Sep 08, 2003 2:38 am
by Alcoholic
Ugh, time to get lost in vector maths. :roll:

Wahoo!

Posted: Wed Sep 10, 2003 9:50 pm
by tltrude
Local Nothappy is happy now! I got it working by adding a wait--so that the death animation can finish before the fire is spawned.

Image

Here is the threads, if anyone else want to use them. This "body-on-fire" could also be used for a high voltage electrocution thread or anything that uses fire to kill.

Code: Select all

//*** --------------------------------------------
//*** "Gass Window threads"
//*** --------------------------------------------

gas_window:
	
	wait .2
	$gas_window_fire anim start
	iprintln "GAS! GAS! GAS!"
	wait .2
	local.nothappy = parm.other
	if (local.nothappy istouching $gas_killer1)
	{
		local.nothappy damage local.nothappy 120 local.nothappy (0 0 0) (0 0 0) (0 0 0) 1 2 6 0
		wait 1
		local.fire = spawn script_model angle "-1"
		local.fire model "emitters/firegood.tik"
		local.fire.scale = .75 
		local.fire.origin = local.nothappy.origin + (0 0 16)
		local.player = parm.other
		$gas_killer1 remove
		wait 9.5
		local.fire remove
		$gas_window_fire remove
	}
	thread gaskill
end

gaskill:

while (1)
	{
	wait 1
	radiusdamage $gas_killer2.origin 20 48
	}
	waitframe

end