Env global: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (various minor links and changes)
No edit summary
Line 1: Line 1:
{{wrongtitle|title=env_global}}
{{toc-right}}
==Entity Description==
 
An [[entity]] to control a game-specific global states, it can be used to force the [[weapon_physcannon|gravity gun]] to become the super gravity gun among other things.
[[File:Env global.png|left]]
 
{{base point|env_global}} It controls game-specific global states, such as whether the [[weapon_physcannon|gravity gun]] should become the super gravity gun in HL2.


For this entity to take effect from the map's start, the '''Set Initial State''' [[flag]] must be checked.
For this entity to take effect from the map's start, the '''Set Initial State''' [[flag]] must be checked.


With the [[Orange Box]], the entity can also store a numeric variable, the "counter," which can be added to or set directly (but not subtracted from), much like a [[math_counter]] which works across multiple maps.
==Keyvalues==


{{map properties}}
{{KV|Global State to Set|choices|Game-specific global state that this entity sets. In practice all of Valve's FGDs include the HL2 states regardless of whether the game understands them.
:* Gordon pre-criminal
:* Antlions are player allies
:* Suit sprint function not yet enabled
:* Super phys gun is enabled
:* Friendly encounter sequence (lower weapons, etc.)
:* Gordon is invulnerable
:* Don't spawn seagulls on the jeep
:* Episode 2: Alyx injured
:* Episodic: Alyx darkness mode
:* Ep2 Counter: Hunters to run over before they dodge
}}
{{ScrollBox|title=EnvGlobal|
{{KV|Initial State|choices|Whether the entity should be active when the map starts.
* Off
* On
* Dead ({{todo|What does that mean?}})
}}
{{KV|Counter|int|An integer counter value associated with this global. This is used to track some achievements.|since=EP2}}
{{KV Targetname}}
}}


==Keyvalues==
== Flags ==


* {{KV Targetname}}
* Set Initial State: Whether this entity defines the global state when the map starts.
* '''initialstate'''
: <choices> Initial State
:{| class=standard-table
! Literal Value || Description
|-
| 0 || Off
|-
| 1 || On
|-
| 2 || Dead
|}
* '''globalstate'''
: <string> Global State to Set
:{| class=standard-table
! Literal Value || Description
|-
| "gordon_precriminal" || Gordon pre-criminal
|-
| "antlion_allied" || Antlions are player allies
|-
| "suit_no_sprint" || Suit sprint function not yet enabled
|-
| "super_phys_gun" || Super phys gun is enabled
|-
| "friendly_encounter" || Friendly encounter sequence (lower weapons, etc.)
|-
| "gordon_invulnerable" || Gordon is invulnerable
|-
| "no_seagulls_on_jeep" || Don't spawn seagulls on the jeep
|-
| "ep2_alyx_injured" || Episode 2: Alyx injured
|-
| "ep_alyx_darknessmode" || Episodic: Alyx darkness mode
|}
* '''{{EP2 add|counter}}'''
: Sets the initial value of the associated counter.


==Inputs==
==Inputs==
* {{I Targetname}}
 
* '''TurnOn'''
{{ScrollBox|title=EnvGlobal|noscroll=true|
: Set state of global to ON.
{{IO|TurnOn / TurnOff|Sets the global's state.}}
* '''TurnOff'''
{{IO|Toggle|Toggles state of global between ON and OFF.}}
: Set state of global to OFF.
{{IO|Remove|Set state of global to DEAD.}}
* '''Toggle'''
{{IO|AddToCounter|param=int|Adds the specified amount to the counter.|since=EP2}}
: Toggles state of global between ON and OFF.
{{IO|SetCounter|param=int|Sets the value of the counter.|since=EP2}}
* '''Remove'''
{{IO|GetCounter|: Fires this entity's Counter output.|since=EP2}}
: Set state of global to DEAD.
{{I Targetname}}
* '''{{EP2 add|AddToCounter <integer>}}'''
}}
: Adds the specified amount to the counter.
* '''{{EP2 add|SetCounter <integer>}}'''
: Sets the value of the counter.
* '''{{EP2 add|GetCounter}}'''
: Fires this entity's Counter output.


==Outputs==
==Outputs==
* {{O Targetname}}
 
* '''{{EP2 add|Counter <integer>}}'''
{{ScrollBox|title=EnvGlobal|
: Outputs the integer value of this entity. May depend on global state.
{{IO|counter|param=int|Outputs the integer value of this entity. May depend on global state.|since=EP2}}
{{O Targetname}}
}}


[[Category:Entities]]
[[Category:Entities]]

Revision as of 11:06, 6 July 2011

Env global.png

Template:Base point It controls game-specific global states, such as whether the gravity gun should become the super gravity gun in HL2.

For this entity to take effect from the map's start, the Set Initial State flag must be checked.

Keyvalues

Global State to Set ([todo internal name (i)]) <choices>
Game-specific global state that this entity sets. In practice all of Valve's FGDs include the HL2 states regardless of whether the game understands them.
  • Gordon pre-criminal
  • Antlions are player allies
  • Suit sprint function not yet enabled
  • Super phys gun is enabled
  • Friendly encounter sequence (lower weapons, etc.)
  • Gordon is invulnerable
  • Don't spawn seagulls on the jeep
  • Episode 2: Alyx injured
  • Episodic: Alyx darkness mode
  • Ep2 Counter: Hunters to run over before they dodge
EnvGlobal:
Initial State ([todo internal name (i)]) <choices>
Whether the entity should be active when the map starts.
  • Off
  • On
  • Dead (
    Todo: What does that mean?
    )
Counter ([todo internal name (i)]) <integer> (in all games since Half-Life 2: Episode Two)
An integer counter value associated with this global. This is used to track some achievements.
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

  • Set Initial State: Whether this entity defines the global state when the map starts.

Inputs

EnvGlobal:
TurnOn / TurnOff
Sets the global's state.
Toggle
Toggles state of global between ON and OFF.
Remove
Set state of global to DEAD.
AddToCounter <integerRedirectInput/integer> (in all games since Half-Life 2: Episode Two)
Adds the specified amount to the counter.
SetCounter <integerRedirectInput/integer> (in all games since Half-Life 2: Episode Two)
Sets the value of the counter.
GetCounter  (in all games since Half-Life 2: Episode Two)
Fires this entity's Counter output.

Outputs

EnvGlobal:
counter <integerRedirectInput/integer> (in all games since Half-Life 2: Episode Two)
Outputs the integer value of this entity. May depend on global state.