Jump to content

Path Problem


Titan Rs

Recommended Posts

Hi guys

So i'm trying to traverse a dungeon that's a very windy path. At the start of the path. it just try's to skip major parts of the path and then the player stands still against the wall stuck. Anyway around this?

 

 

 cb4c27bdad8fd0b2803f7555c36c67db.png

Here's my code. Any help appreciated. This isn't the actual dungeon becuase i don't really want to give away my method. The dungeon i have has gates hence the code below

public boolean walkToDestination(final Position[] positions, final BooleanSupplier bc, final boolean walkExact){
    WalkingEvent walkingEvent = new WalkingEvent();
    walkingEvent.setPath(new LinkedList<>(Arrays.asList(positions)));
    walkingEvent.setBreakCondition(new Condition() {
        @Override
        public boolean evaluate() {
            return bc.getAsBoolean();
        }
    });
    if (walkExact)
    walkingEvent.setMinDistanceThreshold(0);
    walkingEvent.setMiniMapDistanceThreshold(0);
    walkingEvent.setEnergyThreshold(random(5, 15));
    return execute(walkingEvent).hasFinished();
}

In code
walkToDestination(Paths.TOPSECRETPATH, () -> getInventory().contains("Lobster") && (getSkills().getDynamic(Skill.HITPOINTS) < (getSkills().getStatic(Skill.HITPOINTS) / 1.5) || ((getObjects().closest(o -> o != null && o.getName().contains("Gate") && o.hasAction("Open") && getMap().distance(o) < 5) != null))), false);
Edited by Titan Rs
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...