MoveTo

From GECK
Jump to: navigation, search
Link to TES4 Construction Set Wiki: MoveTo.

A function included in the GECK version 1.1.0.36.

Description

Moves the object to the specified reference's location with optional axis offset parameters.

Syntax

[help]
[Object].MoveTo MarkerID:ref OffsetX:float OffsetY:float OffsetZ:float

Example

BuddyRef.MoveTo HiddenCaveMarker
BuddyRef.MoveTo Player 512 0 0

Notes

  • MoveTo can trigger the OnLoad block of the moving object, as it seems to essentially reload the object out of then into memory again.
  • MoveTo is an excellent way to move an object from one cell to another.
  • Consider using SetPos if MoveTo doesn't do the trick.
  • If this function is used to move the player, the function will queue up a movement request which will NOT process immediately and will NOT halt script execution.
  • This function works as expected for Actors. For most other object types, like containers and activators, the object's coordinates are updated but its world art is not. Additional scripting may be necessary to ensure the object moves properly:
myObject.Disable
myObject.MoveTo myMarker
myObject.Enable
set xPos to myObject.GetPos X
myObject.SetPos X xPos

Furniture markers must be persistent in order to move actors to them directly.

See Also