Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Walk to exact coordinate

Joined
Oct 7, 2017
Messages
2
A simple problem; I need to walk to an exact coordinate. When using any CoordinatePath subclasses (BresenhamPath, PredefinedPath, RegionPath) I typically walk to a near-by tile, and not to the exact coordinate specified. I tried setSetpDeviation to 0, but that did not help.

I have had more success with getInteractablePoint on the coordinate and then calling click. However this occasionally clicks on something walking by. Doing interact("Walk here") does not seem to work.

Anyone know the right way to walk to an exact coordinate?
 
Joined
Oct 7, 2017
Messages
2
(unable to edit above post)

Doing interact("Walk here") on the coordinate object seems to work. I missed that it inherited interact. Still unsure if this is the best way to achieve what I am trying to do.
 
Joined
Aug 25, 2017
Messages
270
That's what I do. You can also use ViewPort path, but if you want to only go to a single specific coordinate, coordinate.interact("Walk here") works well.
 
Joined
Jun 8, 2017
Messages
187
I personnaly use viewport path, something like this:

BresenhamPath bresenhamPath = BresenhamPath.buildTo( //Coord// );
ViewportPath viewportPath = ViewportPath.convert(bresenhamPath);
if (viewportPath!= null) {
viewportPath.step();
}
 
Top