Func instance: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 5: Line 5:
Instances allow you to edit the vmf of the instance and have every used instance on your main map be changed as well. But unfortunately many instances will lag hammer quite alot.
Instances allow you to edit the vmf of the instance and have every used instance on your main map be changed as well. But unfortunately many instances will lag hammer quite alot.


{{warning|Self recursive instances (i.e. instances which include themselves) will crash Hammer.}}
{{ModernWarning|Self recursive instances (i.e. instances which include themselves) will crash Hammer.}}


{{ModernNote|Instances are disabled by default in pre-[[Left 4 Dead 2]] games (except Team Fortress 2). To enable them, add a <code>GameData</code> key to [[gameinfo.txt]], pointing to the game's FGD file.}}
{{ModernNote|Instances are disabled by default in pre-[[Left 4 Dead 2]] games (except Team Fortress 2). To enable them, add a <code>GameData</code> key to [[gameinfo.txt]], pointing to the game's FGD file.}}

Revision as of 10:54, 26 July 2022

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

Template:Point ent 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, though this can be disabled in Instancing > View Instances.
Instances allow you to edit the vmf of the instance and have every used instance on your main map be changed as well. But unfortunately many instances will lag hammer quite alot.

Template:ModernWarning

Template:ModernNote Template:ModernNote

Template:ModernTip

Template:ModernBug Template:ModernBug Template:ModernBug Template:ModernBug Template:ModernBug

Input through an instance

  1. Define a Fix Up Name.
  2. Define a value for the input or output you want to use (if there is one).
  3. Send an input to the targetname "fixupname-value", e.g. MyInstance-Start. Hammer's UI won't recognise the name, but don't worry.

KeyValues

VMF Filename (file) <string>
The VMF file to insert as an instance.
Fix Up Name (propagate_fixup) <string>
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, InstanceAutoX or AutoInstanceX will be used, where X is a number that is incremented with each instance.
Note.pngNote:Entity names that start with the @ symbol e.g. @exit_door will not be changed by the instance name fix up.
Todo: only confirmed for Portal 2
Entity Name Fix Up (fixup_style) <choices>
How to apply the fix up name.
  • 0: Prefix (Default)
  • 1: Postfix
  • 2: None
Replace (replace01) <instance_variable>
This is a replacement parameter. Any usage of $variable inside the instance will be replaced with value. Replace <string $variable> <string value>. Example: $color 255 0 0.
Note.pngNote:There are 10 Replace key-value pairs with the keys following replace{number} for names: replace01, replace02, ..., replace10


Pitch Yaw Roll (Y Z X) (angles) <QAngle>
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.

See also