Keyvalue: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.)
 
(33 intermediate revisions by 17 users not shown)
Line 1: Line 1:
A [[keyvalue]] is information that is used to modify code and set values.
{{LanguageBar|Keyvalue}}
{{distinguish|KeyValues|desc1=the file format}}


=== Hammer & Keyvalues ===
A ''Keyvalue'' is an instruction used to modify the variables in game code.
There are several for each type of entity and are accessed through the [[HammerObjectPropertiesDialog|object properties]] dialog box for the entity.  A [[keyvalue]] can be chosen from the left side of the box and adjusted on the right side.[[category:Glossary]][[category:Level Design]]


{{otherlang:en}}{{otherlang:en:jp|Keyvalue:jp}}
== 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".
 
== 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 ==
* [[KeyValues class]] (programming)
 
 
[[Category:Glossary]][[Category:Level Design]]

Latest revision as of 17:22, 18 July 2025

English (en)日本語 (ja)Русский (ru)中文 (zh)Translate (Translate)
Not to be confused with KeyValues (the file format).

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 Quake refuses (on an engine level) to load KVs that started with an underscore, Valve's engines remove this restriction, with Half-Life 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