Generic Keyvalues, Inputs and Outputs/Keyvalues: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(I see no reason that we can't start using this immediately.)
Line 1: Line 1:
{{KV|Classname (classname)|string|The [[classname]] defines the type of entity.}}
<noinclude>This template is our holder for all [[keyvalues]] that are assigned through {{ent|CBaseEntity}}. The template has a very specific syntax that you must follow to apply properly, because new games have added new features throughout the years. See [[Help:Templates]] for more info on named parameters.
:{{note|Classnames can be changed using [[AddOutput]], which will influence how the engine deals with the entity in certain circumstances.}}
<pre>{{KV BaseEntity}}</pre>
{{KV|Name (targetname)|string|The [[targetname]] that other entities refer to this entity by. }}
'''No parameters:''' display keyvalues for ALL games.
<pre>{{KV BaseEntity|base=1}}</pre>
'''Base:''' display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
<pre>{{KV BaseEntity|l4d2=1}}</pre>
'''Game as a parameter:''' display the keyvalues that <code>base</code> displays, AND keyvalues that were added to the class, by the specified game. You can specify as many games as needed. You must specify ALL the games you want to include (e.g. <code>l4d2</code> will not automatically include <code>l4d</code> keyvalues as well). This is because there are situations like in Portal 2, where the output <code>OnKilled</code> is not available through <code>CBaseEntity</code>, despite being a far descendant of the L4D branch which added it.
 
All parameters for this template:
*<code>base</code>
*<code>l4d</code>
*<code>l4d2</code>
*<code>as</code>
*<code>csgo</code>
{{note|If you want to edit something on this template, please make sure you edit it in both places. ''Per-game'' keyvalues are duplicated, for complex technical reasons.}}
For full documentation on this family of templates, see [[FGD Template Prototype]]. Still confused on something? '''Ask for help''' before editing this template.
----
[[Category:Keyvalue Templates|Global]]
</noinclude>
{{KV|[[Classname]] (classname)|string|The classname defines the type of entity. Classnames can be changed using {{ent|AddOutput}}, which will influence how the engine deals with the entity in certain circumstances.}}
{{KV|Name ([[targetname]])|string|The name that other entities refer to this entity by.}}
{{KV|Global Entity Name (globalname)|string|Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.}}
{{KV|Global Entity Name (globalname)|string|Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.}}
{{KV|Parent (parentname)|targetname|Specifies a [[Entity Hierarchy (parenting)|movement parent]]. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.  
{{KV|[[Parent]] (parentname)|targetname|Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. ''Every'' entity can be parented, even point entities. Some entities which aren't intended to be parented may not function correctly. {{ent|phys_constraint}} can be used as a workaround to parenting.
:{{note|''Every'' entity can be parented, even point entities. Some entities which aren't intended to be parented may not function correctly. [[phys_constraint]] can be used as a workaround to parenting.}}
{{warning|In Counter-Strike: Source, [[Counter-Strike Source Entity Overview#Counter-Strike Round Restarts|parenting this entity to another can break the map]].}}}}
{{#if: {{{triggerwarning|}}} | {{warning|If a trigger does not start out with a parent but rather is assigned one dynamically, choose another entity and add it here as a dummy. Otherwise the trigger will stop colliding properly when it gets its real parent.}} }}
{{KV|[[Origin]] (X Y Z) (origin)|origin|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
{{#if: {{{cswarning|}}} | {{warning|In {{game link|Counter-Strike: Source}}, [[Counter-Strike Source Entity Overview#Counter-Strike Round Restarts|parenting this entity to another can break the map]].}} }} }}
{{KV|[[Pitch Yaw Roll]] (X Y Z) (angles)|angle|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.{{note|This works on brush entities, although Hammer doesn't show the new angles.}}}}
{{KV|Origin {X Y Z} (origin)|origin|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
{{KV|Effects (effects)|string|[[Effect flags]].|nofgd=1}}
{{KV|Pitch Yaw Roll {X Y Z(angles)|angle|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.}}
{{KV|Response Contexts ([[ResponseContext]])|string|Pre-defined response system contexts for this entity. Format is <code>key:value,key:value,...</code>}}
:{{note|This works on brush entities, although Hammer doesn't show the new angles.}}
{{KV|Hammer ID (hammerid)|string|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as {{ent|ent_keyvalue}}.|nofgd=1}}
{{KV|Hammer ID (hammerid)|string|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as [[ent_keyvalue]].}} {{Not in FGD}}
{{KV|Effects (effects)|string|[[Effect flags]].}} {{Not in FGD}}
{{KV|Response Contexts (ResponseContext)|string|Pre-defined [[Response System|response system]] contexts for this entity. Format is <code>key:value,key:value,...</code>}}
:{{note|Despite the description, this works for ''all'' entities, although it is missing from most entities in the FGD.}}
{{#if:{{{l4d|}}}|
{{#if:{{{l4d|}}}|
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
:{{todo|Better description for all of these.}}
:{{todo|Better description for all of these.}}
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source. {{not in FGD}}|since=L4D}}
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source.|nofgd=1|since=L4D}}
:{{confirm|Playstation 3?}}
| }}{{#if:{{{l4d2|}}}|
| }}{{#if:{{{l4d|}}}||{{#if:{{{basehl2|}}}||
{{KV|Glow Backface Multiple (glowbackfacemult)|string|nofgd=1|since=L4D2}}
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
| }}{{#if:{{{as|}}}|
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|[[Lag Compensation]] (LagCompensate)|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|since=AS}}
| }}{{#if:{{{csgo|}}}|
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity.|nofgd=1|since=CSGO}}
| }}{{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}}||{{#if:{{{as|}}}||{{#if:{{{csgo|}}}||{{#if:{{{base|}}}||
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed.|nofgd=1|since=L4D}}
:{{todo|Better description for all of these.}}
:{{todo|Better description for all of these.}}
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source. {{not in FGD}}|since=L4D}}
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source.|nofgd=1|since=L4D}}
:{{confirm|Playstation 3?}}
{{KV|Glow Backface Multiple (glowbackfacemult)|string|nofgd=1|since=L4D2}}
}}}}
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.|since=L4D2}}
{{#if:{{{l4d2|}}}|
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid [[expensive]] operations in this function, as it may cause performance problems.|since=L4D2}}
{{KV|Glow Backface Multiple (glowbackfacemult)|string|Unknown. {{l4d2}} only. {{not in FGD}}|since=L4D2}}
{{KV|[[Lag Compensation]] (LagCompensate)|boolean|Set to '''Yes''' to lag compensate this entity. Should be used very sparingly!|since=AS}}
:{{todo|Documentation.}}
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity.|nofgd=1|since=CSGO}}}}}}}}}}}}
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. |since=L4D2}}
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. {{note|Try to avoid expensive operations in this function, as it may cause performance problems.}}|since=L4D2}}
| }}{{#if:{{{l4d2|}}}||{{#if:{{{basehl2|}}}||
{{KV|Glow Backface Multiple (glowbackfacemult)|string|Unknown. {{l4d2}} only. {{not in FGD}}|since=L4D2}}
:{{todo|Documentation.}}
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. |since=L4D2}}
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. {{note|Try to avoid expensive operations in this function, as it may cause performance problems.}}|since=L4D2}}
}}}}
{{KV|Lag Compensation (LagCompensate)|boolean|Set to Yes to lag compensate this entity. Should be used very sparingly!|since=AS}}
{{#if:{{{csgo|}}}|
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity. {{not in FGD}}|since=CSGO}}
| }}{{#if:{{{csgo|}}}||{{#if:{{{basehl2|}}}||
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity. {{not in FGD}}|since=CSGO}}
}}}}
 
