Jump to content

Webwalking trough pre-set coords


Recommended Posts

Posted

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.

e190289a33.png

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?

Posted

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));
}

 

  • Like 2
Posted (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 by Psvxe
Posted (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 by Flamezzz
Posted

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.

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

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...