crazykid080 14 Author Share Posted November 30, 2020 1 hour ago, una_maquina said: Try redefining the bank area. Go to https://explv.github.io/ and there make the area. Wow that is a really cool tool! I will have to use that more often, I will work on that and see if that helps. It did not help, by any chance would this bank walking error be caused by worldhopping invalidating the area in some way? Link to comment Share on other sites More sharing options...
una_maquina 35 Share Posted December 1, 2020 12 hours ago, crazykid080 said: Wow that is a really cool tool! I will have to use that more often, I will work on that and see if that helps. It did not help, by any chance would this bank walking error be caused by worldhopping invalidating the area in some way? Glad it's a helpful tool, I use it all the time. And I don't think it's a worldhopping issue. If all else fails, you can simply go for Bank class, and just do, Bank.openClosest(), it'll automatically find the closest bank and open it Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 1, 2020 9 hours ago, una_maquina said: If all else fails, you can simply go for Bank class, and just do, Bank.openClosest(), it'll automatically find the closest bank and open it Yeah I might have to start checking distances away from closest because this is a very weird bug I can't seem to understand, because unless the area is wrong (Which is near impossible) there is no way it should count me outside of the area Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 1, 2020 Did some more testing and even doing (!bankArea.contains(localPlayer) || Bank.getClosestBankLocation().getArea(0).getRandomTile().distance(localPlayer) < 10) Still isn't working. Here's the weird thing though, it works fine before hopping worlds, has no issues whatsoever, but the second I hop worlds it breaks Link to comment Share on other sites More sharing options...
holic 233 Share Posted December 2, 2020 5 hours ago, crazykid080 said: Did some more testing and even doing (!bankArea.contains(localPlayer) || Bank.getClosestBankLocation().getArea(0).getRandomTile().distance(localPlayer) < 10) Still isn't working. Here's the weird thing though, it works fine before hopping worlds, has no issues whatsoever, but the second I hop worlds it breaks Output as much info as you can when you're debugging something like this. Throw a couple lines in like this to make sure the thing you're testing is actually what you're meaning to test, something like this: BankLocation bankLocation = Bank.getClosestBankLocation(); log("bankLocation: " + bankLocation); Area bankArea = bankLocation.getArea(); log("bankArea contains: " + bankArea.contains(localPlayer)); Tile randBankTile = bankArea.getRandomTile(); log("localPlayer tile: " + localPlayer.getTile()); log("randBankTile tile: " + randBankTile); log("randBankTile distance: " + randBankTile.distance()); log("randBankTile distance GLP: " + randBankTile.distance(localPlayer)); (!bankArea.contains(localPlayer) || randBankTile.distance() < 10) Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 2, 2020 Well here's an oddity, the distance to the nearest bank location is labeled as -1.0 [SCRIPT] DEBUG STRING: (Player not in bank area): true [SCRIPT] DEBUG STRING: (Distance to nearest bank location)-1.0 Could it be the fact that during world hopping (or logging in) the reference to the local player I create is nullified? Link to comment Share on other sites More sharing options...
holic 233 Share Posted December 2, 2020 Is localPlayer getting properly updated? Try getLocalPlayer() instead (do a static import if you need). How are you checking distance? Link to comment Share on other sites More sharing options...
TheCloakdOne 389 Share Posted December 2, 2020 By using Bank.getClosestBankLocation().getArea(0) your setting the area to 0 so you would never be within it. Either use the getCenter to get the center tile and calculate distance from there or specify a correct area to check against Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 2, 2020 11 hours ago, TheCloakdOne said: By using Bank.getClosestBankLocation().getArea(0) your setting the area to 0 so you would never be within it. Either use the getCenter to get the center tile and calculate distance from there or specify a correct area to check against I don't check that one for if I'm contained within it, that is just a simple conversion because I couldn't see any way to check the distance it was away. 12 hours ago, holic said: Is localPlayer getting properly updated? Try getLocalPlayer() instead (do a static import if you need). How are you checking distance? That's probably why. Time to do some confirmation, and as for distance I used Bank.getClosestBankLocation().getArea(0).getRandomTile().distance(localPlayer) I just did some testing to confirm and from what my tests showed, it is in fact the fact that the localPlayer reference becomes obsolete after world hopping Link to comment Share on other sites More sharing options...
holic 233 Share Posted December 3, 2020 Yeah man, just use getLocalPlayer and if it's because it not in a task node or something, just statically import it and you'll be fine. Also entity.distance() and entity.distance(getLocalPlayer) are the same thing, I believe. Someone correct me if I'm wrong. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.