1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Walk to exact coordinate

Discussion in 'Developer Support' started by runetest1, Oct 14, 2017.

  1. runetest1

    Joined:
    Oct 7, 2017
    Messages:
    2
    Likes Received:
    0
    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?
     
  2. runetest1

    Joined:
    Oct 7, 2017
    Messages:
    2
    Likes Received:
    0
    (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.
     
  3. EthanOpia

    Joined:
    Aug 25, 2017
    Messages:
    272
    Likes Received:
    34
    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.
     
    runetest1 likes this.
  4. SilenceP44

    Joined:
    Jun 8, 2017
    Messages:
    184
    Likes Received:
    87
    I personnaly use viewport path, something like this:

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

Share This Page

Loading...