UltraProAnti
Newbie
- Joined
- Nov 22, 2004
- Messages
- 509
- Reaction score
- 0
OK, this might be tricky to explain.
You know that collapsing tower prefab in Hammer - the one where you blow up the wood parts and the metal parts topple over and the npc dies? What I'm trying to do is have a structure like that as the extension of a solid (non-breakable), and an npc up there who dies when the tower collapses while he's on it, but doesn't when he's standing on the solid unbreakable bit.
Now the solution to this isn't as obvious as you may think. In order for the npc to die 'properly', you need a logic_relay with a SetHealth output override parameter set to 0 (this is to guarantee the npc dies and becomes a ragdoll so the effect looks right - otherwise it just falls to the ground on to it's feet). However the SetHealth 0 output should only fire
IF the npc is standing on the platform when it blows up, and
IF the platform blows up
I've tried using a math_counter, with a max value of 2, and tried to output Add values corresponding to the two IF conditions (each with a value of 1, i.e. 1+1=2, where 2 is the max value which triggers the SetHealth 0 output) - but this doesn't seem to work.
Thing is, the explosion of the platform is an EVENT, which happens once, but whether or not the npc is on the solid or breakable bits is a STATE, which changes back and forth as the npc wanders from solid to breakable, so:
if explosion + npc on solid then do not kill npc
if explosion + npc on breakable then kill npc
if no explosion + npc on solid or on breakable then do not kill npc
Any suggestions about how to do this?
You know that collapsing tower prefab in Hammer - the one where you blow up the wood parts and the metal parts topple over and the npc dies? What I'm trying to do is have a structure like that as the extension of a solid (non-breakable), and an npc up there who dies when the tower collapses while he's on it, but doesn't when he's standing on the solid unbreakable bit.
Now the solution to this isn't as obvious as you may think. In order for the npc to die 'properly', you need a logic_relay with a SetHealth output override parameter set to 0 (this is to guarantee the npc dies and becomes a ragdoll so the effect looks right - otherwise it just falls to the ground on to it's feet). However the SetHealth 0 output should only fire
IF the npc is standing on the platform when it blows up, and
IF the platform blows up
I've tried using a math_counter, with a max value of 2, and tried to output Add values corresponding to the two IF conditions (each with a value of 1, i.e. 1+1=2, where 2 is the max value which triggers the SetHealth 0 output) - but this doesn't seem to work.
Thing is, the explosion of the platform is an EVENT, which happens once, but whether or not the npc is on the solid or breakable bits is a STATE, which changes back and forth as the npc wanders from solid to breakable, so:
if explosion + npc on solid then do not kill npc
if explosion + npc on breakable then kill npc
if no explosion + npc on solid or on breakable then do not kill npc
Any suggestions about how to do this?