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

Trigger brush: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Substituted IO templates)
Line 25: Line 25:
{{I|Use|Fires the OnUse output.}}
{{I|Use|Fires the OnUse output.}}


==Outputs==
== Outputs ==
{{O|OnUse|Fired when the <code>Use</code> input is given.}}
{{O|OnUse|activator= activator of the Use input|Fired when the <code>Use</code> input is given.}}
{{O|OnStartTouch|Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.}}
{{O|OnStartTouch|activator = entity that touched this trigger|Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.}}
{{O|OnEndTouch|Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire.}}
{{O|OnEndTouch|activator = entity that stopped touching this trigger (may be NULL if the entity was killed)|Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire.}}


===FGD Code===
== FGD Code ==
<source lang=js>@SolidClass base(Targetname, Parentname, Global, Inputfilter, EnableDisable) = trigger_brush
<syntaxhighlight lang=js>@SolidClass base(Targetname, Parentname, Global, Inputfilter, EnableDisable) = trigger_brush
[
[
DontMessageParent(integer) : "Don't alert parent" : 0 : "When 0 forwards OnStartTouch, OnEndTouch outputs or Use input to parented entity"
DontMessageParent(integer) : "Don't alert parent" : 0 : "When 0 forwards OnStartTouch, OnEndTouch outputs or Use input to parented entity"
Line 40: Line 40:
output OnStartTouch(void) : "Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire."
output OnStartTouch(void) : "Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire."
output OnEndTouch(void) : "Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire."
output OnEndTouch(void) : "Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire."
]</source>
]</syntaxhighlight>


== See also ==
== See also ==
*[[logic_eventlistener]]
*[[logic_eventlistener]]

Revision as of 07:39, 26 April 2025

Obsolete-notext.png
This entity is obsolete. Its use is discouraged. It may only exist/function in older engine branches.
Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CTriggerBrush
CBaseEntity
C++ modelentities.cpp

trigger_brush is a brush entity available in all Source Source games. Deprecated entity during the development of Half-Life 2, its sole difference compared to other entities is that a OnUse output exists.

Note.pngNote:The brush is fully solid unlike other trigger entities.
Note.pngNote:Use func_button instead, it behaves like trigger_brush but is more likely to work on any version of Source.
Note.pngNote:The player events (such as game_playerdie) are usable by all entities and not just by this entity, despite common misconception. The list of those is now available on the Targetname page.
Note.pngNote:The brush can be partly entered about 0.5 units. Setting solidbsp keyvalue to 1 mitigates this issue.
Cpp.pngCode:In code, it is represented by the CTriggerBrush class, defined in the modelentities.cpp file.

Keyvalues

Input Filter (InputFilter) <choices>
Used to specify which inputs this entity will accept.
  • 0: Allow all inputs
  • 1: Ignore Players !FGD
  • 2: Ignore NPCs !FGD
  • 4: Ignore Pushables !FGD
  • 8: Ignore Touch/Untouch
  • 16: Ignore Use
  • 32: Ignore All
Don't alert parent (DontMessageParent) <boolean>
Decides whether to forward OnStartTouch, OnEndTouch outputs or Use input to parented entity.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
Use
Fires the OnUse output.

Outputs

OnUse
!activator = activator of the Use input
!caller = this entity
Fired when the Use input is given.
OnStartTouch
!activator = entity that touched this trigger
!caller = this entity
Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.
OnEndTouch
!activator = entity that stopped touching this trigger (may be NULL if the entity was killed)
!caller = this entity
Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire.

FGD Code

@SolidClass base(Targetname, Parentname, Global, Inputfilter, EnableDisable) = trigger_brush
[
	DontMessageParent(integer) : "Don't alert parent" : 0 : "When 0 forwards OnStartTouch, OnEndTouch outputs or Use input to parented entity"

	input Use(void) : "Fires the OnUse output."

	output OnUse(void) : "Fired when the Use input is given. "
	output OnStartTouch(void) : "Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire."
	output OnEndTouch(void) : "Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire."
]

See also