Set Actor Location

Post » Sun May 18, 2014 1:09 pm

Right now, I'm able to do essentially a player.GetLocation() and get that Location object. What I'm trying to do now is set an NPC's location to the same as mine. I don't see anything like actor.SetLocation(Location) or anything like that. How do I set that?

User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Sat May 17, 2014 11:29 pm

Have you tried MoveTo or maybe PathToReference?

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

Post » Sat May 17, 2014 9:59 pm

Elias is right. It doesn't really sound like you've fully understood what Locations are? An actor's current location is the the Location of the cell that the actor is currently in. That means you would have to move the actor the right cell for him to have the right location.

User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Sun May 18, 2014 9:18 am

Yes this is what I meant. I couldn't find a way to move that actor to the same Cell as me - the only thing remotely close was to SetLocation to me with an offset - this seems to move them at least to the same Cell I'm in.

User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Sun May 18, 2014 8:26 am

YourActorProperty.MoveTo ( Game.GetPlayer (), 0, 0, 0, true )

the zeros are x- y- and z- offset in units, if you want your npc to appear AT and not IN the player, you'll want to exchange some of these with nice values of your likings :-)

edit: and maybe leave the "true" out in this case. that's for "match rotation", might not be what one wants for an actor)

User avatar
Lauren Denman
 
Posts: 3382
Joined: Fri Jun 16, 2006 10:29 am

Post » Sun May 18, 2014 8:46 am

Thanks, s7o - this is probably how I'll end up doing it. Would you happen to know anything about playing animations? :)

User avatar
Fiori Pra
 
Posts: 3446
Joined: Thu Mar 15, 2007 12:30 pm

Post » Sun May 18, 2014 1:47 am

depends what it is.

generally, you might want take a look into anything that starts with "play.." on http://www.creationkit.com/Category:Papyrus (scroll down!)... :-)

User avatar
kirsty williams
 
Posts: 3509
Joined: Sun Oct 08, 2006 5:56 am


Return to V - Skyrim