code2007, here is how to teleport accross chunks within the same continent. The chunks are X,Y based grids with 0,0 in the center. They have a max size of 102,400. The game will automatically adjust you in the correct chunk if "overshoot" your teleport and try to port to say, 300,000.
So you just need a simple formula to take in any X or Y with a chunk X or Y to take advantage of that fact.
This bit of code is from my C# teleporting app I made long ago... Thought I might share...
Code: Register to unlock hidden link
private float calculateDistance(float destValue, Int32 destGrid, Int32 type)
{
Int32 currentGrid = 0;
float newCoordinate = 0;
Int32 gridMax = 102400;
// Get current grid information
Int32 gx = this.mGX.GetInt32();
Int32 gy = this.mGY.GetInt32();
// Set the working grid variable for use in the equation
if (type == 1)
currentGrid = this.mGX.GetInt32();
else if (type == 2)
currentGrid = this.mGY.GetInt32();
// Get the difference grid value
float gridDistance = Math.Abs(currentGrid - destGrid);
// No calculation needed for intra-grid movement
if (gridDistance == 0)
return destValue;
// Calculate base distance
float baseDistance = gridDistance * (gridMax * 2);
// Calculate the new destination
if (Math.Abs(currentGrid) < Math.Abs(destGrid))
newCoordinate = (baseDistance + (destValue * -1)) * -1;
else
newCoordinate = (baseDistance + (destValue));
// Return the newly calculated coordinate
return newCoordinate;
}
Also you need to know that one of the contintents in flipped on axis I believe. You simply need to reverse the function on "calculate new desition" for that particular world. I think It's Qalia?