Psvxe Posted March 24, 2016 Share Posted March 24, 2016 Searched around but couldn't find the right answer. Perhaps I just didn't notice it but I think my question isn't asked at all. Please let me explain the problem I have. I need to walk to a coordinate. The fastest route is trough a dangerous zone (red dots) and the safe route (green dots) is a bit longer. Now it will simply walk to the end-coordinate (purple dot) trough the dangerous zone and I don't want that. What I did try is to something like WebWalkEvent evt = new WebWalkEvent(Manager.routeFinder, new Position(1500, 1700, 0), new Position(1000, 1000, 0), new Position(2222,2222,0);However it wouldn't walk any further than when it reached the first coordinate I set (1500, 1700, 0). Any solutions without setting pre-defined paths? Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted March 24, 2016 Share Posted March 24, 2016 There's api.webwalk.impl.AvoidProxy which you can use to avoid certain areas. MGI posted this as an example: INodeRouteFinder finder = INodeRouteFinder.createAdvanced(); for (INodeScript script : finder.scripts()) { finder.remove(script); finder.add(new AvoidProxy(script, true, BLOCK_AREA_1, BLOCK_AREA_2)); } 2 Quote Link to comment Share on other sites More sharing options...
Psvxe Posted March 24, 2016 Author Share Posted March 24, 2016 (edited) There's api.webwalk.impl.AvoidProxy which you can use to avoid certain areas. MGI posted this as an example: INodeRouteFinder finder = INodeRouteFinder.createAdvanced(); for (INodeScript script : finder.scripts()) { finder.remove(script); finder.add(new AvoidProxy(script, true, BLOCK_AREA_1, BLOCK_AREA_2)); } Thanks, this will solve the current issue for now I have! However, I still would like to know if my question is possible. Since I had to bypass a certain situation a while back because of the above stated question, too. I can't use areas to solve that. Edited March 24, 2016 by Psvxe Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted March 24, 2016 Share Posted March 24, 2016 (edited) Well if you do WebWalkEvent evt = new WebWalkEvent(Manager.routeFinder, new Position(1500, 1700, 0), new Position(1000, 1000, 0), new Position(2222,2222,0); it will stop at any of the destinations you specified, (1500,1700) (1000,1000) and (2222,2222). If you want to walk from A to B passing some waypoints you could just execute multiple WWevents, one for each waypoint right? Another option might be to change the costs for waypoints, similar to how it's done for avoidproxy which basically sets the cost to 999999 for specific nodes, you could try to set it to a small or negative value. Not sure if this would work tho... Edited March 24, 2016 by Flamezzz Quote Link to comment Share on other sites More sharing options...
Psvxe Posted March 24, 2016 Author Share Posted March 24, 2016 Well if you do WebWalkEvent evt = new WebWalkEvent(Manager.routeFinder, new Position(1500, 1700, 0), new Position(1000, 1000, 0), new Position(2222,2222,0); it will stop at any of the destinations you specified, (1500,1700) (1000,1000) and (2222,2222). If you want to walk from A to B passing some waypoints you could just execute multiple WWevents, one for each waypoint right? Another option might be to change the costs for waypoints, similar to how it's done for avoidproxy which basically sets the cost to 999999 for specific nodes, you could try to set it to a small or negative value. Not sure if this would work tho... Yeah, I just figured that out since I found out the javadocs are back online. haha Using different WebWalkEvent for just walking to one end-coordinate feels messy. I could try the last option you gave me though. No clue if that will work. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 24, 2016 Share Posted March 24, 2016 Any solutions without setting pre-defined paths? The positions you enter arent checkpoints. Those are destinations, the webwalker will walk to the closest position possible Use the avoidproxy script to block out areas ^^ Quote Link to comment Share on other sites More sharing options...