This article's documentation is for anything that uses the Source engine. Click here for more information.

Env fire: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
 
(72 intermediate revisions by 38 users not shown)
Line 1: Line 1:
A point entity that creates a flame on your map.
{{lang|title=env_fire}}


{{this is a|point entity|name=env_fire|sprite=1}} It handles a single flame ({{ent|_firesmoke}}) at its [[origin]]. The flame causes heat "damage" to other <code>env_fire</code> entities around it and will eventually ignite them, causing the fire to spread. {{ent|env_firesource}} will add heat damage to nearby <code>env_fire</code> entities and ignite them/maintain ignition.
[[File:env_fire_modern.png|thumb|200px|right|The modern, particle-based <code>env_fire</code> effects.]]
[[File:env_fire_classic.png|thumb|200px|right|The classic, sprite-based <code>env_fire</code> effects.]]
Prior to the Orange Box, fire had a different effect made up of sprites generated dynamically through code instead of a particle system. The modern effects are defined in a [[PCF]] file, meaning they can be customized without code modifications, but they are far less dynamic than the classic effects, having only four premade sizes and no ability to set the attack/grow time through Hammer. All of Valve's games were updated or later shipped with only the particle-based fire effects, but the classic fire was eventually reimplemented as a setting in the {{hl2|2}} 20th Anniversary Update. Many of the settings on this entity were designed with only the classic fire in mind, so it is documented here.


