Korzag 0 Share Posted June 8, 2019 I'm currently trying to write my own script to mine Motherlode and trying to solve the problem of getting to and from the bank area to the mining areas. There is a really nice spot in the south-eastern part of the map that is blockaded by three "rockfall" 's. I've tried using the the AStarPathFinder which seems to have support for obstacles, but it struggles for some reason I've yet to figure out. I have the deposit box and the starting area for my "work area" hard coded in. So essentially what I do is this: //Only done once PathFinder pathFinder = script.getWalking().getAStarPathFinder(); pathFinder.addObstacle(new DestructableObstacle("Rockfall", "Mine", null, null, null)); //Done when I want to try to move to the work area Tile playerTile = script.getLocalPlayer().getTile(); Tile workArea = new Tile(3769, 5642); pathFinder.calculate(playerTile, workArea); pathFinder.walk(); When I do this logic and there are obstacles in the way, my character just stands there. I've called path().size() on the pathFinder object and it returns 0 (where if there are no obstructions it finds it fine). Anyone have any ideas for me? At the point I'm about to just hard code a path to follow since it's only a few skips, but I'd rather implement a much more rigorous method so I don't have to program new paths when I unlock the upper area (although that will be a ClimeableObstacle and not a DestructableObstacle, but I'd think the same issue would persist). Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now