env_weaponfire

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)
... Icon-Important.png
class hierarchy
CEnvWeaponfire
CPointEntity
CBaseEntity

env_weaponfire is a point entity available in the following Source Source games or engine branches:
Left 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.
Blank image.pngTodo: 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 endity 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.

Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.

Angles:
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.

EnableDisable:

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.