Env flare: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(raw; needs cleanup)
 
No edit summary
 
(39 intermediate revisions by 21 users not shown)
Line 1: Line 1:
{{cleanup}}
{{LanguageBar}}
env_flare
{{CD|CFlare|file1=weapon_flaregun.cpp}}
[[File:env_flare.jpg|thumb|300px|right|A flare at the beginning of {{ent|d2_prison_08}}.]]
{{this is a|model entity|game=Half-Life 2 series|name=env_flare}} Creates a red flare. Useful for creating a dark environment with just enough light to navigate. The flickering red light of the flare creates a tense atmosphere and a strong feeling of fight-or-die.


Flare
{{tip|To make flares like the ones seen in Episode One, create a {{ent|prop_physics}} with the model <code>props_junk/flare.mdl</code>. The rest (activation, burning, etc) is handled automatically. Note that this model was only added in Episode One.}}


KEYS
{{note|<code>CFlare</code> inherits {{ent|CBaseCombatCharacter}}, so it can have [[relationships]] defined.}}


Name targetname <target_source> The name that other entities refer to this entity by.
<!-- {{stray ent|}} -->


Parent parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
==Keyvalues==
{{KV Targetname}}
{{KV|Scale|intn=scale|float|Multiplier for the signal particle effects (not light emitted).}}
{{KV|Duration|intn=duration|float|deprecated=1|How long the flare is active for. Defined, but not used in code. Use the <code>Start</code> input instead.}}
{{KV BaseCombatCharacter}}


Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
==Flags==
{{fl|1|No [[dlight]] (Emit no light. Will probably look unrealistic.)}}
{{fl|2|No Smoke}}
{{fl|4|Infinite (perpetually activated)}}
{{fl|8|Start off}}


Scale scale <float>
==Inputs==
{{I|Start|param=float|Make flare active for a specified number of seconds. Flare will be removed from the map after dying.}}
{{I|Die|param=float|Make flare fizzle out over a specified number of seconds. Once dead, it is removed from the map.}}
{{I|Launch|param=float|Launch the flare forward with the specified speed. The direction of travel is determined by the '''Pitch Yaw Roll''' keyvalue.}}
{{I BaseCombatCharacter}}


Duration duration <float>
==See also==
* {{ent|weapon_flaregun}}


spawnflags spawnflags <flags>
[[Category:Abstract Mapping]]
 
[[Category:Special effects]]
 
[[Category:Lighting]]
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetParent <string> Changes the entity's parent in the movement hierarchy.
 
SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
ClearParent Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
Start <float> Start
 
Die <float> Die
 
Launch <float> Launch the flare forward with the specified speed.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.

Latest revision as of 10:45, 26 June 2025

English (en)Translate (Translate)
C++ Class hierarchy
CFlare
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ weapon_flaregun.cpp
A flare at the beginning of d2_prison_08.

env_flare is a model entity available in Half-Life 2 series Half-Life 2 series. Creates a red flare. Useful for creating a dark environment with just enough light to navigate. The flickering red light of the flare creates a tense atmosphere and a strong feeling of fight-or-die.

Tip.pngTip:To make flares like the ones seen in Episode One, create a prop_physics with the model props_junk/flare.mdl. The rest (activation, burning, etc) is handled automatically. Note that this model was only added in Episode One.
Note.pngNote:CFlare inherits CBaseCombatCharacter, so it can have relationships defined.


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

Scale (scale) <float>
Multiplier for the signal particle effects (not light emitted).
Duration (duration) <float> Obsolete
Deprecated.
How long the flare is active for. Defined, but not used in code. Use the Start input instead.

CBaseCombatCharacter:

Relationship (Relationship) <string> !FGD
<string|targetname or classname> <string|disposition> <int|rank>
Changes whether this entity likes or dislikes certain other things. Used like the ai_relationship entity, with this entity as the subject.
Values for disposition are:
  • D_HT: Hate
  • D_FR: Fear
  • D_LI: Like
  • D_NU: Neutral
Physics Impact Damage Scale (physdamagescale) <float>
Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.

Flags

No dlight (Emit no light. Will probably look unrealistic.) : [1]
No Smoke : [2]
Infinite (perpetually activated) : [4]
Start off : [8]

Inputs

Start <floatRedirectInput/float>
Make flare active for a specified number of seconds. Flare will be removed from the map after dying.
Die <floatRedirectInput/float>
Make flare fizzle out over a specified number of seconds. Once dead, it is removed from the map.
Launch <floatRedirectInput/float>
Launch the flare forward with the specified speed. The direction of travel is determined by the Pitch Yaw Roll keyvalue.

CBaseCombatCharacter:

KilledNPC  !FGD
Tells the entity it killed something. Despite the name, this can include a player. This input will be automatically sent by the victim when they die.
physdamagescale <floatRedirectInput/float>
Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.

See also