December 11, 20187 yr Haven’t found a clean solution to check what region my player is in. At the moment using getMap().getBaseX() and getMap().getBaseY() but this varies slightly depending on how my player accessed the position in the region. With a rough calc I’m able to work it out, but as I said it’s a bit dirty. Are there any cleaner solutions? Edited December 11, 20187 yr by jca
December 11, 20187 yr Author 7 minutes ago, Eliot said: getMap().getRegion() As far I’m aware that doesn’t give any information that helps you identify the region you’re currently in. It only gives you access to getClippingPlanes() and getTiles()...
December 12, 20187 yr 9 hours ago, jca said: As far I’m aware that doesn’t give any information that helps you identify the region you’re currently in. It only gives you access to getClippingPlanes() and getTiles()... What info are you trying to get about the region?
December 12, 20187 yr Author Identify the region my player is in so I can then perform logic, for example @Eliot if ( isInRegion(region) ){ doA(); } else { doB(); } Edited December 12, 20187 yr by jca
December 12, 20187 yr 1 hour ago, jca said: Identify the region my player is in so I can then perform logic, for example @Eliot if ( isInRegion(region) ){ doA(); } else { doB(); } Why not just use areas? if (area.contains(myPlayer()) { ... } Edited December 12, 20187 yr by Eliot
December 12, 20187 yr Author 6 minutes ago, Eliot said: Why not just use areas? if (area.contains(myPlayer()) { ... } Yeah... well that’s one option. The area I need to check is huge (the size of the region, basically 104x104). My logic is if it’s already defined as a region and I could check that then it makes more sense then defining a massive area. But if there’s not really a better way then areas will have to do.
December 12, 20187 yr 5 minutes ago, jca said: Yeah... well that’s one option. The area I need to check is huge (the size of the region, basically 104x104). My logic is if it’s already defined as a region and I could check that then it makes more sense then defining a massive area. But if there’s not really a better way then areas will have to do. You don't need to define the area. Since it's big just get the bottom left and top right coordinates and that's all you need to check and see if you're within an area.
December 12, 20187 yr Author 3 minutes ago, dreameo said: You don't need to define the area. Since it's big just get the bottom left and top right coordinates and that's all you need to check and see if you're within an area. That’s still defining an area... it’s not an issue. Just if there was an option with regions it feels better to use. But maybe it’s not possible.
December 12, 20187 yr 1 minute ago, jca said: That’s still defining an area... it’s not an issue. Just if there was an option with regions it feels better to use. But maybe it’s not possible. You made it sound like it's an issue when you said the area is large. Which I said, you don't need to actually define an area.. you just need 2 coordinates. You're doing the same with with a region that you would with an area. Idk why you're hard stuck on regions.
December 12, 20187 yr Author 6 minutes ago, dreameo said: You made it sound like it's an issue when you said the area is large. Which I said, you don't need to actually define an area.. you just need 2 coordinates. You're doing the same with with a region that you would with an area. Idk why you're hard stuck on regions. Ah I’m not really, I just wondered if there was a way. Again, theoretically dealing with a large area feels like it should be handled by region checking. But I can stick with areas, thanks for your thoughts and @Eliot Edited December 12, 20187 yr by jca
Create an account or sign in to comment