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
No edit summary
 
(48 intermediate revisions by 23 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:trigger_brush}}
{{obsolete|entity=1}}
{{ent not in fgd}}
{{Ent not in fgd}}
==Entity Description==
{{CD|CTriggerBrush|file1=modelentities.cpp}}
===FGD Code===
{{This is a|brush entity|name=trigger_brush}} Deprecated entity during the development of ''Half-Life 2,'' its sole difference compared to other entities is that a {{↓|Outputs|<code>OnUse</code> output}} exists which may be useful when combined with [[Targetname#Player Events|player event targetnames]] (such as <code>game_playerdie</code>).
<pre>@SolidClass base(Targetname, Parentname, Global, EnableDisable) = trigger_brush
{{note|The brush ''is'' fully solid unlike other [[triggers|trigger entities]].}}
{{note|Use {{ent|func_button}} instead to detect players using +use, it behaves like trigger_brush but is more likely to work on any version of Source.}}
 
{{toc-right}}
 
== Keyvalues ==
{{KV Targetname}}
{{KV|Input Filter|intn=InputFilter|flags|Used to specify which inputs this entity will accept. Add multiple together to ignore multiple types of inputs.
:*0: Allow all inputs
:*1: Ignore Players
:*2: Ignore NPCs
:*4: Ignore Pushables
:*8: Ignore Touch/Untouch
:*16: Ignore Use
:*32: Ignore All}}
{{KV|Don't alert parent|intn=DontMessageParent|bool|Decides whether to forward OnStartTouch, OnEndTouch outputs or Use input to parented entity.}}
 
== Inputs ==
{{I|[[Use]]|Fires the OnUse output.}}
{{I EnableDisable}}
 
== Outputs ==
{{O|OnUse|activator = activator of the Use input|Fired when the <code>Use</code> input is given.}}
{{O|OnStartTouch|activator = entity that touched this trigger|Fired when an entity starts touching this trigger. The touching entity must pass this trigger's InputFilter to 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 InputFilter will cause this output to fire.}}
 
== FGD Code ==
<syntaxhighlight lang=js>@SolidClass base(Targetname, Parentname, Global, Inputfilter, EnableDisable) = trigger_brush
[
[
spawnflags(flags) =
InputFilter(choices) : "Input Filter" : 0 : "Used to specify which inputs this entity will accept. Add multiple values together to ignore multiple types of inputs (ex: 1+2=3 to ignore both players and NPCs)." =
[
[
2: "Ignore player +USE" : 0
0 : "0 - Allow all inputs"
1 : "1 - Ignore Players"
2 : "2 - Ignore NPCs"
4 : "4 - Ignore Pushables"
8 : "8 - Ignore Touch/Untouch"
16 : "16 - Ignore Use"
32 : "32 - Ignore All"
]
]
InputFilter(choices) : "Input Filter" : 0 : "Used to specify which inputs this entity will accept." =
 
DontMessageParent(choices) : "Alert parent?" : 0 : "When 0, forwards OnStartTouch, OnEndTouch outputs or Use input to parented entity." =
[
[
0 : "Allow Everything"
0 : "Alert parent"
22 : "Touch/Untouch: Players"
1 : "Don't alert parent"
20 : "Touch/Untouch: Players & NPCs"
16 : "Touch/Untouch: Players, NPCs, Pushables"
18 : "Touch/Untouch: Players & Pushables"
21 : "Touch/Untouch: NPCs"
17 : "Touch/Untouch: NPCs & Pushables"
19 : "Touch/Untouch: Pushables"
6 : "Touch/Untouch & Use: Players"
2 : "Touch/Untouch & Use: Players & Pushables"
4 : "Touch/Untouch & Use: Players & NPCs: "
5 : "Touch/Untouch & Use: NPCs"
1 : "Touch/Untouch & Use: NPCs & Pushables"
3 : "Touch/Untouch & Use: Pushables"
14 : "Use: Players"
12 : "Use: Players & NPCs"
8 : "Use: Players, NPCs, & Pushables"
10 : "Use: Players & Pushables"
13 : "Use: NPCs"
9 : "Use: NPCs & Pushables"
11 : "Use: Pushables"
]
]
input Use(void) : "Use"
 
output OnUse(void) : "On use"
input Use(void) : "Fires the OnUse output."
output OnStartTouch(void) : "Fired when an entity starts touching this trigger. " +
 
"The touching entity must pass this trigger's filters " +
output OnUse(void) : "Fired when the Use input is given."
"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 InputFilter to cause this output to fire."
output OnEndTouch(void) : "Fired when an entity stops touching this trigger. " +
output OnEndTouch(void) : "Fired when an entity stops touching this trigger. Only entities that passed this trigger's InputFilter will cause this output to fire."
"The touching entity must pass this trigger's filters " +
]</syntaxhighlight>
"to cause this output to fire."
 
output OnEndTouchAll(void) : "Fires when an entity stops touching this trigger, " +
== Convars ==
"and no other entities are touching it. Only entities " +
{{varcom|start}}
"that passed this trigger's filters are considered."
{{varcom|showtriggers|0|bool|If this is true when this entity spawns its brush will be visible.}}
]</pre>
{{varcom|end}}
==Keyvalues==
== See also ==
*{{KV Targetname}}
*[[logic_eventlistener]]
*{{KV Parentname}}
*{{KV Global}}
*{{KV EnableDisable}}
* '''InputFilter'''
: Used to specify which inputs this entity will accept.
:{| class=standard-table
! Literal Value || Description
|-
| 0 || Allow Everything
|-
| 22 || Touch/Untouch: Players
|-
| 20 || Touch/Untouch: Players & NPCs
|-
| 16 || Touch/Untouch: Players, NPCs, Pushables
|-
| 18 || Touch/Untouch: Players & Pushables
|-
| 21 || Touch/Untouch: NPCs
|-
| 17 || Touch/Untouch: NPCs & Pushables
|-
| 19 || Touch/Untouch: Pushables
|-
| 6 || Touch/Untouch & Use: Players
|-
| 2 || Touch/Untouch & Use: Players & Pushables
|-
| 4 || Touch/Untouch & Use: Players & NPCs
|-
| 5 || Touch/Untouch & Use: NPCs
|-
| 1 || Touch/Untouch & Use: NPCs & Pushables
|-
| 3 || Touch/Untouch & Use: Pushables
|-
| 14 || Use: Players
|-
| 12 || Use: Players & NPCs
|-
| 8 || Use: Players, NPCs, & Pushables
|-
| 10 || Use: Players & Pushables
|-
| 13 || Use: NPCs
|-
| 9 || Use: NPCs & Pushables
|-
| 11 || Use: Pushables
|}
==Flags==
==Inputs==
*{{I Targetname}}
*{{I Parentname}}
*{{I EnableDisable}}
*'''Use'''
==Outputs==
*{{O Targetname}}
* '''OnUse'''
:{{activator|activator}}
* '''OnStartTouch'''
: 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}}
* '''OnEndTouch'''
: Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire. {{activator|exiting entity}}
* '''OnEndTouchAll'''
: Fires when an entity stops touching this trigger, and no other entities are touching it. Only entities that passed this trigger's filters are considered. {{activator|last exiting entity}}
[[Category:Entities]]

Latest revision as of 15:29, 12 June 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 which may be useful when combined with player event targetnames (such as game_playerdie).

Note.pngNote:The brush is fully solid unlike other trigger entities.
Note.pngNote:Use func_button instead to detect players using +use, it behaves like trigger_brush but is more likely to work on any version of Source.

Keyvalues

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

Input Filter (InputFilter) <flags>
Used to specify which inputs this entity will accept. Add multiple together to ignore multiple types of inputs.
  • 0: Allow all inputs
  • 1: Ignore Players
  • 2: Ignore NPCs
  • 4: Ignore Pushables
  • 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.

Inputs

Use
Fires the OnUse output.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

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 InputFilter 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 InputFilter will cause this output to fire.

FGD Code

@SolidClass base(Targetname, Parentname, Global, Inputfilter, EnableDisable) = trigger_brush
[
	InputFilter(choices) : "Input Filter" : 0 : "Used to specify which inputs this entity will accept. Add multiple values together to ignore multiple types of inputs (ex: 1+2=3 to ignore both players and NPCs)." =
	[
		0 : "0 - Allow all inputs"
		1 : "1 - Ignore Players"
		2 : "2 - Ignore NPCs"
		4 : "4 - Ignore Pushables"
		8 : "8 - Ignore Touch/Untouch"
		16 : "16 - Ignore Use"
		32 : "32 - Ignore All"
	]

	DontMessageParent(choices) : "Alert parent?" : 0 : "When 0, forwards OnStartTouch, OnEndTouch outputs or Use input to parented entity." =
	[
		0 : "Alert parent"
		1 : "Don't alert parent"
	]

	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 InputFilter to cause this output to fire."
	output OnEndTouch(void) : "Fired when an entity stops touching this trigger. Only entities that passed this trigger's InputFilter will cause this output to fire."
]

Convars

Cvar/Command Parameters or default value Descriptor Effect
showtriggers 0 bool If this is true when this entity spawns its brush will be visible.

See also