MoveTo
DescriptionEdit
MoveTo Moves the object to the specified reference's location. The x, y, z are optional offsets from the target reference.
SyntaxEdit
[ObjectRef].MoveTo MarkerID, x, y, z (optional)
ExamplesEdit
BuddyRef.MoveTo HiddenCaveMarker
This will move Buddy to the hidden cave marker
BuddyRef.MoveTo player, 512, 0, 0
This will move Buddy to the player, slightly offset from the target
NotesEdit
- If this function is used to move the player, the function will queue up a movement request for him/her which s/he then will process later instead of immediately stopping script execution.
- If called on a reference inside a container, it will remove the ref from the container and move it to the specified location. Note that this only works on persistent references (which is fine in-game but means it may not always work from the console).
- 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 [location] myObject.enable set xp to myObject.getPos x myObject.setPos x xp