Just to add 2 cents to the topic, I also do it as L8 suggests whether you do it with a DB or a DBItem. Something like so:
object oPlayer = OBJECT_SELF;
object oDBItem = GetItemPossessedBy(oPlayer, "item tag");
location lPlayer = GetLocation(oPlayer);
string sAreaTag = GetTag(GetArea(oPlayer));
Store Location:
SetLocalLocation(oDBItem ,"MY_LOC" ,lPlayer);
SetLocalString(oDBItem ,"MY_AREA" ,sAreaTag);
Rebuild Location:
location lLoc = GetLocalLocation(oDBItem ,"MY_LOC");
string sAreaTag = GetLocalString(oDBItem ,"MY_AREA");
lLoc = Location(GetObjectByTag(sAreaTag),
GetPositionFromLocation(lLoc),
GetFacingFromLocation(lLoc));
There's no need to store all the separate x,y,z and what not. I also dont use HB to store. Just multiple other events. OnPlayerRest, area OnEnter/OnExit, etc..
Glad to hear you got it worked out.
Modifié par GhostOfGod, 29 janvier 2013 - 03:05 .