Moving player to a certain location

Post » Tue Jan 01, 2013 5:09 am

Hi everyone,

Currently, I'm looking for the correct way to move a player to a certain location. It will not be somewhere specific like a city or a dungeon, but a spot in the wilderness. What would be the best method to do this? How can I get the correct coordinates for the places I choose, in case I use a command that teleports to specific coordinates?

Thanks in advance!
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Tue Jan 01, 2013 6:42 pm

bump
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Tue Jan 01, 2013 1:58 pm

The best way to do this would be to place an XMarkerHeading wherever you want to teleport to and then use a MoveTo command.
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Tue Jan 01, 2013 11:45 am

Thanks a lot! I'll try this right away.
User avatar
Marnesia Steele
 
Posts: 3398
Joined: Thu Aug 09, 2007 10:11 pm

Post » Tue Jan 01, 2013 2:41 am

Well, not unexpectedly, I'm having problems.

I have created a XmarkerHeading. I made it a property of my script. When I use "player.MoveTo(MyRiverwoodWhiterunMarker)" it does nothing. When I use "TranslateToRef(MyRiverwoodWhiterunMarker, 500)", the player moves towards somewhere completely unrelated up in the air (my reference is somewhere between Riverwood and Whiterun, this place is somewhere over a giant camp west of Whiterum), and then drops to her death.

Any ideas?

Edit: This is happening in an OnHit event, if it's relevant.
User avatar
Georgia Fullalove
 
Posts: 3390
Joined: Mon Nov 06, 2006 11:48 pm

Post » Tue Jan 01, 2013 3:23 am

Game.GetPlayer().MoveTo (MyRiverwoodWhiterunMarker) fails too
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Tue Jan 01, 2013 8:06 am

I have NO idea what would cause that. I use MoveTO commands on the player all the time for use in my Portal mod.
EDIT: You could try Game.FastTravel()
User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am

Post » Tue Jan 01, 2013 4:26 am

you might try to place your marker a bit above (as opposed to right on) the ground. maybe you just try to teleport the player underground. PlayerRef.Moveto(YourMarker) should do then.
also, http://www.creationkit.com/MoveTo_-_ObjectReference can be passed paramaters. like z-offset for example. ;-)
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Tue Jan 01, 2013 12:15 pm

Solmyr, are you certain the property has been set correctly and that the marker exists and is in the right place?

The reason I ask is the point in the air over the Whiterun giant camp is actually the coordinate origin of the Tamriel worldspace (aka 0,0,0). Moving or Translating to an invalid reference will sometimes send you there.
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Tue Jan 01, 2013 1:11 pm

I have NO idea what would cause that. I use MoveTO commands on the player all the time for use in my Portal mod.
EDIT: You could try Game.FastTravel()
what's the difference between those (especially with the player being teleported when on a horse, gonna need this in one of my wip's)?
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Post » Tue Jan 01, 2013 1:34 pm

Setting the ReferenceID on the XMarkerHeading helps too for use in scripts which reference it.
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Tue Jan 01, 2013 3:17 am

Thanks a lot for all the replies! I have tried the suggested, but nothing helped. I even tried to use one of the game's own XMarker's, but it didn't work.

Now I suspect a different problem. My script was not self-made, and it loaded multiple .esm files. It is possible that the script itself belonged to the master file rather than the plugin I'm editing, which might be the reason behind the resistance of the game not to recognize the references.

To check if this is the case, I'll create an independent plugin of my own, and try the same thing. Since I'm a bit new to Skyrim scripting, this will probably take a while. I will keep you updated on the results. Thanks once again!
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Tue Jan 01, 2013 6:39 am

in your script that will be moving the player add this:

ObjectRefrence Property MovetoPoint Auto


;move player to designated point

Game.GetPlayer().moveto(MovetoPoint)



save your script, should save fine.

Then go into properties, click on the 'MovetoPoint' and click 'edit value' assign the reference point. (simplest to have the renderview open and at location so you can just select it via that then trying to find it in the list).

save your mod, load it up, do whatever it takes to initiate the move bit, and boom yay!

Please note - Do not put ObjectReference inside a function
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm


Return to V - Skyrim