Trigger brush: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(This entity is now fully obsolete, due to the fact that the player events work for all entities and not just this one (making its purpose useless))
Line 1: Line 1:
{{obsolete}}
{{ent not in fgd}}
{{ent not in fgd}}
{{base_brush|trigger_brush}} Fires an output when given a special [[targetname]] in response to [[player]] events.
{{base_brush|trigger_brush}} Deprecated entity during the development of Half Life 2 Beta, it's sole difference compared to other entities is that a <code>OnUse</code> output exists.
For example, when a [[player]] dies, a <code>Use</code> input is sent to any [[trigger_brush]] named <code>game_playerdie</code>. The [[trigger_brush]] will fire <code>OnUse</code> in response.
{{note|The brush ''is'' fully solid unlike other trigger [[entities]].}}
{{note|The brush ''is'' fully solid unlike other trigger [[entities]].}}
{{note|The player events (such as <code>game_playerdie</code>) 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.}}


{{code class|CTriggerBrush|modelentities.cpp}}
{{code class|CTriggerBrush|modelentities.cpp}}
==Targetnames==
The following [[targetname]]s are available for [[trigger_brush]].
* <code>game_playerdie</code> - Fires every time a [[player]] dies. The player who died is the [[!activator]].
* <code>game_playerkill</code> - Fires every time a [[player]] kills another player, the killer is the [[!activator]].
* <code>game_playerjoin</code> - Fires every time a [[player]] joins the game, the joining player is the [[!activator]]. {{bug|<code>game_playerjoin</code> is not fired by [[bot]]s.}}
* <code>game_playerspawn</code> - Fires every time a [[player]] spawns, the spawning player is the [[!activator]]. {{bug|<code>game_playerspawn</code> does not function in {{csgo}} and {{tf2}}.}}
* <code>game_playerleave</code> - Fires every time a [[player]] leaves the game, [[!activator]] will not work in this case as the [[player]] [[entity]] no longer exists.


===FGD Code===
===FGD Code===

Revision as of 16:05, 22 January 2019

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.

Template:Base brush Deprecated entity during the development of Half Life 2 Beta, 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: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.

FGD Code

@SolidClass base(Targetname, Parentname, Global, EnableDisable) = trigger_brush
[
	input Use(void) : "Fires the OnUse output."
	output OnUse(void) : "Fired when the Use input is given."
]

Keyvalues

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

EnableDisable:

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

Outputs

OnUse
Fired when the Use input is given.

See also