[[Category:Keyvalue Templates|Global]]

Revision as of 09:47, 24 July 2018

This template is our holder for all keyvalues that are assigned through CBaseEntity. The template has a very specific syntax that you must follow to apply properly, because new games have added new features throughout the years. See Help:Templates for more info on named parameters.

{{KV BaseEntity}}

No parameters: display keyvalues for ALL games.

{{KV BaseEntity|base=1}}

Base: display keyvalues that have only existed since whatever game added the class (most have existed since HL2, the first Source game).

{{KV BaseEntity|l4d2=1}}

Game as a parameter: display the keyvalues that base displays, AND keyvalues that were added to the class, by the specified game. You can specify as many games as needed. You must specify ALL the games you want to include (e.g. l4d2 will not automatically include l4d keyvalues as well). This is because there are situations like in Portal 2, where the output OnKilled is not available through CBaseEntity, despite being a far descendant of the L4D branch which added it.

All parameters for this template:

  • base
  • l4d
  • l4d2
  • as
  • csgo
Note.pngNote:If you want to edit something on this template, please make sure you edit it in both places. Per-game keyvalues are duplicated, for complex technical reasons.

For full documentation on this family of templates, see FGD Template Prototype. Still confused on something? Ask for help before editing this template.



Classname (classname) ([todo internal name (i)]) <string>
The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
Name (targetname) ([todo internal name (i)]) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) ([todo internal name (i)]) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent (parentname) ([todo internal name (i)]) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Warning.pngWarning:In Counter-Strike: Source, parenting this entity to another can break the map.
Origin (X Y Z) (origin) ([todo internal name (i)]) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (X Y Z) (angles) ([todo internal name (i)]) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.pngNote:This works on brush entities, although Hammer doesn't show the new angles.
Effects (effects) ([todo internal name (i)]) <string> !FGD
Effect flags.
Response Contexts (ResponseContext) ([todo internal name (i)]) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,...
Hammer ID (hammerid) ([todo internal name (i)]) <string> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue.
Minimum CPU Level (mincpulevel) ([todo internal name (i)]) <integer> (in all games since Left 4 Dead) !FGD
Minimum CPU Level allowed for this entity. 0 means all levels allowed.
Maximum CPU Level (maxcpulevel) ([todo internal name (i)]) <integer> (in all games since Left 4 Dead) !FGD
Maximum CPU Level allowed for this entity. 0 means all levels allowed.
Minimum GPU Level (mingpulevel) ([todo internal name (i)]) <integer> (in all games since Left 4 Dead) !FGD
Minimum GPU Level allowed for this entity. 0 means all levels allowed.
Maximum GPU Level (maxgpulevel) ([todo internal name (i)]) <integer> (in all games since Left 4 Dead) !FGD
Maximum GPU Level allowed for this entity. 0 means all levels allowed.
Todo: Better description for all of these.
Disable for Xbox 360 (disableX360) ([todo internal name (i)]) <boolean> (in all games since Left 4 Dead) !FGD
If Yes, disables this entity on the Xbox 360 version of Source.
Glow Backface Multiple (glowbackfacemult) ([todo internal name (i)]) <string> (in all games since Left 4 Dead 2) !FGD
Entity Scripts (vscripts) ([todo internal name (i)]) <scriptlist> (in all games since Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) ([todo internal name (i)]) <string> (in all games since Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) ([todo internal name (i)]) <boolean> (in all games since Alien Swarm)
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) ([todo internal name (i)]) <boolean> (in all games since Counter-Strike: Global Offensive) !FGD
If yes, automatic-aim assistance will target this entity.