Jump to content

Webwalk Distance from object


Delivery

Recommended Posts

31 minutes ago, xcx said:

Is it possible to view the Webwalking path and get a distance value for a position?

I want to be able to Chop the closest tree to me by distance not distance by a bird's flight.

A Tree might be 2 tiles from me but is actually 14 tiles distance & there could be a 4 tile tree right next to me.

 

getMap().realDistance()

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, xcx said:

Is it possible to view the Webwalking path and get a distance value for a position?

I want to be able to Chop the closest tree to me by distance not distance by a bird's flight.

A Tree might be 2 tiles from me but is actually 14 tiles distance & there could be a 4 tile tree right next to me.

 

 


This will get you all positions in a webwalking path, I guess you could use path.length() :)

WebWalkEvent event = new WebWalkEvent(position);
event.prefetchRequirements(script);

Position[] path = event.getPositions();


 

Edited by Khaleesi
  • Like 1
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...