Env weaponfire: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(22 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{l4d series point|env_weaponfire}} This entity is used to mimic weapon fire from the guns in L4D. It does damage, muzzle flash, tracers, and impact effects. While it is great for intro cinematics, the entity is not 100% faithful to L4D weapon behavior (shots don't penetrate multiple zombies, for example). All effects are done client side, and so bandwidth usage is pretty low but it isn't perfectly in-sync with the server-side damage calculation.
{{LanguageBar}}{{CD|CEnvWeaponfire}}
{{this is a|point entity|name=env_weaponfire|game=Left 4 Dead series|game1=Postal III}} This entity is used to mimic weapon fire from the guns in L4D. It does damage, muzzle flash, tracers, and impact effects. While it is great for intro cinematics, the entity is not 100% faithful to L4D weapon behavior (shots don't penetrate multiple zombies, for example). All effects are done client side, and so bandwidth usage is pretty low but it isn't perfectly in-sync with the server-side damage calculation.
{{bug|This entity can't change the angle of itself in game! Either script or other ways are so. Once you specify the angle in Hammer and it will keep unchanged after compiling.}}
::{{todo|Find that there are other ways to change the angle.}}


==Keyvalues==
== Keyvalues ==
{{KV|Target Arc|intn=TargetArc|float|The arc that the entity will seach for targets (in degrees)}}
{{KV|Target Range|intn=TargetRange|float|The distance that the entity will search for targets (in inches)}}
{{KV|Target Filter|intn=filtername|filterclass|Filter to use to determine if an entity is a valid target}}
{{KV|Damage Modifier|intn=DamageMod|float|Used to increase or decrease the amount of damage per shot}}
{{KV|Weapon Type|intn=WeaponType|choices|Type of weapon for the effects}}
:* 1 : Assault Rifle
:* 2 : Hunting Rifle
:* 3 : Auto Shotgun
{{KV|Target Team|intn=TargetTeam|choices|Team to shoot at}}
:* 3 : Zombies
:* 2 : Survivors
:* -1 : Either
{{KV|Ignore Players|intn=IgnorePlayers|boolean|Setting this will make the bullets not harm players.}}
{{KV Targetname}}
{{KV Targetname}}
{{KV Parentname}}
Note: It seems that currently this entity does not work unless parented (to be confirmed)
{{KV Angles}}
{{KV Angles}}
{{KV EnableDisable}}
{{KV StartDisabled}}
*;Target Arc <code><[[float]]></code>
:The arc that the entity will seach for targets (in degrees)
*;Target Range <code><[[float]]></code>
:The distance that the entity will search for targets (in inches)
*;Target Filter <code><filterclass></code>
:Filter to use to determine if an entity is a valid target
*;Damage Modifier <code><[[float]]></code>
:Used to increase or decrease the amount of damage per shot
*;Weapon Type <code><choices></code>
:Assault Rifle, Hunting Rifle, or Auto Shotgun
*;Target Team <code><choices></code>
:Zombies, Survivors, or Both
*;Ignore Players <code><choices></code>
:Yes or No


==Inputs==
== Inputs ==
{{I Targetname}}
{{I Parentname}}
{{I EnableDisable}}
{{I EnableDisable}}
==Outputs==
{{O Targetname}}
==See also==
==External links==

Latest revision as of 07:47, 4 June 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CEnvWeaponfire
CPointEntity
CBaseEntity

env_weaponfire is a point entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series and Postal III Postal III. This entity is used to mimic weapon fire from the guns in L4D. It does damage, muzzle flash, tracers, and impact effects. While it is great for intro cinematics, the entity is not 100% faithful to L4D weapon behavior (shots don't penetrate multiple zombies, for example). All effects are done client side, and so bandwidth usage is pretty low but it isn't perfectly in-sync with the server-side damage calculation.

Icon-Bug.pngBug:This entity can't change the angle of itself in game! Either script or other ways are so. Once you specify the angle in Hammer and it will keep unchanged after compiling.  [todo tested in ?]
Todo: Find that there are other ways to change the angle.

Keyvalues

Target Arc (TargetArc) <float>
The arc that the entity will seach for targets (in degrees)
Target Range (TargetRange) <float>
The distance that the entity will search for targets (in inches)
Target Filter (filtername) <filter>
Filter to use to determine if an entity is a valid target
Damage Modifier (DamageMod) <float>
Used to increase or decrease the amount of damage per shot
Weapon Type (WeaponType) <choices>
Type of weapon for the effects
  • 1 : Assault Rifle
  • 2 : Hunting Rifle
  • 3 : Auto Shotgun
Target Team (TargetTeam) <choices>
Team to shoot at
  • 3 : Zombies
  • 2 : Survivors
  • -1 : Either
Ignore Players (IgnorePlayers) <boolean>
Setting this will make the bullets not harm players.
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

Pitch Yaw Roll (Y Z X) (angles) <QAngle>
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.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

EnableDisable:

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