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

Trigger hierarchy: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Substituted IO templates)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<!-- When this page is updated to {{langsp}} or {{language subpage}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}{{this is a|e2|name=trigger_hierarchy|since=Alien Swarm}} It is also available in {{bms|4}}.
<!-- When this page is updated to {{langsp}} or {{language subpage}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}{{this is a|brush entity|name=trigger_hierarchy|since=Alien Swarm}} It is also available in {{bms|4}}.


== Entity description ==
== Entity description ==
Line 9: Line 9:


== Inputs ==
== Inputs ==
{{IO|TouchTest|Tests if the trigger is being touched and fires an output based on whether the value is true or false.}}
{{I|TouchTest|Tests if the trigger is being touched and fires an output based on whether the value is true or false.}}


== Outputs ==
== Outputs ==
{{IO|OnTrigger|Fired whenever the trigger is activated.}}
{{O|OnTrigger|Fired whenever the trigger is activated.}}
{{IO|OnTouching|Fired when the TestTouch input is true (something is touching the trigger.)}}
{{O|OnTouching|Fired when the TestTouch input is true (something is touching the trigger.)}}
{{IO|OnNotTouching|Fired when the TestTouch input is not true (nothing is touching the trigger.)}}
{{O|OnNotTouching|Fired when the TestTouch input is not true (nothing is touching the trigger.)}}
{{O Trigger}}
{{O Trigger}}

Latest revision as of 23:08, 20 April 2025

English (en)Translate (Translate)

trigger_hierarchy is a brush entity available in all Source Source games since Alien Swarm Alien Swarm. It is also available in Black Mesa Black Mesa.

Entity description

A trigger volume that can will check if any of trigger's children pass a secondary filter.

Keyvalues

Child Filter Name (childfiltername) <filter>
Filter to use to see if activator's children trigger me. See filter_activator_name for more explanation.
Delay Before Reset (wait) <integer>
Amount of time, in seconds, after the trigger_multiple has triggered before it can be triggered again. If set to -1, it will never trigger again (in which case you should just use a trigger_once).

Inputs

TouchTest
Tests if the trigger is being touched and fires an output based on whether the value is true or false.

Outputs

OnTrigger
Fired whenever the trigger is activated.
OnTouching
Fired when the TestTouch input is true (something is touching the trigger.)
OnNotTouching
Fired when the TestTouch input is not true (nothing is touching the trigger.)
BaseTrigger
OnStartTouch
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity starts touching this trigger.
OnStartTouchAll
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity starts touching this trigger, and no other entities are touching it. If there are any other entities touching the trigger when a new one begins to touch, only OnStartTouch will fire.
OnEndTouch
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity stops touching this trigger.
Note.pngNote:Will also fire for entities touching it when trigger is disabled via Disable input
Warning.pngWarning:This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
Warning.pngWarning:OnEndTouch can fire before OnStartTouch under certain circumstances[How?] where both are fired on the same tick and each have the same delay.
Note.pngFix:Add a slight delay to OnEndTouch.
OnEndTouchAll
!activator = entity that caused this output
!caller = this entity
Fired when all valid entities stop touching this trigger.
OnTouching  (in all games since Source 2007)
!activator = !caller = this entity
Fired if something is currently touching this trigger when TouchTest is fired.
OnNotTouching  (in all games since Source 2007)
!activator = !caller = this entity
Fired if nothing is currently touching this trigger when TouchTest is fired.