== Key Values ==
{{note|The fire may fall through the world on spawn if placed exactly at ground level. Place it a little bit above the ground to fix this, or enable the "don't drop" spawnflag.}}
{{bug*|While still available, it does not have particle effects in {{portal|2}} or {{tf2|2}}. See [[Portal:Env Fire fix]] and [[TF2/Creating fire]] for fixes/workarounds.}}
{{CD|CFire|file1=fire.cpp}}
==Keyvalues==
{{KV Targetname}}
{{KV|Duration|intn=health|integer|Amount of time the fire will burn.}}
{{KV|Size|intn=firesize|integer|Height (in world units) of the flame.}}
{{note|While still affecting the hitbox normally, the modern particle-based fire only visually supports four preset sizes corresponding to specific ranges:
* <code>35</code> or less: tiny
* <code>36-71</code>: small
* <code>72-107</code>: medium
* <code>108</code> or greater: large}}
{{KV|Attack|intn=fireattack|integer|Amount of time the fire takes to grow to full strength.}}
{{note|Has no visual effect for modern particle-based fire (the hitbox is still affected though).}}
{{KV|Type|intn=firetype|choices|Either Natural or Plasma. Natural is a general all purpose flame, like a wood fire.
:*0: Natural
:*1: Plasma {{bug*|Doesn't work. Code for the plasma effect does exist in the SDK, however.}}}}
{{KV|Ignition Point|intn=ignitionpoint|float|Amount of heat 'damage' to take before this flame should ignite.}}
{{KV|Damage Scale|intn=damagescale|float|Multiplier of the burn damage done by the flame.}}
{{KV|Light Color|intn=LightColor|since=AS|color255|Color of dynamic light for this fire.}}
{{KV|Light Radius Scale|intn=LightRadiusScale|since=AS|float|Multiplier for the glow radius.}}
{{KV|Light Brightness|intn=LightBrightness|since=AS|integer|Integer exponent for the glow brightness.}}
{{KV|Loop sound|intn=LoopSound|since=AS|sound|Looping sound to play while this fire is burning.}}
{{KV|Ignite sound|intn=IgniteSound|since=AS|sound|One shot sound to play when the fire starts.}}
{{KV|Start Disabled|intn=StartDisabled|deprecated=1|boolean|Stay dormant until activated. Doesn't work, use "start on" flag instead.}}


'''Name''' The name that other entities refer to this entity by.
==Flags==
{{fl|1|Infinite Duration}}{{note|In Alien Swarm, an <code>env_fire</code> cannot be extinguished with the fire extinguisher unless ''Infinite Duration'' is set.}}
{{fl|2|Smokeless}}
{{fl|4|Start On}}
{{fl|8|Start Full}} {{confirm|Makes the classic fire effects start at full size instead of growing?}}
{{fl|16|Don't drop}}
{{fl|32|No glow}}
{{fl|128|Delete when out}}
{{fl|256|Visible from above|removed={{AS}}}} {{note|Has no effect for modern particle-based fire, which is always visible from above.}}
{{fl|256|No sound|since=AS}}
{{fl|512|No ignite sound|since=AS}}
{{fl|1024|No fueling once lit|since=AS}}
{{fl|2048|Fast burn think|since=AS}}


'''Parent''' The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
==Inputs==
{{I|StartFire|Start the fire.}}
{{I|Extinguish|param=float|Puts out the fire permanently in the number of seconds specified.}}
{{I|ExtinguishTemporary|param=float|Puts out the fire temporarily in the number of seconds specified.}}
{{I EnableDisable}}


'''Start Disabled''' If yes It doesn't start burning untill it is triggered.
==Outputs==
{{O|OnIgnited|Fires when the fire is first ignited.}}
{{O|OnExtinguished|Fires when the fire is fully extinguished.}}


'''Duration''' Amount of time the fire will burn(in seconds).
==ConVars/Commands==
{{varcom|start}}
{{varcom|fire_maxabsorb|50|Arbitrary number ([[float]])|Upper limit for how much heat "damage" a fire can take before the damage begins to force the flame to grow. Heat is usually absorbed from other <code>env_fire</code>s.}}
{{varcom|fire_absorbrate|3|Multiplier ([[float]])|Scalar for how fast fires can absorb heat.}}
{{varcom|fire_extscale|12|Multiplier ([[float]])|Effectively only a scalar for the '''Strength''' of an {{ent|env_extinguisherjet}}.}}
{{varcom|fire_extabsorb|5|Multiplier ([[float]])}}
{{varcom|fire_heatscale|1.0|Multiplier ([[float]])|Scalar for how much damage a fire can do (both to fires and other objects such as the player).}}
{{varcom|fire_incomingheatscale|0.1|Multiplier ([[float]])|Scalar for how much heat a fire can take from other fires if it is already ignited.}}
{{varcom|fire_dmgscale|0.1|Multiplier ([[float]])}}
{{varcom|fire_dmgbase|1|Health Amount|Base damage that a fire does to objects such as the player. This amount multiplies depending on the user's difficulty setting:{{skill|x1|x2|x3}}}}
{{varcom|fire_growthrate|1.0|Multiplier ([[float]])|Scalar for how much heat a fire can passively add to itself at once. [[Think]]ing interval is 0.1 seconds.}}
{{varcom|fire_dmginterval|1.0|Seconds|Once a fire has damaged something, it will wait this long before it can damage anything again.}}
{{varcom|r_classic_fire|0|[[integer]]|Use Classic Effects for Fire (Disabled/Classic/Release).{{Note|Classic and Release seems to be similar. Both enables classic fire effect.}}
}}
{{varcom|end}}


'''Size''' Height (in world units) of the flame. The flame will get proportionally wider as it gets higher.
[[Category:Special effects]]
 
'''Attack''' Amount of time the fire takes to grow to full strength. Set higher to make the flame build slowly.
 
'''Type''' Either Natural or Plasma. Natural is a general all purpose flame, like a wood fire.
 
'''Ignition Point''' Amount of heat 'damage' to take before this flame should ignite.
 
'''Damage Scale''' Multiplier of the burn damage done by the flame. Flames damage all the time, but can be made to hurt more. This number multiplies damage by 1(so 50 = 50 damage). It hurts every second.
 
== Flags ==
 
'''Infinite Duration''' Forces the flame to burn forever(unless removed).
 
'''Smokeless''' Just creates the flame, no smoke is given off
 
'''Start On''' As soon as the map loads the flame is enabled
 
'''Start Full''' Ignore the attack time and simply start fully built
 
'''Don't Drop''' Not quite sure, someone else fill this in :o
 
'''No Glow''' Turns off the light the flame gives off (a lickering orange dynamic light for natural).
 
'''Delete When Out''' Delete the entity all together when the flame goes out.

Latest revision as of 09:29, 24 April 2025

English (en)中文 (zh)Translate (Translate)
Env fire.png

env_fire is a point entity available in all Source Source games. It handles a single flame (_firesmoke) at its origin. The flame causes heat "damage" to other env_fire entities around it and will eventually ignite them, causing the fire to spread. env_firesource will add heat damage to nearby env_fire entities and ignite them/maintain ignition.

The modern, particle-based env_fire effects.
The classic, sprite-based env_fire effects.

Prior to the Orange Box, fire had a different effect made up of sprites generated dynamically through code instead of a particle system. The modern effects are defined in a PCF file, meaning they can be customized without code modifications, but they are far less dynamic than the classic effects, having only four premade sizes and no ability to set the attack/grow time through Hammer. All of Valve's games were updated or later shipped with only the particle-based fire effects, but the classic fire was eventually reimplemented as a setting in the Half-Life 2 Half-Life 2 20th Anniversary Update. Many of the settings on this entity were designed with only the classic fire in mind, so it is documented here.

Note.pngNote:The fire may fall through the world on spawn if placed exactly at ground level. Place it a little bit above the ground to fix this, or enable the "don't drop" spawnflag.
Icon-Bug.pngBug*:While still available, it does not have particle effects in Portal Portal or Team Fortress 2 Team Fortress 2. See Portal:Env Fire fix and TF2/Creating fire for fixes/workarounds.
C++ Class hierarchy
CFire
CBaseEntity
C++ fire.cpp

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Duration (health) <integer>
Amount of time the fire will burn.
Size (firesize) <integer>
Height (in world units) of the flame.
Note.pngNote:While still affecting the hitbox normally, the modern particle-based fire only visually supports four preset sizes corresponding to specific ranges:
  • 35 or less: tiny
  • 36-71: small
  • 72-107: medium
  • 108 or greater: large
Attack (fireattack) <integer>
Amount of time the fire takes to grow to full strength.
Note.pngNote:Has no visual effect for modern particle-based fire (the hitbox is still affected though).
Type (firetype) <choices>
Either Natural or Plasma. Natural is a general all purpose flame, like a wood fire.
  • 0: Natural
  • 1: Plasma
    Icon-Bug.pngBug*:Doesn't work. Code for the plasma effect does exist in the SDK, however.
Ignition Point (ignitionpoint) <float>
Amount of heat 'damage' to take before this flame should ignite.
Damage Scale (damagescale) <float>
Multiplier of the burn damage done by the flame.
Light Color (LightColor) <color255> (in all games since Alien Swarm)
Color of dynamic light for this fire.
Light Radius Scale (LightRadiusScale) <float> (in all games since Alien Swarm)
Multiplier for the glow radius.
Light Brightness (LightBrightness) <integer> (in all games since Alien Swarm)
Integer exponent for the glow brightness.
Loop sound (LoopSound) <sound> (in all games since Alien Swarm)
Looping sound to play while this fire is burning.
Ignite sound (IgniteSound) <sound> (in all games since Alien Swarm)
One shot sound to play when the fire starts.
Start Disabled (StartDisabled) <boolean> Obsolete
Deprecated.
Stay dormant until activated. Doesn't work, use "start on" flag instead.

Flags

Infinite Duration : [1]
Note.pngNote:In Alien Swarm, an env_fire cannot be extinguished with the fire extinguisher unless Infinite Duration is set.
Smokeless : [2]
Start On : [4]
Start Full : [8]
Confirm:Makes the classic fire effects start at full size instead of growing?
Don't drop : [16]
No glow : [32]
Delete when out : [128]
Visible from above : [256] (removed since Alien Swarm)
Note.pngNote:Has no effect for modern particle-based fire, which is always visible from above.
No sound : [256] (in all games since Alien Swarm)
No ignite sound : [512] (in all games since Alien Swarm)
No fueling once lit : [1024] (in all games since Alien Swarm)
Fast burn think : [2048] (in all games since Alien Swarm)

Inputs

StartFire
Start the fire.
Extinguish <floatRedirectInput/float>
Puts out the fire permanently in the number of seconds specified.
ExtinguishTemporary <floatRedirectInput/float>
Puts out the fire temporarily in the number of seconds specified.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnIgnited
Fires when the fire is first ignited.
OnExtinguished
Fires when the fire is fully extinguished.

ConVars/Commands

Cvar/Command Parameters or default value Descriptor Effect
fire_maxabsorb 50 Arbitrary number (float) Upper limit for how much heat "damage" a fire can take before the damage begins to force the flame to grow. Heat is usually absorbed from other env_fires.
fire_absorbrate 3 Multiplier (float) Scalar for how fast fires can absorb heat.
fire_extscale 12 Multiplier (float) Effectively only a scalar for the Strength of an env_extinguisherjet.
fire_extabsorb 5 Multiplier (float)
Todo: Effect description.
fire_heatscale 1.0 Multiplier (float) Scalar for how much damage a fire can do (both to fires and other objects such as the player).
fire_incomingheatscale 0.1 Multiplier (float) Scalar for how much heat a fire can take from other fires if it is already ignited.
fire_dmgscale 0.1 Multiplier (float)
Todo: Effect description.
fire_dmgbase 1 Health Amount Base damage that a fire does to objects such as the player. This amount multiplies depending on the user's difficulty setting:
  • Easy: x1
  • Normal: x2
  • Hard: x3
fire_growthrate 1.0 Multiplier (float) Scalar for how much heat a fire can passively add to itself at once. Thinking interval is 0.1 seconds.
fire_dmginterval 1.0 Seconds Once a fire has damaged something, it will wait this long before it can damage anything again.
r_classic_fire 0 integer Use Classic Effects for Fire (Disabled/Classic/Release).
Note.pngNote:Classic and Release seems to be similar. Both enables classic fire effect.