KeyValues2

From Valve Developer Community
Jump to: navigation, search

KeyValues2 is an ASCII encoding of a Datamodel object. It is the successor to KeyValues.

The unreleased SDK tool dmxconvert can convert files between KV2 and DMX encoding.

Example

The only KV2 file known to exist publicly is team fortress 2 content.gcf\tf\expressions\player\engineer\phonemes\engineer_phoneme.pre. A truncated version follows:

<!-- DMXVersion keyvalues2_v1 -->
"DmePresetGroup"
{
	"id" "elementid" "2b77ac04-3f32-46eb-a2a7-80f1d6d9872e"
	"name" "string" "phoneme"
	"readonly" "bool" "0"
	"visible" "bool" "1"
	"presets" "element_array" 
	[
		"DmePreset"
		{
			"id" "elementid" "117e1a71-d867-4857-b404-6651f2cdd68a"
			"name" "string" "p_silence"
			"controlValues" "element_array" 
			[
				"DmeElement"
				{
					"id" "elementid" "7a0ba9b3-5434-43fe-94ed-068ced2351e1"
					"balance" "float" "0.5"
					"midpoint" "float" "0"
					"value" "float" "0"
					"name" "string" "CloseLidUp"
				},
				"DmeElement"
				{
					"id" "elementid" "e707ed99-f2f2-4a9a-844d-fc8f3d1eda36"
					"balance" "float" "0.5"
					"midpoint" "float" "0"
					"value" "float" "0"
					"name" "string" "CloseLidLo"
				},
				"DmeElement"
				{
					"id" "elementid" "ae60ee94-7c9a-494c-be01-eba193e90146"
					"balance" "float" "0.5"
					"midpoint" "float" "0"
					"value" "float" "0"
					"name" "string" "InnerSquint"
				}
			]
		}
	]
}