trigger_hurt
trigger_hurt is a brush entity available in all
Source games. It is a trigger volume that damages entities that touch it.
See damage types for a list on how different damage types will affect the player.
damage is negative. Blocked areas are marked with a dark blue rectangle and bots won't use them.Contents
Keyvalues
Master (Obsolete)(master)<string>
- Deprecated. Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.
- Damage
(damage)<integer> - The amount of damage done to entities that touch this trigger. The damage is done every half-second. See also Damage Model for extra details on how damage can be dealt. Use negative value to heal.
- Damage Cap
(damagecap)<integer> - Maximum damage dealt per second. This field is only used if you select the Doubling w/Forgiveness damage model, via the spawnflag.
- Damage Type
(damagetype)<choices> - Literal values can be added together to stack effects
- 0: GENERIC
- 1: CRUSH
- 2: BULLET
- 4: SLASH
- 8: BURN
- 16: VEHICLE / TRAIN

- 32: FALL
- 64: BLAST
- 128: CLUB
- 256: SHOCK
- 512: SONIC
- 1024: ENERGYBEAM
- 16384: DROWN
- 32768: PARALYSE
- 65536: NERVEGAS / SAWBLADE

- 131072: POISON
- 262144: RADIATION
- 524288: DROWNRECOVER
- 1048576: ACID / CRITICAL

- 2097152: SLOWBURN
- 4194304: REMOVENORAGDOLL
VEHICLEis namedFREEZEACIDis namedCHEMICALREMOVENORAGDOLLis namedSLOWFREEZE
- Damage Model
(damagemodel)<choices> - How damage is dealt. Normal always does the specified amount of damage each half second. Doubling starts with the specified amount and doubles it each time it hurts the toucher. Forgiveness means that if the toucher gets out of the trigger the damage will reset to the specified value. Good for making triggers that are deadly over time without having to cause massive damage on each touch.
- 0 : Normal
- 1 : Doubling w/forgiveness
- Zero Damage Force
(nodmgforce)<boolean> - Should the damaged entity receive no physics force from this trigger.
TriggerOnce:
- Filter Name
(filtername)<filter> - Name of filter entity to test against activators.
EnableDisable:
- Start Disabled
(StartDisabled)<boolean> - Stay dormant until activated (with the
Enableinput).
Base:
- Collisions
(solid)<choices> - Method of collision for this entity.
- Name
(targetname)<string> - The name that other entities use to refer to this entity.
- Parent
(parentname)<targetname> - Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (
parentname [targetname],[attachment])
Tip: Entities transition to the next map with their parents
Tip: phys_constraintcan be used as a workaround if parenting fails. - Origin (X Y Z)
(origin)<coordinates> - The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Note: Hammer does not move the entities accordingly only in the editor. - Pitch Yaw Roll (X Y Z)
(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.
Note: This works on brush entities, although Hammer doesn't show the new angles. - Classname
(classname)<string>!FGD - Determines the characteristics of the entity before it spawns.
Tip: Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds! - Flags
(spawnflags)<integer>!FGD - Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
- Effects
(effects)<integer>!FGD - Combination of effect flags to use.
Targetname:
- Name
(targetname)<string> - The targetname that other entities refer to this entity by.
Flags
TriggerOnce:
- [
1] : Clients
- [
2] : NPCs
- [
4] : Pushables
- [
8] : Physics Objects
- [
16] : Only player ally NPCs
- [
32] : Only clients in vehicles
- [
64] : Everything (not including physics debris)
- [
512] : Only clients *not* in vehicles
- [
1024] : Physics debris
- [
2048] : Only NPCs in vehicles (respects player ally flag)
- [
4096] : Disallow Bots
Inputs
SetDamage<float>- Set a new amount of damage for this trigger.
Trigger:
TouchTest(in all games since
)- Triggers either the OnTouching or OnNotTouching outputs for whether anything is touching this entity.
StartTouch(in all games since
) !FGD- Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
EndTouch(in all games since
) !FGD- Behave as if the !caller entity had just exited the trigger volume.
DisableAndEndTouch(only in
)- Disables this trigger and calls EndTouch on all currently-touching entities.
TriggerOnce:
Toggle- Toggles this trigger between enabled and disabled states.
EnableDisable:
Enable
Disable- Enable/disable this entity from performing its task. It might also disappear from view.
Base:
AddContext<string>- Adds to the entity's list of response contexts. Format is
<key>:<value>.
AddOutput<string>- Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
Syntax:
ClearContext- Removes all contexts from this entity's list.
ClearParent- Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1toFireUser4- Fires the respective
OnUseroutputs; see User Inputs and Outputs.
Kill- Removes this entity and any entities parented to it from the world.
KillHierarchy- Functions the same as
Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKillinput.
RemoveContext<string>- Remove a context from this entity's list. The name should match the key of an existing context.
SetParent<string>- Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment<string>- Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset<string>- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
DispatchEffect<string>(removed since
) !FGD- Dispatches a special effect from the entity's origin; see also List of Client Effects. Replaced by the particle system since
.
RunScriptFile<script>(in all games since
)- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode<string>(in all games since
)- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.
Fix: Remove the string argument manually with a text editor.
CallScriptFunction<string>(in all games since
) !FGD- Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin<coordinates>(in all games since
) !FGD- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
Targetname:
Kill- Removes this entity from the world.
KillHierarchy- Removes this entity and its children from the world.
Note: Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than Kill.
AddOutput<string>- Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
KV Format:<key> <value>
I/O Format:<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1toFireUser4- Fire the
OnUseroutputs; see User Inputs and Outputs.
Use!FGD- Same as a player invoking +use; may not do anything depending on the entity. Can also be invoked by firing an output that does not specify an input.
RunScriptFile<script>(in all games since
)- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode<string>(in all games since
)- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In
, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction<string>(in all games since
) !FGD- Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin<coordinates>(in all games since
) !FGD- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
Outputs
OnHurt- Fired whenever this trigger hurts something other than a player.
OnHurtPlayer- Fired whenever this trigger hurts a player.
Trigger:
OnEndTouch- Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire. (activator is the exiting entity)
OnEndTouchAll- Fires when the last entity in the entity's area exits this trigger or when this entity is disabled. Only entities that passed this trigger's filters are considered. (activator is the last exiting entity)
TriggerOnce:
OnStartTouch- Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire. (activator is the toucher)
OnTrigger- Fired repeatedly with a delay when an entity is in this trigger's volume. Delay is defined by Delay Before Reset key.
Targetname:
OnUser1toOnUser4- These outputs each fire in response to the firing of the like-numbered
FireUser1toFireUser4Input; see User Inputs and Outputs.