Game ui: Difference between revisions
Jump to navigation
Jump to search
Note:You must have one instance of game_ui per player in multiplayer as each game_ui only activates for one player at a time.
Note:Bots can use this entity and fire its outputs.
Note:This will cause the player to go into their reference (T) pose.
Bug:The game will crash if the
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
{{toc-right}} | {{toc-right}} | ||
{{ | {{entity|type=e0|engine=source|game_ui}} 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. | ||
{{note|You must have one instance of game_ui per player in multiplayer as each game_ui only activates for one player at a time.}} | {{note|You must have one instance of game_ui per player in multiplayer as each game_ui only activates for one player at a time.}} | ||
{{note|Bots can use this entity and fire its outputs.}} | {{note|Bots can use this entity and fire its outputs.}} | ||
Line 12: | Line 12: | ||
:*'''0.0''' = '''+/- 90 degrees''' | :*'''0.0''' = '''+/- 90 degrees''' | ||
:*'''-1.0''' = '''all directions''' | :*'''-1.0''' = '''all directions''' | ||
{{KV | {{KV BaseEntity}} | ||
== Flags == | == Flags == | ||
Line 28: | Line 28: | ||
; <code>Deactivate</code> | ; <code>Deactivate</code> | ||
: The entity will only test FieldOfView if it is active. | : The entity will only test FieldOfView if it is active. | ||
{{ | {{bug|The game will crash if the <code>Deactivate</code> input is fired on a game_ui that was activated by a player who has since disconnected.}} | ||
:{{ | :{{workaround|[[AddOutput]]ing OnUsers to a player and using a [[logic_branch]] together can be sufficient to workaround this. If the game supports it, [[VScript]] can also be used to check if the player entity still exists before firing the input.}} | ||
{{I | {{I BaseEntity}} | ||
== Outputs == | == Outputs == | ||
Line 68: | Line 68: | ||
:* 1.0 = bumper is 100% depressed | :* 1.0 = bumper is 100% depressed | ||
:* 0 = bumper is at rest | :* 0 = bumper is at rest | ||
{{O | |||
{{O BaseEntity|l4d=1}} | |||
[[Category:Level Design]] | [[Category:Level Design]] |
Revision as of 16:45, 6 July 2023
- Not to be confused with GameUI.
Template:Entity 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 (FieldOfView) <float>
- The amount of tolerance in the view checking when determining whether the player's input is still under control.
- 1.0 = straight ahead
- 0.0 = +/- 90 degrees
- -1.0 = all directions
Flags
- 32 : Freeze Player - The player cannot move (they can still crouch though)
- 64 : Hide Weapon - Disables all the player's weapons

- 128 : +Use Deactivates
- 256 : Jump Deactivates
Inputs
Activate
- The !activator will gain control upon this input being fired.
Deactivate
- The entity will only test FieldOfView if it is active.

Deactivate
input is fired on a game_ui that was activated by a player who has since disconnected. [todo tested in ?]Workaround:AddOutputing OnUsers to a player and using a logic_branch together can be sufficient to workaround this. If the game supports it, VScript can also be used to check if the player entity still exists before firing the input.
Outputs
The player is always the !activator.
PlayerOn
PlayerOff
- Fired when the entity starts or stops controlling the player's input.
PressedMoveLeft
- Template:EP2 add
- Fired on +moveleft/-moveleft
PressedMoveRight
- Template:EP2 add
- Fired on +moveright/-moveright
PressedForward
- Template:EP2 add
- Fired on +forward/-forward
PressedBack
- Template:EP2 add
- Fired on +back/-back
PressedAttack
- Template:EP2 add
- Fired on +attack/-attack
PressedAttack2
- Template:EP2 add
- 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