Env gunfire: Difference between revisions
Jump to navigation
Jump to search
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.
m (removed {{DISPLAYTITLE}}, covered by the hl2 point template) |
(updates) |
||
Line 1: | Line 1: | ||
[[ | [[File:gunfire.jpg|thumb|right|300px|A <code>env_gunfire</code> from multiple sides.]] | ||
{{hl2 point|env_gunfire}} | {{hl2 point|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. | ||
{{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.}} | {{code class|CEnvGunfire|effects.cpp}} | ||
==Keyvalues== | ==Keyvalues== | ||
[[File:Gunfire distribution.png|400px|thumb|right|Distribution patterns. Top is an even distribution. Bottom is biased.]] | |||
{{KV|Target (target)|target_destination|Shoot at this target.}} | |||
{{KV|Min Burst Size (minburstsize)|int|Minimum number of rounds in a burst.}} | |||
{{KV|Max Burst Size (maxburstsize)|int|Maximum number of rounds in a burst.}} | |||
{{KV|Min Delay Between Bursts (minburstdelay)|float|Minimum delay between bursts in seconds.}} | |||
{{KV|Max Delay Between Bursts (maxburstdelay)|float|Maximum delay between bursts in seconds.}} | |||
{{KV|Target|target_destination|Shoot at this target. | {{KV|Rate of fire (rateoffire)|float|Number of bullets to fire per second.}} | ||
{{KV|Bullet spread (spread)|int|Bullets may deviate this far away in degrees from shooting straight forward. Any number may be used.}} | |||
{{KV|Min Burst Size|int|Minimum number of rounds in a burst.}} | {{KV|Bullet distribution should be... (bias)|choices|How to distribute bullets within the spread. Even distribution is a true scatter throughout the spread. Biased towards the outside makes the shots 'miss' the target by tending towards the outside of the spread. | ||
:*1: Evenly distributed | |||
{{KV|Max Burst Size|int|Maximum number of rounds in a burst.}} | :*-1: Biased towards the outside}} | ||
{{KV|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). | |||
{{KV|Min Delay Between Bursts|float|Minimum delay between bursts. | :*0: None. Cheap performance. | ||
:*1: Normal collision detection.}} | |||
{{KV|Max Delay Between Bursts|float|Maximum delay between bursts. | {{KV|Shoot Sound (shootsound)|string|Gunfire sound to make. Any sound name can be inserted, either as a filepath or a soundscript name.}} | ||
:{| class=standard-table | |||
{{KV|Rate of fire|float| | |||
{{KV|Bullet spread|int| | |||
{{KV|Bullet distribution should be...|choices| | |||
:* 1 : Evenly distributed | |||
:* 1 : Biased towards the outside | |||
{{KV|Collision detection|choices|Whether/how to handle bullet collision detection. | |||
:* | |||
:* 1 : Normal collision detection. | |||
{{KV|Shoot Sound|string | |||
{| class=standard-table | |||
! Literal Value || Description | ! Literal Value || Description | ||
|- | |- | ||
Line 43: | Line 29: | ||
| Weapon_SMG1.NPC_Single || SMG1 | | Weapon_SMG1.NPC_Single || SMG1 | ||
|} | |} | ||
{{KV|Tracer|choices|Type of tracer to display. If not set, the default tracer will fire. {{todo|Full list of all valid tracers.}}}} | |||
{{KV|Tracer|choices|Type of tracer to display. | :{| class=standard-table | ||
{| class=standard-table | |||
! Literal value || Description | ! Literal value || Description | ||
|- | |- | ||
| AR2TRACER || AR2 | | AR2TRACER || AR2 | ||
|} | |} | ||
{{KV EnableDisable}} | |||
{{KV BaseEntity|base=1}} | |||
==Inputs== | ==Inputs== | ||
{{I EnableDisable}} | {{I EnableDisable}} | ||
{{I BaseEntity|base=1}} | |||
==Outputs== | ==Outputs== | ||
{{O | {{O BaseEntity}} | ||
Revision as of 23:21, 6 September 2018
Template:Hl2 point 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.

Keyvalues
- Target (target) ([todo internal name (i)]) <targetname>
- Shoot at this target.
- Min Burst Size (minburstsize) ([todo internal name (i)]) <integer>
- Minimum number of rounds in a burst.
- Max Burst Size (maxburstsize) ([todo internal name (i)]) <integer>
- Maximum number of rounds in a burst.
- Min Delay Between Bursts (minburstdelay) ([todo internal name (i)]) <float>
- Minimum delay between bursts in seconds.
- Max Delay Between Bursts (maxburstdelay) ([todo internal name (i)]) <float>
- Maximum delay between bursts in seconds.
- Bullet spread (spread) ([todo internal name (i)]) <integer>
- Bullets may deviate this far away in degrees from shooting straight forward. Any number may be used.
- Bullet distribution should be... (bias) ([todo internal name (i)]) <choices>
- How to distribute bullets within the spread. Even distribution is a true scatter throughout the spread. Biased towards the outside makes the shots 'miss' the target by tending towards the outside of the spread.
- 1: Evenly distributed
- -1: Biased towards the outside
- Collision detection (collisions) ([todo internal name (i)]) <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) ([todo internal name (i)]) <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 ([todo internal name (i)]) <choices>
- Type of tracer to display. If not set, the default tracer will fire. Todo: Full list of all valid tracers.
Literal value Description AR2TRACER AR2
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enable
input).
Inputs
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.