Author Topic: Store locations within a database  (Read 510 times)

Legacy_Ivanovich

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Store locations within a database
« Reply #15 on: June 08, 2011, 06:06:32 pm »


               Yeah, I think I'll store the location through the three floats and the area name and then rebuild it when the item is activated to assure the location doesn't get messed.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Store locations within a database
« Reply #16 on: June 08, 2011, 10:10:46 pm »


               Why not just store a LocalLocation and the TagOf the Area.

object oPlayer = OBJECT_SELF;
location lPlayer = GetLocation(oPlayer);
string sAreaTag = GetTag(GetArea(oPlayer));

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(925), oPlayer, 0.0);
object oJewel = CreateItemOnObject("starjewel", oPlayer);
SetLocalLocation( oJewel,"JewelLoc",lPlayer);
SetLocalString ( oJewel,"JewelArea",sAreaTag);
SetCutsceneMode(oPlayer, TRUE);
DelayCommand(4.0, SetCutsceneMode(oPlayer, FALSE));


then to rebuild you location to make sure the area is correct would look something like this.

location lLoc = GetLocalLocation( oJewel,"JewelLoc");
string sAreaTag =GetLocalString ( oJewel,"JewelArea");
lLoc = Location(GetObjectByTag(sAreaTag),
                          GetPositionFromLocation( lLoc),
                          GetFacingFromLocation( lLoc)
                          );
               
               

               


                     Modifié par Lightfoot8, 08 juin 2011 - 09:11 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Store locations within a database
« Reply #17 on: June 09, 2011, 12:15:04 am »


               

Lightfoot8 wrote...

then to rebuild you location to make sure the area is correct would look something like this.

location lLoc = GetLocalLocation( oJewel,"JewelLoc");
string sAreaTag =GetLocalString ( oJewel,"JewelArea");
lLoc = Location(GetObjectByTag(sAreaTag),
                          GetPositionFromLocation( lLoc),
                          GetFacingFromLocation( lLoc)
                          );


*Yoinks*

  I'd never considered that only part of the location was becoming invalid on rebuilds.  That fixes up a problem I'd been having in my little mods OnEnter script, being able to rebuild it that way.  I thought I was going to have to go with floats as well, it's why I never bothered fixing it, too much of a nuisance that way.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Store locations within a database
« Reply #18 on: June 23, 2011, 11:30:33 pm »


               NM. Moved my question here: social.bioware.com/forum/1/topic/192/index/7716983
               
               

               


                     Modifié par GhostOfGod, 23 juin 2011 - 11:51 .