Trigger brush: Difference between revisions
Jump to navigation
Jump to search
Note:The brush will be fully solid unlike other trigger entities.
(removed {{DISPLAYTITLE}}, covered by the base point template) |
(Overhauled the entire page) |
||
Line 1: | Line 1: | ||
{{ent not in fgd}} | {{ent not in fgd}} | ||
{{base_brush|trigger_brush}} | {{base_brush|trigger_brush}} Fires an output when given a special [[targetname]] in response to [[player]] events. | ||
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 will be fully solid unlike other trigger [[entities]].}} | |||
{{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|Bots do not fire this.}} | ||
* | * <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=== | ||
<pre>@SolidClass base(Targetname, Parentname, Global, EnableDisable) = trigger_brush | <pre>@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." | |||
input Use(void) : " | |||
output | |||
]</pre> | ]</pre> | ||
==Keyvalues== | ==Keyvalues== | ||
{{KV BaseEntity|brush=1}} | |||
==Inputs== | ==Inputs== | ||
{{I BaseEntity}} | |||
==Outputs== | ==Outputs== | ||
{{O BaseEntity|l4d=1}} | |||
{{IO|OnUse|Fired when the <code>Use</code> input is given.}} | |||
== See also == | == See also == | ||
[[logic_eventlistener | *[[logic_eventlistener]] | ||
Revision as of 04:13, 20 October 2018
Template:Base brush Fires an output when given a special targetname in response to player events.
For example, when a player dies, a Use
input is sent to any trigger_brush named game_playerdie
. The trigger_brush will fire OnUse
in response.

Targetnames
The following targetnames are available for trigger_brush.
game_playerdie
- Fires every time a player dies. The player who died is the !activator.game_playerkill
- Fires every time a player kills another player, the killer is the !activator.game_playerjoin
- Fires every time a player joins the game, the joining player is the !activator.Bug:Bots do not fire this. [todo tested in ?]
game_playerspawn
- Fires every time a player spawns, the spawning player is the !activator.Bug:
game_playerspawn
does not function inand
. [todo tested in ?]
game_playerleave
- Fires every time a player leaves the game, !activator will not work in this case as the player entity no longer exists.
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
Inputs
Outputs
- OnUse
- Fired when the
Use
input is given.