Zibele 18 Share Posted December 15, 2016 Hey guys,i was writing a script on a minigame and each time i enter an instance of this minigame the coordinates of the specific spot within the instance would change?Could someone help me on how i would go about pathing dynamic coordinates? Link to comment Share on other sites More sharing options...
Im A Baller 348 Share Posted December 15, 2016 you need to find a specific entity on the island that you can relate everything to, in terms of position. pest control had the same issue, and that was how i made a functioning script for it. Link to comment Share on other sites More sharing options...
rokaHakor 171 Share Posted December 15, 2016 I think Player owned Houses have the same issue. Not sure how the construction and teletab scripts work around this. Link to comment Share on other sites More sharing options...
Zibele 18 Author Share Posted December 16, 2016 How would i relate the entity in terms of position if coordinates keep changing? Link to comment Share on other sites More sharing options...
Im A Baller 348 Share Posted December 16, 2016 How would i relate the entity in terms of position if coordinates keep changing? you get the entity's position when you first enter the instance, and instead of using direct tile numbers, shift your tiles and areas proportionally to the entity's position e.g. walk(entity.getX() - 10, entity.getY() + 5, 0) //very basic example Link to comment Share on other sites More sharing options...
Zibele 18 Author Share Posted December 16, 2016 Interesting,is there no other way? Link to comment Share on other sites More sharing options...
Im A Baller 348 Share Posted December 16, 2016 Interesting,is there no other way thats probably the simplest way. it's not that difficult to do (??) Link to comment Share on other sites More sharing options...
Zibele 18 Author Share Posted December 16, 2016 The entities are also dynamic,and i need to create a area within the instance to solve the instance,so yeah that probably wont be enough,but i will figure it out. Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted December 16, 2016 If you tell us what area you're working with, we can help more. I'm sure there's an entity in that area whose position doesn't change relative to other entities. Link to comment Share on other sites More sharing options...
Notorious 342 Share Posted December 16, 2016 Interesting,is there no other way? There is a few ways you can do it, but as @Im A Baller was saying, using a GameObject as reference and offsetting your positions from that object would probably be easiest. If you know a bit of programming and math, you could create your own local pathfinder using the loaded tile region. But it's much more work than simply offsetting them. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.