Rudolph123 Posted April 23 Share Posted April 23 Does anyone have any suggestions for pathing and interacting within an instance where (x,y) coordinates are dynamic and change every time you enter the instance? Currently, since the instances done change only the (x,y) values I was going to create the initial path and interactions, then calculate the correct coordinates based on the players starting position in the instance. However, does anyone have any suggestions for alternative solutions, perhaps a solution that is already solved Quote Link to comment Share on other sites More sharing options...
Alakazizam Posted April 23 Share Posted April 23 1 hour ago, Rudolph123 said: Does anyone have any suggestions for pathing and interacting within an instance where (x,y) coordinates are dynamic and change every time you enter the instance? Currently, since the instances done change only the (x,y) values I was going to create the initial path and interactions, then calculate the correct coordinates based on the players starting position in the instance. However, does anyone have any suggestions for alternative solutions, perhaps a solution that is already solved Find an object that will always be there and get its position Then do some math to set the values of the area you need. myTipJarSpace = getObjects().closest("Tip jar space"); if (myTipJarSpace != null) { int larderAreaX1 = myTipJarSpace.getX() + 3; int larderAreaY1 = myTipJarSpace.getY(); int larderAreaX2 = myTipJarSpace.getX() + 4; int larderAreaY2 = myTipJarSpace.getY() - 1; Area buildLarderArea = new Area(larderAreaX1, larderAreaY1, larderAreaX2, larderAreaY2).setPlane(myPosition().getZ()); I do this in a construction script to set the area I want my larder to be when building the kitchen because I have to rotate the room to get the larder where I want it to be. Quote Link to comment Share on other sites More sharing options...
yfoo Posted April 23 Share Posted April 23 (edited) Generally you shouldn't really care about the exact positions or areas of objects, or at least i don't. The only time I did was Areas of banks. I rely more on the locations of Rs2Objects or Entitles instead since those objects can be easily interacted with using the api, and that is likely what you're going to do anyway. Your dynamic instance is still going to have common Rs2Objects/Entities right, why not use those to navigate instead? Edited April 23 by yfoo 1 Quote Link to comment Share on other sites More sharing options...
Rudolph123 Posted April 23 Author Share Posted April 23 9 hours ago, yfoo said: Generally you shouldn't really care about the exact positions or areas of objects, or at least i don't. The only time I did was Areas of banks. I rely more on the locations of Rs2Objects or Entitles instead since those objects can be easily interacted with using the api, and that is likely what you're going to do anyway. Your dynamic instance is still going to have common Rs2Objects/Entities right, why not use those to navigate instead? 12 hours ago, Alakazizam said: Find an object that will always be there and get its position Then do some math to set the values of the area you need. myTipJarSpace = getObjects().closest("Tip jar space"); if (myTipJarSpace != null) { int larderAreaX1 = myTipJarSpace.getX() + 3; int larderAreaY1 = myTipJarSpace.getY(); int larderAreaX2 = myTipJarSpace.getX() + 4; int larderAreaY2 = myTipJarSpace.getY() - 1; Area buildLarderArea = new Area(larderAreaX1, larderAreaY1, larderAreaX2, larderAreaY2).setPlane(myPosition().getZ()); I do this in a construction script to set the area I want my larder to be when building the kitchen because I have to rotate the room to get the larder where I want it to be. In the case of some instances, there are no objects/entities within render distance. Specifically in my case, the entrance to the instance is the only Rs2Oject within 50+ tiles in any direction. I'm not sure how close I need to be to the Rs2Object in order to interact with it. I suppose I can walk in a general direction of the nearest object I want to interact with until its populated in the script. I will try this, thanks for the input. Quote Link to comment Share on other sites More sharing options...