Game ui: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
(cleaned)
Line 1: Line 1:
{{wrongtitle|title=game_ui}}
{{toc-right}}
{{base_point}}[[Category:GUI Entities]]


== Entity description ==
{{base point|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.
An entity used to override player input when the player is looking at it.
 
{{note|Unreliable in multiplayer.}}


== Keyvalues ==
== Keyvalues ==
*{{KV Targetname}}
 
*'''[[FOV|FieldOfView]]'''
; FieldOfView <code><[[float]]></code>
: <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. If the player isn't within the tolerance, the player regains control.
: 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
{{KV Targetname}}


== Flags ==
== Flags ==
*32 : Freeze Player
 
*64 : Hide Weapon
* Freeze Player
*128 : +Use Deactivates
* Hide Weapon
*256 : Jump Deactivates
* +Use Deactivates
* Jump Deactivates


== Inputs ==
== Inputs ==
*{{I Targetname}}
 
*'''Deactivate'''
; <code>Activate</code>
:Return Player Control.{{warning|Deactivating an inactive game_ui crashes the game}}
; <code>Deactivate</code>
*'''Activate'''
: The entity will only test FieldOfView if it is active. {{warning|Deactivating an already-inactive game_ui crashes the game!}}
:Take Player Control.
{{I Targetname}}


== Outputs ==
== Outputs ==
*{{O Targetname}}
 
*'''PlayerOn'''
The player is always the [[!activator]].
:Fired whenever this entity starts controlling the player's input. {{PlAct}}
 
*'''PlayerOff'''
; <code>PlayerOn</code>
:Fired whenever this entity stops controlling the player's input. {{PlAct}}
; <code>PlayerOff</code>
*'''PressedMoveLeft'''
:Fired when the entity starts or stops controlling the player's input.
:Fired whenever the player presses the moveleft key. {{PlAct}}
; <code>PressedMoveLeft</code>
*'''{{EP2 add|UnpressedMoveLeft}}'''
; {{EP2 add|<code>UnpressedMoveLeft</code>}}  
:Fired whenever the player unpresses the moveleft key. {{PlAct}}
: Fired on +moveleft/-moveleft
*'''PressedMoveRight'''
; <code>PressedMoveRight</code>
:Fired whenever the player presses the moveright key. {{PlAct}}
; {{EP2 add|<code>UnpressedMoveRight</code>}}
*'''{{EP2 add|UnpressedMoveRight}}'''
: Fired on +moveright/-moveright
:Fired whenever the player unpresses the moveright key. {{PlAct}}
; <code>PressedForward</code>
*'''PressedForward'''
; {{EP2 add|<code>UnpressedForward</code>}}
:Fired whenever the player presses the forward key. {{PlAct}}
: Fired on +forward/-forward
*'''{{EP2 add|UnpressedForward}}'''
; <code>PressedBack</code>
:Fired whenever the player unpresses the forward key. {{PlAct}}
; {{EP2 add|<code>UnpressedBack</code>}}  
*'''PressedBack'''
: Fired on +back/-back
:Fired whenever the player presses the backward key. {{PlAct}}
; <code>PressedAttack</code>
*'''{{EP2 add|UnpressedBack}}'''
; {{EP2 add|<code>UnpressedAttack</code>}}  
:Fired whenever the player unpresses the backward key. {{PlAct}}
: Fired on +attack/-attack
*'''PressedAttack'''
; <code>PressedAttack2</code>
:Fired whenever the player presses the attack key. {{PlAct}}
; {{EP2 add|<code>UnpressedAttack2</code>}}  
*'''{{EP2 add|UnpressedAttack}}'''
: Fired on +attack2/-attack2
:Fired whenever the player unpresses the attack key. {{PlAct}}
; <code>XAxis <[[float]]></code>
*'''PressedAttack2'''
; <code>YAxis <float> </code>
:Fired whenever the player presses the secondary attack key. {{PlAct}}
: Fired whenever the X/Y axis of the player's input changes. Only useful for analogue gamepad input.
*'''{{EP2 add|UnpressedAttack2}}'''
:* -1.0 = +moveleft / +back at 100% speed
:Fired whenever the player unpresses the secondary attack key. {{PlAct}}
:* 0 = no movement in this axis
*'''XAxis''' <float>
:* +1.0 = +moveright / +forward at 100% speed
:An output that fires whenever the X axis of the player's input changes. i.e. -1 when the player has "moveleft" key down, 1 when the player has moveright key down, and 0 if neither.
; <code>AttackAxis <float></code>
:{{PlAct}}
; <code>Attack2Axis <float></code>
*'''YAxis''' <float>  
:An output that fires whenever the state of the player's "attack" key changes. Only useful for analogue gamepad input.
:An output that fires whenever the Y axis of the player's input changes. i.e. -1 when the player has "backward" key down, 1 when the player has "forward" key down, and 0 if neither.
:* 1.0 = bumper is 100% depressed
:{{PlAct}}
:* 0 = bumper is at rest
*'''AttackAxis''' <float>  
{{O Targetname}}
:An output that fires whenever the state of the player's "attack" key changes. i.e. 1 when the player has the "attack" key down, 0 otherwise.
 
:{{PlAct}}
[[Category:Level Design]]
*'''Attack2Axis''' <float>  
:An output that fires whenever the state of the player's "secondary attack" key changes. i.e. 1 when the player has the "secondary attack" key down, 0 otherwise.
:{{PlAct}}

Revision as of 06:00, 2 September 2009

Template:Base point 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.pngNote:Unreliable in multiplayer.

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
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Flags

  • Freeze Player
  • Hide Weapon
  • +Use Deactivates
  • Jump Deactivates

Inputs

Activate
Deactivate
The entity will only test FieldOfView if it is active.
Warning.pngWarning:Deactivating an already-inactive game_ui crashes the game!


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