This article relates to the game "Team Fortress 2". Click here for more information.

Creating fire

From Valve Developer Community
Jump to: navigation, search

English (en)한국어 (ko)
... Icon-Important.png

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.

Particle Fire

Default Particles

Insert an info_particle_system into your map and align it so that the origin where you want the base of the flame to appear, and make sure that the "Start Active?" property is set to "Yes". There are six flame particles available by default:

The six fire effects in order.
  • flaming_arrow — Used for Huntsman arrows that have been set on fire; this one includes very visible smoke that becomes fainter when approached closely. The fire in the fireplace in Mann Manor is made of a cluster of these.
  • candle_light1 — Used for the candles in Mann Manor and the lantern model.
  • candle_light2 — Used for the candles in Harvest Event. Skinnier than candle_light1.
  • m_torchflame — Used for the interior (wall-mounted) torches in Degroot Keep. Inlcudes faint smoke. Becomes more transparent when approached closely.
  • m_brazier_flame — Used for the exterior torches in Degroot Keep. Larger than m_torchflame but with the same basic qualities.
  • burning_torch — A taller, less chaotic torch flame with no smoke. Does not fade when approached. Has been around since well before the Medieval Update but was never officially used until late 2011, when it was used for the tiki torches in the underworld of Eyeaduct.

Custom Particles

Flaming barrel from ctf_fusion_b2.

The Swamp Pack created by TF2Maps.net includes a larger fire particle designed for flaming barrels, but which could be used for any larger fire such as campfires. To add this to your map, first download and install the Swamp Pack from this link (most of the assets from the pack were added to the game as part of the Scream Fortress update, but the particle effects were not). Then add an info_particle_system entity with the Particle System Name set to fire01 or fire01_heatwaver. (There appears to be no difference between the two.)

To make it work, create a second copy of the file swampmapname_particles.txt (in the /tf/maps/ folder) and replace "swampname" with the full filename of your map — for example, cp_swampland_a3_particles.txt.

You can also create your own fire particles using Team Fortress 2's tools mode. See Creating A Fire Particle for details.

The Egypt Method

Egypt, which was created before the burning_torch particle was available, uses env_smokestacks to simulate flames. This method is included for legacy purposes only.

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.

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. Here are properties used by Egypt's torches:

  • Name: torch_light
  • Brightness: 249 118 62 50 (Change this last number to suit your brightness needs)
  • Appearance: 32 (Yes, just type it in) - This makes the torch flicker

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

You may wish to have your fire damage players if they stand in your flames. 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

Igniting Players

If you have added a Trigger_Hurt, add the following output to it:

My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnHurtPlayer !activator IgnitePlayer 0 0.00 No

Otherwise create a Trigger_Multiple with the following output:

My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch !activator IgnitePlayer 0 0.00 No

Or use trigger_ignite.

Igniting Arrows

If you wish for Huntsman arrows to be ignited when a player comes near create a brush around your torch (Make sure the player can touch it without jumping) and tie it to trigger_ignite_arrows.

See also

Team Fortress 2 Level Creation