April 6, 20169 yr GroundItem khaleesi= getGroundItems().closest(gI -> gI.getName().equals("Khaleesi") && gI.hasAction("Touch")); WalkingEvent walkingEvent = new WalkingEvent(khaleesi); walkingEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3; } }); execute(walkingEvent); When doing above, it is not going to walk to the ground item but when i do following; WalkingEvent walkingEvent = new WalkingEvent(khaleesi.getPosition()); walkingEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3; } }); execute(walkingEvent); It does walk, so, any reason why WalkingEvent needs .getPosition() for GroundItems for it to walk to it ? Edited April 6, 20169 yr by iJodix
April 6, 20169 yr GroundItem khaleesi= getGroundItems().closest(gI -> gI.getName().equals("Khaleesi") && gI.hasAction("Touch")); WalkingEvent walkingEvent = new WalkingEvent(khaleesi); walkingEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3; } }); execute(walkingEvent); When doing above, it is not going to walk to the ground item but when i do following; WalkingEvent walkingEvent = new WalkingEvent(khaleesi.getPosition()); walkingEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return myPlayer().getPosition().distance(khaleesi.getPosition()) <= 3; } }); execute(walkingEvent); It does walk, so, any reason why WalkingEvent needs .getPosition() for GroundItems for it to walk to it ? I never tried to walk to an entity but I guess it searches for a walkable position around the entity first so it can generate a path (walking to an unwalkable tile will result in no path found), the method which walks to an entity might simply be broken. Walking to a position is considered "lower level" than walking to an entity so it is generally more stable... but why are you trying to touch @Khaleesi ... :ph34r:
April 6, 20169 yr Author I never tried to walk to an entity but I guess it searches for a walkable position around the entity first so it can generate a path (walking to an unwalkable tile will result in no path found), the method which walks to an entity might simply be broken. Walking to a position is considered "lower level" than walking to an entity so it is generally more stable... but why are you trying to touch @Khaleesi ... Well, it works for entity/objects but doesn't want to work for Ground items and who wouldn't want to touch Khaleesi
April 6, 20169 yr Well, it works for entity/objects but doesn't want to work for Ground items and who wouldn't want to touch Khaleesi Does it work for NPC?
April 6, 20169 yr Yes, works for everything else expect GroundItem Even GroundDecoration? Lol kidding, maybe there is something different in clipping flags for tiles containing GroundItem which the walking code does not handle. I never use anything but the position one because its definately the most stable one. If that one produces an error then all others will 100% be broken too.
April 6, 20169 yr Author Even GroundDecoration? Lol kidding, maybe there is something different in clipping flags for tiles containing GroundItem which the walking code does not handle. I never use anything but the position one because its definately the most stable one. If that one produces an error then all others will 100% be broken too. Well, i'm fine with adding .getPosition(), was just wondering why it doesn't work without .getPosition()
Create an account or sign in to comment