heya, i need some information how the getworldtile works in copying regions.
everytime if we copy a region over to the chosen tiles we need. so lets say 8 by 8.
then i will look for free spots to copy the region to.
alright now comes the part that i need clarification on.
everytime if the player gets ported to the copyed region.
which will have different coordinates everytime.
but the getworldtile will stay the same.
the start tile at the very left bottem corner will be worldtile 0, 0, 0
so.. the thing that go's wrong is. if i have a controler which copys a region.
and if i forcewalk a npc to a specified worldtile. then the forced npc will not always walk to my specified spot.
lets say it does it correctly 10% of the time. 90% it's walking way off to the forced location.
as example.
if the player is at stage 1
i want npc 1 to move to my specified location.
walkto = a specified location
walkto2 = another specified location for the npc itself.
if i do the controler 5 times in a row.
the npc only walk to the correct spot for the first time.
if the region gets copyd again the npc is way off the specified location.
Code:
WorldTile walkTo = getWorldTile(24, 29, 0);
WorldTile walkTo2 = getWorldTile(26, 26, 0);
WorldTasksManager.schedule(new WorldTask() {
int loop;
@Override
public void run() {
if (loop == 0) {
player.addWalkSteps(walkTo.getX(), walkTo.getY());
npc1 = new NPC(19068, getWorldTile(27, 20, 0), -1, true, true);
npc1.faceEntity(player);
npc1.addWalkSteps(walkTo2.getX(), walkTo2.getY());
}
loop++;
}
}, 0, 1);
}
}
and the thing i dont know is. how can i specify a getworldtile for only getting the player his x or coordinates in a copyyd region.like.
Code:
else if (stage == your entry && player.getX() == your entry);
the x and y coordinates change per copyed region.i tried making a getworldtile getx code but it failed badly.so i need a getworldtilex code aswell.i hope i explained it a bit right. i could make a giff and upload it about what i mean.ty in advance for all the help.