Env gunfire: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 
 Note:In
Note:In  , damage is dealt according to the specified weapon (
, damage is dealt according to the specified weapon ( Confirm:No gunshot sounds are played.
 Confirm:No gunshot sounds are played.
 Placement Tip:Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through soundscapes.
Placement Tip:Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through soundscapes.
		
	
| Thunder4ik (talk | contribs) m (clean up, replaced: See Also → See also, {{ModernNote| → {{note|) | SirYodaJedi (talk | contribs)  | ||
| (9 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
| {{lang| | <!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}} | ||
| {{Ent not in fgd}} | |||
| {{CD|CEnvGunfire|file1=effects.cpp}} | |||
| [[File:gunfire.jpg|thumb|right|300px|A <code>env_gunfire</code> from multiple sides.]] | [[File:gunfire.jpg|thumb|right|300px|A <code>env_gunfire</code> from multiple sides.]] | ||
| {{entity|env_gunfire | {{this is a|point entity|name=env_gunfire}} 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 is only a visual/sound effect. No damage is done. | ||
| {{note|In {{csgo}}, damage is dealt according to the specified weapon (<code>weaponname</code>). If a player is killed, the kill feed shows "Automated Sentry" as the killer with a [[dronegun]] as kill icon. The killer information for the killed player shows his own profile picture with the red text "You were killed by the Automated Sentry". {{ModernConfirm|No gunshot sounds are played.}}}} | {{note|In {{csgo}}, damage is dealt according to the specified weapon (<code>weaponname</code>). If a player is killed, the kill feed shows "Automated Sentry" as the killer with a [[dronegun]] as kill icon. The killer information for the killed player shows his own profile picture with the red text "You were killed by the Automated Sentry". {{ModernConfirm|No gunshot sounds are played.}}}} | ||
| {{ModernPlacementTip|Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through [[soundscapes]].}} | {{ModernPlacementTip|Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through [[soundscapes]].}} | ||
| ==Keyvalues== | ==Keyvalues== | ||
| [[File:Gunfire distribution.png| | [[File:Gunfire distribution.png|256px|thumb|right|Distribution patterns. Top is an even distribution. Bottom is biased.]] | ||
| {{KV|Target  | {{KV Targetname}} | ||
| {{KV|Min Burst Size  | {{KV|Target|intn=target|target_destination|Shoot at this target.}} | ||
| {{KV|Max Burst Size  | {{KV|Min Burst Size|intn=minburstsize|int|Minimum number of rounds in a burst.}} | ||
| {{KV|Min Delay Between Bursts  | {{KV|Max Burst Size|intn=maxburstsize|int|Maximum number of rounds in a burst.}} | ||
| {{KV|Max Delay Between Bursts  | {{KV|Min Delay Between Bursts|intn=minburstdelay|float|Minimum delay between bursts in seconds.}} | ||
| {{KV|Rate of fire  | {{KV|Max Delay Between Bursts|intn=maxburstdelay|float|Maximum delay between bursts in seconds.}} | ||
| {{KV|Bullet spread  | {{KV|Rate of fire|intn=rateoffire|float|Number of bullets to fire per second.}} | ||
| {{KV|Bullet distribution should be...  | {{KV|Bullet spread|intn=spread|int|Bullets may deviate this far away in degrees from shooting straight forward. Any number may be used.{{inline note|name=Confirm - In {{css}} only 1/5/10/15 degrees can be used.}}}} | ||
| {{KV|Bullet distribution should be...|intn=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: Evenly distributed | ||
| :*-1: Biased towards the outside}} | :*-1: Biased towards the outside}} | ||
| {{KV|Collision detection  | {{KV|Collision detection|intn=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). | ||
| :*0: None. Cheap performance. | :*0: None. Cheap performance. | ||
| :*1: Normal collision detection.}} | :*1: Normal collision detection.}} | ||
| {{KV|Shoot Sound  | {{KV|Shoot Sound|intn=shootsound|string|Gunfire sound to make. Any sound name can be inserted, either as a filepath or a soundscript name.}} | ||
| :{| class=standard-table | :{| class=standard-table | ||
| ! Literal Value || Description | ! Literal Value || Description | ||
| Line 32: | Line 33: | ||
| | Weapon_SMG1.NPC_Single || SMG1 | | Weapon_SMG1.NPC_Single || SMG1 | ||
| |} | |} | ||
| {{KV|Tracer  | {{KV|Tracer|intn=tracertype|choices|Type of tracer to display. If not set, the default tracer will fire. See [[List of Client Effects]] for all usable effects.}} | ||
| :{| class=standard-table | :{| class=standard-table | ||
| ! Literal value || Description | ! Literal value || Description | ||
| Line 38: | Line 39: | ||
| | AR2TRACER || AR2 | | AR2TRACER || AR2 | ||
| |} | |} | ||
| {{KV|Weapon  | {{KV|Weapon|intn=weaponname|since=CSGO|choices|Sets all the effect settings to the ones for one gun. {{ModernConfirm|Do Shoot Sound, Collision detection, and Tracer still work in CSGO?}}}} | ||
| :{| class=standard-table | :{| class=standard-table | ||
| ! Literal Value !! Description | ! Literal Value !! Description | ||
| Line 106: | Line 107: | ||
| | weapon_m4a1_silencer || M4A1 Silencer | | weapon_m4a1_silencer || M4A1 Silencer | ||
| |} | |} | ||
| {{KV  | {{KV StartDisabled}} | ||
| ==Inputs== | ==Inputs== | ||
| {{I EnableDisable}} | {{I EnableDisable}} | ||
| ==See also== | ==See also== | ||
| *{{ent|env_muzzleflash}} | *{{ent|env_muzzleflash}} | ||
Latest revision as of 06:48, 4 June 2025

 
|  Class hierarchy | 
|---|
| CEnvGunfire | 
|  effects.cpp | 
env_gunfire  is a   point entity  available 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 is only a visual/sound effect. No damage is done.
 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 is only a visual/sound effect. No damage is done.
 Note:In
Note:In  , damage is dealt according to the specified weapon (
, damage is dealt according to the specified weapon (weaponname). If a player is killed, the kill feed shows "Automated Sentry" as the killer with a dronegun as kill icon. The killer information for the killed player shows his own profile picture with the red text "You were killed by the Automated Sentry".  Confirm:No gunshot sounds are played.
 Confirm:No gunshot sounds are played. Placement Tip:Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through soundscapes.
Placement Tip:Valve will often use this entity for its sound effects alone. This is handy for having gunfights overheard before an encounter starts. It is not, however, used for ambient gunfire heard throughout war-torn City 17. That is done through soundscapes.Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentnameortarget).
 Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Target (target) <targetname>
- Shoot at this target.
- Min Burst Size (minburstsize) <integer>
- Minimum number of rounds in a burst.
- Max Burst Size (maxburstsize) <integer>
- Maximum number of rounds in a burst.
- 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.
- Bullet spread (spread) <integer>
- Bullets may deviate this far away in degrees from shooting straight forward. Any number may be used.[Confirm - In  only 1/5/10/15 degrees can be used.] only 1/5/10/15 degrees can 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).
- 0: None. Cheap performance.
- 1: Normal collision detection.
 
- Shoot Sound (shootsound) <string>
- Gunfire sound to make. Any sound name can be inserted, either as a filepath or a soundscript name.
- Literal Value - Description - Weapon_AR2.NPC_Single - AR2 - Weapon_SMG1.NPC_Single - SMG1 
- Tracer (tracertype) <choices>
- Type of tracer to display. If not set, the default tracer will fire. See List of Client Effects for all usable effects.
- Literal value - Description - AR2TRACER - AR2 
- Weapon (weaponname)  <choices> (in all games since  ) )
- Sets all the effect settings to the ones for one gun.  Confirm:Do Shoot Sound, Collision detection, and Tracer still work in CSGO? Confirm:Do Shoot Sound, Collision detection, and Tracer still work in CSGO?
- Literal Value - Description - weapon_deagle - Deagle - weapon_elite - Elites - weapon_fiveseven - FiveSeven - weapon_glock - Glock - weapon_p228 - p228 - weapon_usp - USP - weapon_ak47 - AK47 - weapon_aug - Aug - weapon_awp - AWP - weapon_famas - Famas - weapon_g3sg1 - g3sg1 - weapon_galil - Galil - weapon_m249 - M249 - weapon_m4a1 - m4a4 - weapon_mac10 - Mac10 - weapon_p90 - P90 - weapon_ump45 - Ump45 - weapon_xm1014 - XM1014 - weapon_bizon - Bizon - weapon_mag7 - Mag7 - weapon_negev - Negev - weapon_sawedoff - Sawedoff - weapon_tec9 - Tec9 - weapon_mp7 - Mp7 - weapon_mp9 - Mp9 - weapon_nova - Nova - weapon_p250 - p250 - weapon_scar20 - Scar20 - weapon_sg556 - sg556 - weapon_ssg08 - ssg08 - weapon_usp_silencer - USP - weapon_m4a1_silencer - M4A1 Silencer 
- 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.































