$keyvalues: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(I will eradicate unnecessary VDF quote marks from this website!)
Line 1: Line 1:
Embeds an arbitrary block of [[keyvalue]]s into the .mdl file. <code>[[prop_data]]</code> keyvalues are the most common, as they define various properties of [[prop_physics]] models, but there is no limit on what other KVs a mod's programmer might add support for.
{{warning|Since the values are arbitrary, [[studiomdl]] can't check that they're correct when it compiles them.}}
== Examples ==
  $keyvalues
  $keyvalues
* This allows you to add an arbitrary block of keyvalues into the .mdl file.  
{
prop_data
{
base              Wooden.Small
dmg.bullets      0
explosive_damage  100
explosive_radius  100
}
}


* [[Prop Data]] keyvalues are probably the most important, defining breakable gibs, damage, etc for [[prop_physics]] models, etc. Eg
  $keyvalues
  [[$keyvalues]]
  {
  {
    [["prop_data"]]
build_points
    {
{
        "base"              "Wooden.Small"
build_point_0
        "dmg.bullets"      "0"
{
        "explosive_damage"  "100"
valid_objects
        "explosive_radius"  "100"
{
    }
obj_manned_plasmagun 1
obj_resourcepump 1
obj_shieldwall 1
}
}
build_point_1
{
(...)
}
}
  }
  }


* Another example:
  $keyvalues
  [[$keyvalues]]
  {
  {
    [["build_points"]]
''// This is an example KV. It won't be recongised by any of Valve's games!''
    {
''// (If you were being picky, you might point out that this ought to be a [[localised]] string...)''
      "build_point_0"
hud_name "Rubber chicken with a pulley in the middle"
      {
          "valid_objects"
''// Of course, we can still include other KVs that ARE read.''
          {
prop_data
            "obj_manned_plasmagun" 1
{
            "obj_resourcepump" 1
(...)
            "obj_shieldwall" 1
}
          }
      }
    }
  }
  }


[[Category:QC Commands]]
[[Category:QC Commands]]

Revision as of 12:44, 28 March 2008

Embeds an arbitrary block of keyvalues into the .mdl file. prop_data keyvalues are the most common, as they define various properties of prop_physics models, but there is no limit on what other KVs a mod's programmer might add support for.

Warning.pngWarning:Since the values are arbitrary, studiomdl can't check that they're correct when it compiles them.

Examples

$keyvalues
{
	prop_data
	{
		base              Wooden.Small
		dmg.bullets       0
		explosive_damage  100
		explosive_radius  100
	}
}
$keyvalues
{
	build_points
	{
	 	build_point_0
	 	{
	 		valid_objects
	 		{
	 			obj_manned_plasmagun 1
	 			obj_resourcepump 1
	 			obj_shieldwall 1
	 		}
	 	}
		build_point_1
		{
			(...)
		}
	}
}
$keyvalues
{
	// This is an example KV. It won't be recongised by any of Valve's games!
	// (If you were being picky, you might point out that this ought to be a localised string...)
	hud_name "Rubber chicken with a pulley in the middle"

	// Of course, we can still include other KVs that ARE read.
	prop_data
	{
		(...)
	}
}