Func instance parms

From Valve Developer Community
Revision as of 16:16, 13 February 2011 by ThaiGrocer (talk | contribs) (→‎Usage)
Jump to navigation Jump to search

Template:Wrongtitle func_instance_parms is a point entity for all Source games. Place one copy of this entity inside of an instance. Whenever you add a $parameter for the instance, get the properties of this entity. It will auto-populate it with the variables and allow you to indicate the variable type.

Template:Intent

Stub

This article or section is a stub. You can help by expanding it.

KeyValues

  • parm1-10:
Parm <instance_parm>
This is a parameter. It goes in the form of $variable type [default value].

Usage

Alien Swarm SDK has great examples of the use of func_instance_parms in instances. Some instances containing func_instance_parms are used in mapsrc/ASI-Jac1-LandingBay_01.vmf:

  • mapsrc/instances/railings_80square.vmf
  • mapsrc/instances/landingbay_door_unlocked_01.vmf
  • mapsrc/instances/spawners/floor_spawn_holdout01.vmf

One such case is railings_80square.vmf. It is a complex set of models that are placed repeatedly throughout the map with varying colors. func_instance_parms is added to the actual VMF/map file that contains the prefab (i.e. treated as an instance) and can "pass along" parameters to any func_instance that refers to it. In other words, each func_instance that refers to that VMF/map file containing the model set can have a different color set up.

See also

func_instance

External links