Trigger once: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
Warning: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.
		
	
 (add I Trigger template)  | 
				 (-BaseTrigger templates, warnings, notes)  | 
				||
| Line 6: | Line 6: | ||
== Keyvalues ==  | == Keyvalues ==  | ||
{{KV Targetname}}  | {{KV Targetname}}  | ||
{{KV BaseTrigger}}  | |||
== Flags ==  | == Flags ==  | ||
{{Fl   | {{Fl BaseTrigger}}  | ||
== Inputs ==  | == Inputs ==  | ||
{{  | {{IO|Toggle|Toggles this trigger between enabled and disabled states.}}  | ||
{{  | {{IO|Enable|Enable trigger}}  | ||
{{IO|Disable|Disable trigger}}  | |||
{{IO|StartTouch|Behave as if the {{ent|!caller}} entity had just entered the trigger volume. Accepts non-physical entities.|since={{Src07}}|nofgd=1}}  | |||
::{{note|Will trigger OnStartTouch output and the trigger won't be removed.}}  | |||
::{{warning|If !caller doesn't exist game will crash}}  | |||
{{I Trigger Chaos}}  | {{I Trigger Chaos}}  | ||
== Outputs ==  | == Outputs ==  | ||
{{  | {{IO|OnStartTouch}}  | ||
{{IO|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|"toucher."}}}}  | |||
{{warning|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 ==  | == See also ==  | ||
Revision as of 12:27, 8 August 2023
| CTriggerOnce | 
Template:Entity 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
- Name (targetname) <string>[ Edit ]
 - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. 
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities 
 
  | 
Flags
 
 
 
 
 
 
 
  | 
Inputs
- Toggle
 - Toggles this trigger between enabled and disabled states.
 
- Enable
 - Enable trigger
 
- Disable
 - Disable trigger
 
- StartTouch   (in all games since 
) !FGD - Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
Note:Will trigger OnStartTouch output and the trigger won't be removed.
Warning:If !caller doesn't exist game will crash
 
StrataEngine:
- Touch   (only in 
 Strata Source games) - Behaves as if 
!callerhas 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.")