Keyvalue: Difference between revisions
m (Spam revert) |
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.) |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar|Keyvalue}} | |||
{{distinguish|KeyValues|desc1=the file format}} | |||
A ''Keyvalue'' is an instruction used to modify the variables in game code. | A ''Keyvalue'' is an instruction used to modify the variables in game code. | ||
== Hammer & Keyvalues == | == Hammer & Keyvalues == | ||
Every type of entity has a number of | 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 (on an engine level) 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. | |||
== See also == | == See also == | ||
* [[KeyValues class]] (programming) | * [[KeyValues class]] (programming) | ||
[[Category:Glossary]][[Category:Level Design]] | [[Category:Glossary]][[Category:Level Design]] |
Latest revision as of 17:22, 18 July 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 (on an engine level) 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)