April 15, 20205 yr 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, 20205 yr by Titan Rs
April 15, 20205 yr 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
April 15, 20205 yr "This isn't the actual dungeon becuase i don't really want to give away my method" "walkToDestination(Paths.DUNGEONENTRANCETOWINES"
April 15, 20205 yr Author 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
April 16, 20205 yr 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
Create an account or sign in to comment