HoldPosition (Package Template)

From the CreationKit Wiki
Jump to navigation Jump to search

Purpose[edit | edit source]

Hold Position Packages allow you to restrain a character's combat movement to a radius around a location.


They allow you to:

  • Prevent enemies in nearby rooms from being drawn into a different combat encounter.
  • Force a mage or archer to attack from a specific location, such as a balcony or lookout point.


They do not:

  • Restrain the movement of enemies outside of combat.
    • For example, enemies on patrol routes or searching for the player are not restrained. If you need to prevent them from wandering, adjust their patrols or non-combat packages.
  • Restrain the movement of enemies who have no ranged attacks.
    • This is hard-coded: enemies with no ranged attacks will completely ignore all packages that try to restrain their movement. The only way to 'solve' this is to give the enemy a ranged weapon or spell.


Using Hold Position Packages[edit | edit source]

Hold Position Packages must be set up as Combat Override Package Lists on the Actor Form. This means that Hold Position enemies are different actors than non-Hold Position enemies.


A number of enemies already have Hold Position Packages set up. To see a list of ready-made enemies that use this package, search for 'Lvl*HoldPosition'. Most of these names indicate the type of enemy (eg. LvlForswornMissile) and the radius of the package (128, 256, ...). Some also note the Named Linkref that must be used (LinkCustom02) or that the enemy can be 'released' from the package (UntilReleased).


If you need to set up your own Hold Position Actor, duplicate an existing Hold Position Actor with the properties (radius, etc.) that you want, then change the ActorBase field to the type of enemy you want.


To use a Hold Position Actor:

  • Place them in the world (or swap them with an existing reference).
  • Place a marker (such as an XMarker or XMarkerHeading) at the center of where you want them to hold position.
  • Create a Named Linkref from the reference to the marker.
    • To determine what name to use, open the Actor's Packages tab, and check the name of the package. By convention, it's often LinkCustom02.


Some Hold Position Actors can be 'Released' from their Hold Position, which is useful if you want the enemy to pursue the player if he rushes past them. The UntilRelease packages have a condition that checks the actor's Actor Value Variable06. If it's zero (the default), they Hold Position; if not, they don't. You can set this Actor Value through script, such as by using the defaultSetAV trigger.