Difference between revisions of "MoveTo"
Jump to navigation
Jump to search
imported>Scruggs |
imported>Wrye m (Link to summon object.) |
||
Line 4: | Line 4: | ||
MoveTo HiddenCaveMarker | MoveTo HiddenCaveMarker | ||
MoveTo player, 512, 0, 0 | MoveTo player, 512, 0, 0 | ||
Moves the object to the specified reference's location. The x, y, z are optional offsets in [[Oblivion Units|units]] from the target reference. | Moves the object to the specified reference's location. The x, y, z are optional offsets in [[Oblivion Units|units]] from the target reference. | ||
'''Notes:''' | '''Notes:''' | ||
* If this function is used to move the player, it will also act as a [[Return]] function -- no following lines of the script will be processed. | |||
*If this function is used to move the player, it will also act as a [[Return]] function -- no following lines of the script will be processed. | * 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: | ||
*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: | |||
<pre>myObject.disable | <pre>myObject.disable | ||
myObject.moveTo [location] | myObject.moveTo [location] | ||
Line 19: | Line 15: | ||
set xp to myObject.getPos x | set xp to myObject.getPos x | ||
myObject.setPos x xp</pre> | myObject.setPos x xp</pre> | ||
* To adjust the object relative to the players heading (i.e. place it in front of the player), you'll need to offset it's position. See [[Summon Object]] for full code sample. | |||
*Script functions that make one actor target another (like [[SayTo]] or [[StartCombat]]) will not work when MoveTo is used on the target in the same frame, even when the target is moved only by a few inches. | * Script functions that make one actor target another (like [[SayTo]] or [[StartCombat]]) will not work when MoveTo is used on the target in the same frame, even when the target is moved only by a few inches. | ||
==See Also== | ==See Also== | ||
[[PositionWorld]] | * [[PositionWorld]] | ||
[[PositionCell]] | * [[PositionCell]] | ||
* [[Summon Object]] | |||
[[Category: Functions]] | [[Category: Functions]] | ||
[[Category: Movement Functions]] | [[Category: Movement Functions]] |
Revision as of 19:53, 7 May 2007
Syntax:
MoveTo MarkerID, [x, y, z] (optional)
Example:
MoveTo HiddenCaveMarker MoveTo player, 512, 0, 0
Moves the object to the specified reference's location. The x, y, z are optional offsets in units from the target reference.
Notes:
- If this function is used to move the player, it will also act as a Return function -- no following lines of the script will be processed.
- 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
- To adjust the object relative to the players heading (i.e. place it in front of the player), you'll need to offset it's position. See Summon Object for full code sample.
- Script functions that make one actor target another (like SayTo or StartCombat) will not work when MoveTo is used on the target in the same frame, even when the target is moved only by a few inches.