game_ui
Jump to navigation
Jump to search
- Not to be confused with GameUI
Code classes:
CGameUI
CBaseEntity
(all ents)
game_ui
is a point entity present in all Source games. It monitors a player's game input (such as walking and looking around) and puts it into outputs. It even works with bots!
Note: Multiplayer games will require one game_ui
for every player that needs to be monitored at once.
Flags[edit | edit source]
- 32: Freeze Player - Sets the player's walking speed to 0 while the entity is active.
- 64: Hide Weapon - Makes the player's weapon be hidden. Bug: May not work in some games. Might make the player model go to it's reference pose. Only hides the crosshair in .
- 128: +Use Deactivates - Stops monitoring the player if they press their use key.
- 256: Jump Deactivates - Stops monitoring the player if they jump.
Keyvalues[edit | edit source]
- FieldOfView
(FieldOfView)
<float>
- If the entity is active, how far away the player can look from it while not deactivating it. -1 = any direction, 0 = 90 degrees, 1 = looking perfectly at it. The angle will still be checked even through solid walls.
Inputs[edit | edit source]
- Activate
<target_destination>
- Starts monitoring input. If the parameter is specified, it monitors a player with that targetname. Otherwise, the entity monitors the
!activator
. - Deactivate
- Stops monitoring the player input.
Outputs[edit | edit source]
Note: The player is the activator for all outputs.
- PlayerOn
- Fires when Activate is sent.
- PlayerOff
- Fires when Deactivate is sent or when the player looks outside of FieldOfView.
- PressedMoveLeft
- Fires when the player sends
+moveleft
(walk left). - UnpressedMoveLeft
- Fires when the player sends
-moveleft
- PressedMoveRight
- Fires when the player sends
+moveright
(walk right). - UnpressedMoveRight
- Fires when the player sends
-moveright
. - PressedForward
- Fires when the player sends
+forward
(walk forward). - UnpressedForward
- Fires when the player sends
-forward
. - PressedBack
- Fires when the player sends
+back
(walk backward). - UnpressedBack
- Fires when the player sends
-back
. - PressedAttack
- Fires when the player sends
+attack
(primary attack). - UnpressedAttack
- Fires when the player sends
-attack
. - PressedAttack2
- Fires when the player sends
+attack2
(secondary attack). - UnpressedAttack2
- Fires when the player sends
-attack2
. XAxis- Only for analog controllers.
YAxis- Only for analog controllers.
AttackAxis- Only for analog controllers.
Attack2Axis- Only for analog controllers.