This article's documentation is for anything that uses the Source engine. Click here for more information.

trigger_once

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png
class hierarchy
CTriggerOnce defined in triggers.cpp
CTriggerMultiple
CBaseTrigger
CBaseToggle
CBaseEntity

trigger_once is a brush entity available in all Source Source games. It is a trigger volume that removes itself after it has been triggered (touched by a qualifying entity) once. A trigger uses outputs to activate an event in another entity.

Keyvalues


Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.

BaseTrigger:

Filter Name (filtername) <filter>
A filter entity to test potential activators against.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Flags


BaseTrigger:
  •  [1] : Clients (Survivors, Special Infected, Tanks Left 4 Dead series)
  •  [2] : NPCs (Common Infected, Witches Left 4 Dead series)
  •  [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

Toggle
Toggles this trigger between enabled and disabled states.
Enable
Enable trigger
Disable
Disable trigger
StartTouch  (in all games since Source 2007) !FGD
Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
Note.pngNote:Will trigger OnStartTouch output and the trigger won't be removed.
Warning.pngWarning:If !caller doesn't exist game will crash

StrataEngine:
Touch  (only in Strata Source Strata Source games)
Behaves as if !caller has touched the trigger volume


Outputs

OnStartTouch
OnTrigger
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.")
Warning.pngWarning:If trigger is enabled while multiple entities that can trigger it are touching it, OnStartTouch will fire for each of them. OnTrigger seems to correctly trigger only once.

See also