Env gunfire

From Valve Developer Community

Table of contents

Entity Description

Fires a tracer with customization

Keyvalues

Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
Specifies the targetname of this entity's Parent in a movement hierarchy. Child entities move with their Parent.
  • StartDisabled
<boolean>
  • target
<target_destination> Shoot at this target. REMEMBER - this is an effect only! It does not do damage!
  • minburstsize
<integer> Minimum number of rounds in a burst.
  • maxburstsize
<integer> Maximum number of rounds in a burst.
  • minburstdelay
<float> Minimum delay between bursts. (seconds)
  • maxburstdelay
<float> Maximum delay between bursts. (seconds)
  • rateoffire
<float> Expressed as rounds per second
  • spread
<integer> The 'cone of inaccuracy' of the shots fired by this entity. Expressed as degrees
  • 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.
Literal Value Description
1 Evenly distributed
-1 Biased towards the outside
  • collisions
<boolean> Whether or not to handle bullet collision detection.
Image:note.png Note: If not set, 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).
  • shootsound
<string/choices> Gunfire sound to make
Literal Value Description
Weapon_AR2.NPC_Single AR2
Weapon_SMG1.NPC_Single SMG1
  • tracertype
<choices> Type of tracer to display
If not set, the default tracer will fire
Literal value Description
AR2TRACER AR2

Inputs

  • Kill
Removes this entity from the world.
Removes this entity and all its children from the world.
  • AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
Changes the entity's parent in the movement hierarchy.
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the Parent's Origin and Angles at the time it is attached.
Removes this entity from its current movement hierarchy.
  • Enable
Enable this entity.
  • Disable
Disable this entity.

Outputs

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator