Difference between revisions of "MoveTo"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>DZastreux
imported>Geckbot
m (Robot: Automated text replacement (-\[\[Category:(.*?)\(GECK 1.0\)\]\] +Category:\1(GECK 1.1)))
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Function
|CSWikiPage = MoveTo
|origin = GECK1
|summary = Moves the object to the specified reference's location with optional axis offset parameters.
|name = MoveTo
|referenceType = [Object]
|arguments =
  {{FunctionArgument
  |Name = MarkerID
  |Type = ref
  }}{{FunctionArgument
  |Name = OffsetX
  |Type = float
  |Optional = y
  }}{{FunctionArgument
  |Name = OffsetY
  |Type = float
  |Optional = y
  }}{{FunctionArgument
  |Name = OffsetZ
  |Type = float
  |Optional = y
  }}
|example = BuddyRef.MoveTo HiddenCaveMarker
BuddyRef.MoveTo Player 512 0 0
}}


=='''Description'''==
== Notes ==
*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:


'''MoveTo''' Moves the object to the specified reference's location. The x, y, z are optional offsets from the target reference.
myObject.Disable
myObject.MoveTo myMarker
myObject.Enable
set xPos to myObject.GetPos X
myObject.SetPos X xPos


=='''Syntax'''==
*The trick above won't work with pre-loaded furnitures : It seems neither [[MoveTo]] nor [[SetPos]] are allowed with furniture objects unless they are spawned with the [[PlaceAtMe]] function.


[''ObjectRef''].MoveTo ''MarkerID, x, y, z (optional)''
==See Also==
 
*[[PlaceAtMe]]
=='''Examples'''==
*[[SetPos]]
 
*[[GetPos]]
BuddyRef.MoveTo HiddenCaveMarker
*[[GetAngle]]
This will move Buddy to the hidden cave marker
*[[SetAngle]]
BuddyRef.MoveTo player, 512, 0, 0
*[[GetHeadingAngle]]
This will move Buddy to the player, slightly offset from the target
*[[Rotate]]
 
=='''Notes'''==
* 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.
* 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
 
* This trick above won't work with furnitures : It seems moveTo can't be used at all with any furniture object.
 
<!--
=='''See Also'''==
[[PositionWorld]]<br>
[[PositionCell]]  
 
=='''Reference'''==
None provided.
[[MoveTo_Reference|List of functions that use MoveTo]] (wiki) -->


[[Category:Functions]]
[[Category:Functions]]
[[Category: Movement Functions]]
[[Category:Functions (GECK 1.1)]]
[[Category:Movement Functions]]
[[Category:Movement Functions (GECK 1.1)]]

Latest revision as of 13:54, 15 August 2009

< [[::Category:Functions|Category:Functions]]

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 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
  • The trick above won't work with pre-loaded furnitures : It seems neither MoveTo nor SetPos are allowed with furniture objects unless they are spawned with the PlaceAtMe function.

See Also