Page 1 of 1

Function for Prior Position

Posted: Sun Nov 01, 2015 7:42 am
by Avatarati
I created a custom command for @bazaar that takes you to Provenance. For the glimmering troves in the area, an OnTrigger will send the player back to their previous zone. The command that sends them there, however, only has the starting point coordinates.

I'd like to fine tune this further by sending the player back to their last known position in their previous zone. I do not see any function available to call for the last position like I can for the last zone.

Code: Select all

ZoneID = player:getPreviousZone();
        if (ZoneID == nil or ZoneID == 0) then
            player:PrintToPlayer( "Previous Zone was a Mog House or there was a problem fetching the ID.");
        else
            player:setPos( 0, 0, 0, 0, ZoneID );


Is there a way to define a custom function to get the last known coordinates from the previous zone? Or is there something already available I can use?

Appreciate the help, thanks.

Re: Function for Prior Position

Posted: Sun Nov 01, 2015 12:27 pm
by kjLotus
the "previous position" isn't saved anywhere, so you'd have to save it to the database yourself (using player:setVar probably) and then load it back

Re: Function for Prior Position

Posted: Sun Nov 08, 2015 12:41 pm
by Avatarati
Thank you for the response, KJ. I don't know how to translate an entire position to a char variable just yet but I think I have an idea based on some strings I've seen in other lua files though...

I'll play around with it to see if I can do it before asking how.