Func instance parms: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(As of recent updates, this entity is now available in Team Fortress 2)
No edit summary
Line 46: Line 46:
*vector
*vector
}}
}}
::'''''[default value]''''': The default value of the value type. In the case of value type '''color1''', the default value is 255 255 255.
::'''''[default value]''''': The default value of the value type. In the case of value type '''color1''', the default value is 255 255 255.
 
{{warning| If using a targetname variable, Hammer will add the fix-up name to the variable wherever it's used, i.e. myinstance-$variable}}
==Usage==
==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:  
[[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:  

Revision as of 13:38, 12 September 2017

Template:Point ent When placed inside an instance, it handles conversion between $parameters and the properties of other entities in the instance.

Note.pngNote: As of recent updates, this entity is now available in Team Fortress 2.

KeyValues

parm1 ([todo internal name (i)]) to parm10 <instance_parm>
This is a parameter. It goes in the form of $variable type [default value].
$variable: The $name can be anything and then used as a KeyValue for an entity within the instance. For example, it can be $beamcolor. In turn, $beamcolor is used as the value for the color property (instead of the standard "255 255 255" value) of a prop_static entity, appropriately a metal crossbeam model.
type: It is a value type that is selected from a list. The value type for $beamcolor is color1.
Note.pngNote:It is currently assumed that the type matches the keyvalue that it represents. This will require more testing in order to confirm that.
  • angle
  • angle_negative_pitch
  • axis
  • boolean
  • choices
  • color1
  • color255
  • decal
  • filterclass
  • flags
  • float
  • instance_file
  • instance_parm
  • instance_variable
  • integer
  • material
  • node_dest
  • node_id
  • npcclass
  • origin
  • particlesystem
  • pointentityclass
  • scene
  • script
  • scriptlist
  • side
  • sidelist
  • sound
  • sprite
  • string
  • string_instanced
  • studio
  • target_destination
  • target_name_or_class
  • target_source
  • vecline
  • vector
[default value]: The default value of the value type. In the case of value type color1, the default value is 255 255 255.
Warning.pngWarning: If using a targetname variable, Hammer will add the fix-up name to the variable wherever it's used, i.e. myinstance-$variable

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