Trigger brush: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Overhauled the entire page)
No edit summary
Line 9: Line 9:
* <code>game_playerdie</code> - Fires every time a [[player]] dies. The player who died is the [[!activator]].
* <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_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_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_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.
* <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.

Revision as of 04:14, 20 October 2018

Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.

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.

Note.pngNote:The brush will be fully solid unlike other trigger entities.
C++ In code, it is represented by theCTriggerBrushclass, defined in themodelentities.cppfile.

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.
    Icon-Bug.pngBug:game_playerjoin is not fired by bots.  [todo tested in ?]
  • game_playerspawn - Fires every time a player spawns, the spawning player is the !activator.
    Icon-Bug.pngBug:game_playerspawn does not function in Counter-Strike: Global Offensive and Team Fortress 2.  [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.

See also