Jump to content

Webwalking trough pre-set coords


Psvxe

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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