Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: And yet another n00b question: blow up gas can to start a fire right there?  (Read 1400 times)

0 Members and 1 Guest are viewing this topic.

Offline Zadaki_L

  • *
  • +1% chance to make useful post
  • Zadaki_L has no influence.
I'm trying to get the player to collect notebooks and burn them to keep sensitive data out of enemy hands. In light of this, I'd like the player to pick up a flammable object (such as a gas can) and move it to an appropriate place (such as the street) and set it on fire. An env_fire starts where the gas can exploded, and the player throws the prop_physics books ("models\props_lab\binderbluelabel.mdl" etc.) into the fire, which then ignite and are killed, triggering the islived which allows the player to successfully escape and continue to the next level.

I can get the env_fire to follow around the gas can with setparent, but when the gas can explodes, it kills it's children entities.

I thought about using an OnDamaged trigger on the gas can to send a ClearParent input to the env_fire, but that would cause problems if the player was carrying the gas can and it was damaged by a stray bullet from an npc, causing a fire to start in midair where the gas can isn't.

I could just make the gas can nonmobile, and use that position for the fire, and for the touchname trigger that ignites and kills the books... but that seems like cheating. Why wouldn't the player be able to pick up a gas can?  I could use a large, immobile propane tank but they don't take damage, so I'm not sure how to get them to ignite with a gunshot or something.

I'd appreciate any ideas. Thanks!


Offline Zadaki_L

  • *
  • +1% chance to make useful post
  • Zadaki_L has no influence.
Re: And yet another n00b question: blow up gas can to start a fire right there?
« Reply #1 on: September 26, 2013, 03:59:39 AM »
So no ideas on this one?

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: And yet another n00b question: blow up gas can to start a fire right there?
« Reply #2 on: September 26, 2013, 05:04:21 AM »
send clearparent input on death.

Offline Zadaki_L

  • *
  • +1% chance to make useful post
  • Zadaki_L has no influence.
Re: And yet another n00b question: blow up gas can to start a fire right there?
« Reply #3 on: September 26, 2013, 11:26:15 AM »
send clearparent input on death.

I tried that, but the child entity seemed to be killed before the clearparent input could be sent.

[Oops edit!]I tried doing an OnDamaged output to send the ClearParent to the env_fire, but the problem was when a gunshot hit it when it wasn't resting on the ground.[/edit]

And then the fire seemed to be spawning somewhat above the ground, especially if the player was carrying the gas can at the time (which should totally kill the player actually, solving that problem).
« Last Edit: October 03, 2013, 03:11:13 AM by Zadaki_L »

Offline Zadaki_L

  • *
  • +1% chance to make useful post
  • Zadaki_L has no influence.
I ended up instead putting a stove in a kitchen instead. Now, I just need to figure out how to add a func_button to turn on the gas and another to add a spark like the Ravenholm traps.