From Valve Developer Community
Note: This entity is now also available in Team Fortress 2.
It inserts an instance of another VMF file into the current one. You can translate and rotate the instance without breaking anything or creating an off-grid editing nightmare. By default, instances are drawn in Hammer with an orange tint.
Warning:Self recursive instances (i.e. instances which includes themselves) will crash Hammer.
Note:VBSP will only transform entities in the FGD it loads from gameinfo.txt's
GameDatakey. If your custom entities are being misplaced, this is the most likely cause.
Tip:Instances can be used with pre-L4D2 games by collapsing them before each compile.
Tip: gameinfo.txt has an InstancePath parameter that defines where instances are stored. If you try to reference files that aren't in this folder, you will have to manually type in the filename of your instance's .vmf (file path is relative to the parent .vmf)
light_spot does not appear to adjust its pitch value when it is part of a rotated instance.
The func_instance does not work correctly in the Source 2009 Engine Branch. It is recommended you use a Prefab instead.
func_viscluster does not function when placed inside of an instance.
Input through an instance
- Define a Fix Up Name.
- Define a value for the input or output you want to use (if there is one).
- Send an input to the targetname "fixupname-value", e.g. MyInstance-Start. Hammer's UI won't recognise the name, but don't worry.
- VMF Filename
- The VMF file to insert as an instance.
- Fix Up Name
- Essentially the name of the instance. All entities within it will have this string added to them based upon the fix up style. If no name is provided,
AutoInstanceXwill be used, where X is a number that is incremented with each instance.
Note:Entity names that start with the
@symbol e.g. @exit_door will not be changed by the instance name fix up. To do: only confirmed for Portal 2
- Entity Name Fix Up
- How to apply the fix up name.
- Prefix (Default)
<string $variable> <string value>
- This is a replacement parameter. Any usage of
$variableinside the instance will be replaced with
- Example: $color 255 0 0
- Pitch Yaw Roll (Y Z X)
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
- func_instance_parms - Entity to control parameters within instances.
- func_instance_io_proxy - Entity that is used as a proxy for entity I/O within instances.
- func_instance_origin - Helper entity that defines the center point of an instance.
- L4D2 Level Design/VMF Instances - A tutorial on how to use this entity in Left 4 Dead 2.