Author Topic: Issues with seamless area transition - Spawns 2 blocks out.  (Read 297 times)

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« on: October 25, 2011, 05:20:17 pm »


                So, what only happens when going WEST. The PC will spawn 2 blocks out, landing in the third, so.. 20 meters. I need them to spawn where they do every other time I use this system. Any help?
 

The code won't fit... Pastebin.


http://pastebin.myrror.net/3015
               
               

               


                     Modifié par Peepsy, 25 octobre 2011 - 04:23 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« Reply #1 on: October 25, 2011, 05:45:01 pm »


               likely due to this constant:

float fMaxAreaDim = 80.0f;      // 10.0 per tile in one dimension.  (Areas under 3x3 not recommended)


is the area you're heading into 10 squares wide by chance?
               
               

               
            

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« Reply #2 on: October 25, 2011, 05:53:55 pm »


               It surely is. I don't understand, though.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« Reply #3 on: October 25, 2011, 05:54:14 pm »


               

case 4:  // Moving WEST
167               {
168                   --nCurAreaX;
169                   sDestAreaX = GetNumberPadding(nCurAreaX) + IntToString(abs(nCurAreaX));
170                   oArea = GetObjectByTag(sDestAreaX + sCurAreaY + sCurAreaZ);
171                   lLoc = Location(oArea,Vector(fMaxAreaDim- fLandingOffset,vPCVector.y),fPCFacing);
172                   if (nDEBUG) if (GetIsPC(oPC))  SendMessageToPC(oPC,"Moving West:" + "\\nDestination Area X TAG is " + sDestAreaX + "." + "\\nDestination Area Y TAG is " + sCurAreaY + ".");
173                   if ((oArea != OBJECT_INVALID) && (GetAreaFromLocation(lLoc) == oArea))
174                   {
175                       SetLocalInt(oPC,"m_nZoning",TRUE);
176                       TransportEffect(oPC,fTransitionDelay);
177                       if (GetIsPC(oPC))  FloatingTextStringOnCreature("Moving West...",oPC);
178                       DelayCommand(fTransitionDelay,AssignCommand(oPC,JumpToLocation(lLoc)));
179                       DelayCommand(fTransitionDelay,SetLocalInt(oPC,"m_nZoning",FALSE));
180                       DelayCommand(fTransitionDelay,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eZoneEffect3,lLoc));
181                   }
182                   break;
183               }


Line 170 - why are you getting the area by tag -
Does this functionality not run within an area, and merely jump the player back and forth from one end of the map to simulate him traversing similar terrain for long periods of time?

Could GetArea(oPC)  not be used instead?

Perhaps I miss the purpose of the function - in which case - ignore.

I have seen issues where if you have 2 areas (or more), with the same named tag, then try to port to a location generated with the wrong area- it can jump you to the wrong x,y,z coords   (ive ended upinside walls)


If you could modify the script, to pump out debug information about the vector calculations, you could track and see where the problems arise.


my hunch is it might be around this part

169                   sDestAreaX = GetNumberPadding(nCurAreaX) + IntToString(abs(nCurAreaX));
170                   oArea = GetObjectByTag(sDestAreaX + sCurAreaY + sCurAreaZ);
171                   lLoc = Location(oArea,Vector(fMaxAreaDim- fLandingOffset,vPCVector.y),fPCFacing);


But I have no concrete evidence that leads me to that idea - just a hunch.
               
               

               
            

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« Reply #4 on: October 25, 2011, 05:54:36 pm »


               Oh. Wait. So if I change that to 100.0f?
               
               

               
            

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Issues with seamless area transition - Spawns 2 blocks out.
« Reply #5 on: October 25, 2011, 05:57:07 pm »


               You are beautiful Failed.Bard.

Thanks so much

Resolved!