env_gunfire

From Source Entities
Jump to navigation Jump to search

Code classes:

env_gunfire is a point entity present in all Source games. It creates a gunfire effect which can be dynamically controlled and pointed at a target, to give the illusion of a weapon firing without an actual weapon entity being used. This entity cannot cause damage in any games, except Csgo-small.png.

Note: In Csgo-small.png kills will be attributed to an automated sentry, regardless of player involvement. To do: Is there any possible method of circumventing this? Perhaps with VScript.

Note: Csgo-small.png be careful when targeting the env_gunfire classname with inputs, as this entity is used by danger zone turrets.

Tip: Valve often used this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for distant gunfire heard in Hl2.png City 17. (That is done through soundscapes.)

Keyvalues[edit | edit source]

Distribution patterns. Top is an even distribution, bottom is biased.
Target (target) <target_destination>
Entity will shoot at this target. Required.
Min Burst Size (minburstsize) <int>
Minimum number of shots in a burst of shots.
Max Burst Size (maxburstsize) <int>
Maximum number of shots in a burst of shots.
Min Delay Between Bursts (minburstdelay) <float>
Minimum delay between bursts in seconds.
Max Delay Between Bursts (maxburstdelay) <float>
Maximum delay between bursts in seconds.
Rate of fire (rateoffire) <float>
Number of bullets to fire per second. Not available in Csgo-small.png, but it can be emulated by adjusting the above keyvalues.
Bullet spread (spread) <int>
Bullets may deviate this far away in degrees, from shooting straight forward. Any number may be used.
Bullet distribution should be... (bias) <choices>
How to distribute bullets within the spread. Even distribution will shoot bullets nearly uniformly throughout the Bullet spread cone. Biased will avoid the middle and aim more along the outside of the cone.
  • 1: Evenly distributed
  • -1: Biased towards the outside
Collision detection (collisions) <choices>
Whether/how to handle bullet collision detection. If you select None, this entity will be very cheap to use, but all bullets will stop short at their target's position in space and there will be no impact effects. Normal collision detection does the same things NPCs do when they fire their guns (except harm anything). Not available in Csgo-small.png.
  • 0: None. Cheap performance.
  • 1: Normal collision detection.
Shoot Sound (shootsound) <sound>
Gun sound to make. Any sound name can be inserted, either as a filepath or a soundscript name. Not available in Csgo-small.png. (Default values are for Hl2.png.)
Tracer (tracertype) <string>
Type of tracer to display. See here for all usable effects. Note: This keyvalue expects a "temporary entity" effect, which is Source's older particle system predating info_particle_system (added in 2007). A comprehensive, up-to-date list of these effects does not exist for Tf2.pngL4d.pngL4d2-small.pngAsw.pngP2.pngCsgo-small.png (their effects are done with the newer system, of course), but they all have the default tracer available.
Literal value Description
Tracer Default
AR2TRACER AR2
Weapon (weaponname) <choices> (only available in Csgo-small.png)
Does particle effects and damage appropriate for a certain weapon. Weapons that aren't meant to be used and didn't have any notable effects were left out. Bug: Displays particle effects for silenced guns even though it shouldn't.
Literal Value Description
weapon_ak47 AK-47
weapon_aug AUG
weapon_awp AWP
weapon_bizon PP-Bizon
weapon_cz75a CZ75-Auto
weapon_deagle Desert Eagle
weapon_elite Dual Berettas
weapon_famas FAMAS
weapon_fiveseven Five-Seven
weapon_g3sg1 G3SG1
weapon_galil Galil (Old version from Css.png. Does nothing.)
weapon_galilar (Not in FGD) Galil AR
weapon_glock Glock-18
weapon_hkp2000 P2000
weapon_m249 M249
weapon_m4a1 M4A4
weapon_m4a1_silencer M4A1-S
weapon_mac10 MAC-10
weapon_mag7 MAG-7
weapon_mp5sd MP5-SD
weapon_mp7 MP7
weapon_mp9 MP9
weapon_negev Negev
weapon_nova Nova
weapon_p228 P228 (Unused weapon from Css.png. Does nothing.)
weapon_p250 P250
weapon_p90 P90
weapon_revolver R8 Revolver
weapon_sawedoff Sawed-Off
weapon_scar20 SCAR-20
weapon_sg556 SG 553
weapon_snowball (Not in FGD) Snowball (shots do little to no damage)
weapon_ssg08 SSG 08
weapon_tablet (Not in FGD) Tablet (shots kill instantly)
weapon_taser (Not in FGD) Zeus x27 (electric effects, max range 189 units)
weapon_tec9 Tec-9
weapon_ump45 UMP-45
weapon_usp USP (Old version from Css.png. Does nothing.)
weapon_usp_silencer USP-S
weapon_xm1014 XM1014
Start Disabled (StartDisabled) <boolean>
Stay inactive until Enabled.

Inputs[edit | edit source]

Enable
Makes the entity active.
Disable
Makes the entity inactive.

See Also[edit | edit source]