Keyvalue
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)