Jump to content
Sign in to follow this  
Titan Rs

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?




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() {
        public boolean evaluate() {
            return bc.getAsBoolean();
    if (walkExact)
    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

Share this post

Link to post
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.

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...