Keyvalue: Difference between revisions
SirYodaJedi (talk | contribs) No edit summary |
SirYodaJedi (talk | contribs) |
||
Line 6: | Line 6: | ||
== Hammer & Keyvalues == | == Hammer & Keyvalues == | ||
Every type of entity has a number of keyvalues which can be changed from the [[HammerObjectPropertiesDialog|Object Properties]] dialog. The '''key''' is selected on the left side of column and its '''value''' is adjusted on the right side. Colloquially, the keys are frequently referred to simply as "'''KVs'''", with the values redundantly referred to as "the value of the KV". | Every type of entity has a number of keyvalues which can be changed from the [[HammerObjectPropertiesDialog|Object Properties]] dialog. The '''key''' is selected on the left side of column and its '''value''' is adjusted on the right side. Colloquially, the keys are frequently referred to simply as "'''KVs'''", with the values redundantly referred to as "the value of the KV". | ||
== Syntax == | |||
Traditionally, keyvalues which start with an underscore ({{code|_}}) are reserved for map [[compiler]] usage, although this is not always the case. While {{quake|2}} refuses to load KVs that started with an underscore, Valve's engines remove this restriction, with {{hl1|2}}'s game code using the {{mono|_light}} KV in {{ent|light_environment|engine=goldsrc}} to control what color [[MDL (GoldSrc)|MDLs]] are when lit by the sun. | Traditionally, keyvalues which start with an underscore ({{code|_}}) are reserved for map [[compiler]] usage, although this is not always the case. While {{quake|2}} refuses to load KVs that started with an underscore, Valve's engines remove this restriction, with {{hl1|2}}'s game code using the {{mono|_light}} KV in {{ent|light_environment|engine=goldsrc}} to control what color [[MDL (GoldSrc)|MDLs]] are when lit by the sun. |
Revision as of 05:40, 27 March 2025
A Keyvalue is an instruction used to modify the variables in game code.
Hammer & Keyvalues
Every type of entity has a number of keyvalues which can be changed from the Object Properties dialog. The key is selected on the left side of column and its value is adjusted on the right side. Colloquially, the keys are frequently referred to simply as "KVs", with the values redundantly referred to as "the value of the KV".
Syntax
Traditionally, keyvalues which start with an underscore (_) are reserved for map compiler usage, although this is not always the case. While Quake refuses to load KVs that started with an underscore, Valve's engines remove this restriction, with
Half-Life's game code using the _light KV in light_environment to control what color MDLs are when lit by the sun.
See also
- KeyValues class (programming)