Titan Rs Posted April 15, 2020 Posted April 15, 2020 (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() { @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 April 15, 2020 by Titan Rs
Chris Posted April 15, 2020 Posted April 15, 2020 Split it into blocks if going right half -> left half zone 1 = right half walk to upper zone 2 zone 2 = left half walk to lower zone 2 Reverse to go back 1
ez11 Posted April 15, 2020 Posted April 15, 2020 "This isn't the actual dungeon becuase i don't really want to give away my method" "walkToDestination(Paths.DUNGEONENTRANCETOWINES" 4
Titan Rs Posted April 15, 2020 Author Posted April 15, 2020 8 minutes ago, ez11 said: "This isn't the actual dungeon becuase i don't really want to give away my method" "walkToDestination(Paths.DUNGEONENTRANCETOWINES" lmaooo that was dumb
Khaleesi Posted April 16, 2020 Posted April 16, 2020 16 hours ago, ez11 said: "This isn't the actual dungeon becuase i don't really want to give away my method" "walkToDestination(Paths.DUNGEONENTRANCETOWINES" this ^ =D