Jump to content

Path Problem


Recommended Posts

Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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