Team Fortress 2/Creating fire

From Valve Developer Community
Jump to navigation Jump to search
Note.pngNote:The following method of creating fire effects has largely been replaced by the burning_torch entity introduced with Degroot Keep.

Team Fortress 2 doesn't fully support the env_fire entity used in other Source games; while the fire itself is simulated, the flames do not show up in-game. This article demonstrates how to create working fire in Team Fortress 2, similar to the torch fire used in Egypt.

The Torch

To begin, choose a prop to hold your fire. For this example, models/egypt/wall_torch/wall_torch.mdl is used.

Torch hammer.png

Creating The Flames

There are two different ways to create the visible flames for the fire: either using an env_smokestack or an info_particle_system.

Env_Smokestack

Egypt uses env_smokestacks to simulate flames and, while they do not look exactly the same as an env_fire flame, are a good substitute.

Insert an env_smokestack into your map and align it so that the origin is inside the cup of your torch.

You will need these properties:

  • Initial State: On
  • Spread At The Base: 0
  • Spread Speed: 8
  • Speed: 30
  • Particle Start Size: 9
  • Particle End Size: 4
  • Emission Rate: 15
  • Length Of Smoke Trail: 24
  • Wind X/Y Angle: 0
  • Wind Speed: 0
  • Particle Material: particle/smokesprites_0001
  • Twist: 10
  • Roll Speed: 5
  • Base Colour (R G B): 250 200 133
  • Translucency: 255
Tip.pngTip:Some values, specifically the Particle Start/End Sizes, Length Of Smoke Trail and Spread Speed, can be adjusted as needed to create different sizes of flames.

Info_Particle_System

Note.pngNote:This method is recommended only for small flames, since it borrows the effect used for burning Huntsman arrows. The flame itself is about 16 units high.

Insert an info_particle_system into your map and align it so that the origin is inside the cup of your torch.

You will need these properties:

  • Particle System Name: flaming_arrow
  • Start Active?: Yes

Glow

Note.pngNote:This is not the light that is cast by your fire; this is covered in the next section.

An env_sprite is used to simulate the glow of the fire at its base.

Insert an env_sprite into your map and align it so that its origin is at the same point as your env_smokestack or info_particle_system.

You will need these properties:

  • Render FX: Constant Glow
  • Render Mode: Additive
  • FX Amount (0 - 255): 125
  • FX Colour (R G B): 255 140 36
  • Framerate: 10
  • Sprite Name: materials/Sprites/light_glow03.vmt
  • Scale: 0.6
  • Size Of Glow Proxy Geometry: 30

Lighting

For your fire to cast light, you will need a light entity. Place this about 16-32 units forwards from your torch.

You will need these properties:

  • Name: torch_light
  • Brightness: 249 118 62 50 (Change this last number to suit your brightness needs)
  • Appearance: 32 (Yes, just type it in)
Todo: What significant difference does typing in the Appearance value make?

Because these lights have a flickering appearance, if you add a lot of them it may give VRAD errors when compiling your map. To solve this, give all of your torch lights the same name and they will all be calculated together at compile.

Trigger_Hurt

If the player stands on your fire they will need to be hurt by it. This is accomplished with a trigger_hurt.

Create a trigger brush of appropriate size for your fire (the size used in Egypt is 10 length X 10 width X 12 height). Tie the brush to a trigger_hurt and place it where your flame will be.

You will need these properties:

  • Damage Type: BURN
  • Damage: 10

Conclusion

That's it! You can now compile your map and the fire should show up in-game. In this screenshot, the torch on the left was made using an env_smokestack, while the one on the right was made with an info_particle_system.

Torches in-game.jpg

See Also

Team Fortress 2 Level Creation