Func instance: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 20: Line 20:
{{ModernTip| [[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)}}
{{ModernTip| [[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)}}


{{ModernBug|{{as}} Nested instances with relative file names don't work correctly in Alien Swarm, because they are handled differently in Hammer and VBSP. (verify? may be because of incorrectly set up gameinfo.txt)}}
{{ModernBug|{{as}} Nested instances with relative file names don't work correctly in Alien Swarm, because they are handled differently in Hammer and VBSP. {{confirm}} (May be because of incorrectly set up gameinfo.txt)}}
{{ModernBug| [[light_spot]] will behave unpredictably when part of an instance that alters the light's pitch. This is solved by collapsing the instance or using the light's "Entity to point at" keyvalue.}}
{{ModernBug| [[light_spot]] will behave unpredictably when part of an instance that alters the light's pitch. This is solved by collapsing the instance or using the light's "Entity to point at" keyvalue.}}
{{ModernBug| Will not work correctly in the Source 2009 Engine Branch. It is recommended you use a [[Prefab]] instead.}}
{{ModernBug| Will not work correctly in the Source 2009 Engine Branch. It is recommended you use a [[Prefab]] instead.}}

Revision as of 11:59, 9 December 2023

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)
func_instance
Missing entity icon.png
TypeInternal Point entity
EngineSource Source
AvailabilityIn all games
 

Template:Entity 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 a lot.

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. Relative to the current map's location.
PlacementTip.pngExample:
  • If map.vmf and the instance.vmf are in the same folder, the filename field would be instance.vmf
  • If the instance.vmf is in a subfolder of where the map.vmf is, the filename field would be subfoldername/instance.vmf
  • If the instance.vmf and your map.vmf are neither in the same folder, nor in a subfolder of eachother, (Like maps/instances/instance.vmf and maps/project/map.vmf) you can use ../ to "pop" a folder out, in order to enter a new one. As such: ../Instances/instance.vmf
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.

Template:ModernNote

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.

Template:ModernNote


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