[Papyrus] Location functions

Post » Mon Jun 18, 2012 5:50 am

Hi,

I'm writing my first Papyrus script and I have a question regarding current locations.

I understand you can do Game.GetPlayer().GetCurrentLocation() to get the current location of your player character. But when I do Debug.MessageBox(Game.GetPlayer().GetCurrentLocation()) it returns None.

I also tried Self.GetCurrentLocation() on an activator, but it also returns None.

Thanks.
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Mon Jun 18, 2012 12:56 am

If the player (or whoever) is in a cell that doesn't have a Location assigned to it, the function will correctly return None. By default, cells do not have Locations - you have to assign them to a Location. Most exterior cells in the Tamriel worldspace, for example, will not have a Location assigned to them.
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm

Post » Mon Jun 18, 2012 4:17 am

Then I have to rethink my initial idea, the script was supposed to teleport the player to different cells based on which location (cell) he activated the activator in.

Tried searching for a function that returns the current cell id, but no luck so far.
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm


Return to V - Skyrim