Func instance: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added note about a bug that is fixed in L4D2, but not in AS.)
No edit summary
Line 1: Line 1:
{{point ent|func_instance|internal=1}}
{{point ent|func_instance|internal=1}} 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 with an orange tint.
 
{{note|Instances will only compile correctly in Left 4 Dead 2 or later.}}


{{bug|Although found and working in the Hammer editor for all Source games, it is currently supported by the map compilers for [[Left 4 Dead 2]], [[Alien Swarm]] and [[Portal 2]] only.}}
{{bug|Nested instances with relative file names don't work correctly in Alien Swarm, because they are handled differently in Hammer and VBSP.}}
{{bug|Nested instances with relative file names don't work correctly in Alien Swarm, because they are handled differently in Hammer and VBSP.}}
{{intent}}
{{intent}}


==Entity Description==
== Input through an instance ==
An entity for placing an [[instance]] of a map file. You may translate and rotate this entity.  
 
You can use the replace keys to do parameter changes on the instance contents.  In a $ at the
# Define a Fix Up Name.
beginning of a variable name. Then just use the $variable name inside of the instance contents on any
# Define a value for the input or output you want to use (if there is one).
value portion of a key/value pair.
# 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==
==KeyValues==
{{KV Angles}}
 
; Fix Up Name <code><target_source></code>
; VMF Filename <code><string></code>
: The name that all entities will be fixed up with based upon the fix up style.
: The VMF file to insert as an instance.
; VMF Filename <code><instance_file></code>
; Fix Up Name <code><string></code>
: This indicates a map file relative to the map's file name.
: Essentially the name of the instance. All entities within it will have this string added to them based upon the fix up style.
; Entity Name Fix Up <code><choices></code>
; Entity Name Fix Up <code><choices></code>
: Fixup style for instanced entity names.  Uses the 'Fix Up Name' field.
: How to apply the fix up name.
:* Prefix (Default)
:* Prefix (Default)
:* Postfix
:* Postfix
:* None
:* None
; Replace <code><instance_variable></code>
; Replace <code><string $variable> <string value></code>
: This is a replacement parameter. It goes in the form of $variable value.  All entities inside of that instance that have $variable somewhere will be replaced with the value contents. Example: $color 255 0 0
: This is a replacement parameter. Any usage of <code>$variable</code> inside the instance will be replaced with <code>value</code>.
: Example: $color 255 0 0
{{KV Angles}}


==See also==
==See also==
Line 29: Line 35:
*[[func_instance_io_proxy]] - Entity that is used as a proxy for entity I/O within instances.
*[[func_instance_io_proxy]] - Entity that is used as a proxy for entity I/O within instances.
*[[L4D2 Level Design/VMF Instances]] - A tutorial on how to use this entity in Left 4 Dead 2.
*[[L4D2 Level Design/VMF Instances]] - A tutorial on how to use this entity in Left 4 Dead 2.
[[Category:Left 4 Dead 2 Entities]]
[[Category:Alien Swarm Entities]]
[[Category:Portal 2 Entities]]

Revision as of 05:02, 11 May 2011

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 with an orange tint.

Note.pngNote:Instances will only compile correctly in Left 4 Dead 2 or later.
Icon-Bug.pngBug:Nested instances with relative file names don't work correctly in Alien Swarm, because they are handled differently in Hammer and VBSP.  [todo tested in ?]

Template:Intent

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 <string>
The VMF file to insert as an instance.
Fix Up Name <string>
Essentially the name of the instance. All entities within it will have this string added to them based upon the fix up style.
Entity Name Fix Up <choices>
How to apply the fix up name.
  • Prefix (Default)
  • Postfix
  • None
Replace <string $variable> <string value>
This is a replacement parameter. Any usage of $variable inside the instance will be replaced with value.
Example: $color 255 0 0
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