game_ui
From Valve Developer Community
Contents |
game_ui is a point entity available in all Source games. It redirects important player key presses to a series of outputs, and can be used to make the player control vehicles built in a map. It can be activated with I/O, or by the player looking at it.
Keyvalues
- FieldOfView
<float> - How close to the entity the player's crosshair must be for it to take control. When the player leaves the active zone, (s)he regains control.
- 1.0 = straight ahead
- 0.0 = +/- 90 degrees
- -1.0 = all directions
Targetname:
- Name <string>
- The targetname other entities refer to this entity by.
Flags
- Freeze Player
- Hide Weapon
- +Use Deactivates
- Jump Deactivates
Inputs
-
Activate -
Deactivate - The entity will only test FieldOfView if it is active.
Warning:Deactivating an already-inactive game_ui crashes the game!
Targetname:
-
Kill - Removes this entity from the world.
-
KillHierarchy - Removes this entity and all its children from the world.
-
AddOutput <string> - Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite> -
FireUser1toFireUser4 - Fire the
OnUseroutputs; see User Inputs and Outputs.
Outputs
The player is always the !activator.
-
PlayerOn -
PlayerOff - Fired when the entity starts or stops controlling the player's input.
-
PressedMoveLeft -
UnpressedMoveLeft(New with Orange Box) - Fired on +moveleft/-moveleft
-
PressedMoveRight -
UnpressedMoveRight(New with Orange Box) - Fired on +moveright/-moveright
-
PressedForward -
UnpressedForward(New with Orange Box) - Fired on +forward/-forward
-
PressedBack -
UnpressedBack(New with Orange Box) - Fired on +back/-back
-
PressedAttack -
UnpressedAttack(New with Orange Box) - Fired on +attack/-attack
-
PressedAttack2 -
UnpressedAttack2(New with Orange Box) - Fired on +attack2/-attack2
-
XAxis <float> -
YAxis <float> - Fired whenever the X/Y axis of the player's input changes. Only useful for analogue gamepad input.
- -1.0 = +moveleft / +back at 100% speed
- 0 = no movement in this axis
- +1.0 = +moveright / +forward at 100% speed
-
AttackAxis <float> -
Attack2Axis <float> - An output that fires whenever the state of the player's "attack" key changes. Only useful for analogue gamepad input.
- 1.0 = bumper is 100% depressed
- 0 = bumper is at rest
Targetname:
-
OnUser1toOnUser4 - Fired in response to the
FireUserinputs; see User Inputs and Outputs. -
OnKilled(New with Left 4 Dead) - Fired when the entity is killed and removed from the game.
