CTriggerHurt

From Source Entities
Jump to navigation Jump to search

Code classes:

CTriggerHurt is a code class in every Source game.

Classnames:

  • trigger_hurt - Hurts things that enter the volume. Pierces ubercharge and other damage resistance in Tf2.png.

Bug: In Tf2.pngHl2.pngCss.png, damages half as much as it should. If Damage is 1, it might get reduced to 0.5 and rounded down to 0. Double all your damage amounts! To do: Cause not found.

Note: L4d2-small.pngtrigger_hurts that are compiled into entity groups are converted to the entity script_trigger_hurt.

Note: L4d.pngL4d2-small.pngDoes not hurt unspawned player zombies in Versus mode. See trigger_hurt_ghost.

Keyvalues[edit | edit source]

Damage (damage) <float>
How much damage to do every half-second. Note: This amount is factored into the force that objects will take when hit.
Damage Cap (damagecap) <float>
Maximum amount of damage to do when using Doubling with forgiveness as the Damage Model.
Damage Model (damagemodel) <choices>
Controls how damage is applied.
  • 0: Normal - Straightforward; applies Damage every half-second.
  • 1: Doubling with forgiveness - Damage doubles until all hurtable entities have left the trigger for three seconds.
Bug: In some games the damage will not reset to its initial value when using Doubling with forgiveness.
Fix: A logic_timer rapidly enabling and disabling the trigger somehow fixes it.
Zero Damage Force (nodmgforce) <boolean>
If yes, cancels any physics force the hurt entity might receive.
Damage Type (damagetype) <choices>
What kind of damage to do. See here for info on every type.
Always think every frame (thinkalways) <boolean> (only available in L4d2-small.png)
Makes the trigger hurt objects every tick, instead of every half-second. Use this to make players skip being incapacitated for a moment.
Damage Force Override (damageforce) <vector> (only available in L4d2-small.png)
Doesn't work.

Inputs[edit | edit source]

SetDamage <float>
Sets Damage.

Outputs[edit | edit source]

OnHurt
Fires when the trigger hurts something that is NOT a player.
OnHurtPlayer
Fires when the trigger hurts a player.

See Also[edit | edit source]