iJodix Posted April 6, 2016 Share Posted April 6, 2016 (edited) 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, 2016 by iJodix Quote Link to comment Share on other sites More sharing options...
Token Posted April 6, 2016 Share Posted April 6, 2016 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: Quote Link to comment Share on other sites More sharing options...
iJodix Posted April 6, 2016 Author Share Posted April 6, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
Token Posted April 6, 2016 Share Posted April 6, 2016 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? Quote Link to comment Share on other sites More sharing options...
iJodix Posted April 6, 2016 Author Share Posted April 6, 2016 Does it work for NPC? Yes, works for everything else expect GroundItem Quote Link to comment Share on other sites More sharing options...
Token Posted April 6, 2016 Share Posted April 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
iJodix Posted April 6, 2016 Author Share Posted April 6, 2016 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() Quote Link to comment Share on other sites More sharing options...