Trigger brush: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added "-")
(-added missing info, adde class hierarchy, cleanup)
Line 1: Line 1:
{{obsolete|entity=1}}
{{obsolete|entity=1}}
{{ent not in fgd}}
{{ent not in fgd}}
{{CD|CTriggerBrush|file1=modelentities.cpp}}
{{base_brush|trigger_brush}} Deprecated entity during the development of Half-Life 2, it's sole difference compared to other entities is that a <code>OnUse</code> output exists.
{{base_brush|trigger_brush}} Deprecated entity during the development of Half-Life 2, it's sole difference compared to other entities is that a <code>OnUse</code> output exists.
{{note|The brush ''is'' fully solid unlike other trigger [[entities]].}} {{note|Use [[func_button]] instead, it behaves like trigger_brush but is more likely to work on any version of source.}}
{{note|The brush ''is'' fully solid unlike other trigger [[entities]].}} {{note|Use [[func_button]] instead, it behaves like trigger_brush but is more likely to work on any version of source.}}
Line 7: Line 8:
{{code class|CTriggerBrush|modelentities.cpp}}
{{code class|CTriggerBrush|modelentities.cpp}}


===FGD Code===
==Keyvalues==
<pre>@SolidClass base(Targetname, Parentname, Global, EnableDisable) = trigger_brush
{{KV|Ignore flags|intn=InputFilter|int|Flags of things to ignore: players {{=}} 1, npcs {{=}} 2, pushables {{=}} 4, touch {{=}} 8, use {{=}} 16, all {{=}} 32}}
[
{{KV|Don't alert parent|intn=DontMessageParent|bool|Decides whether to forward OnStartTouch, OnEndTouch outputs or Use input to parented entity}}
input Use(void) : "Fires the OnUse output."
{{KV Targetname}}
output OnUse(void) : "Fired when the Use input is given."
]</pre>


==Keyvalues==
{{KV EnableDisable}}
{{KV BaseEntity|brush=1}}
==Inputs==
==Inputs==
{{I EnableDisable}}
{{I EnableDisable}}
{{I BaseEntity}}
{{IO|Use|Fires the OnUse output.}}
 
==Outputs==
==Outputs==
{{O BaseEntity|l4d=1}}
{{IO|OnUse|Fired when the <code>Use</code> input is given.}}
{{IO|OnUse|Fired when the <code>Use</code> input is given.}}
{{IO|OnStartTouch|Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.}}
{{IO|OnEndTouch|Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire.}}
===FGD Code===
<source lang=js>@SolidClass base(Targetname, Parentname, Global, EnableDisable) = trigger_brush
[
InputFilter(integer) : "Ignore flags" : 0 : "Add up wanted flags of things to ignore: players = 1, npcs = 2, pushables = 4, touch = 8, use = 16, all = 32"
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."
]</source>
== See also ==
== See also ==
*[[logic_eventlistener]]
*[[logic_eventlistener]]

Revision as of 12:43, 11 November 2022

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

Template:Base brush Deprecated entity during the development of Half-Life 2, it's 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 useable by all entities and not just by this entity, despite common misconception. The list of those is now available on the Targetname page.
C++ In code, it is represented by theCTriggerBrushclass, defined in themodelentities.cppfile.

Keyvalues

Ignore flags (InputFilter) <integer>
Flags of things to ignore: players = 1, npcs = 2, pushables = 4, touch = 8, use = 16, all = 32
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
Fired when the Use input is given.
OnStartTouch
Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire.
OnEndTouch
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, EnableDisable) = trigger_brush
[
	InputFilter(integer) : "Ignore flags" : 0 : "Add up wanted flags of things to ignore: players = 1, npcs = 2, pushables = 4, touch = 8, use = 16, all = 32"
	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