TFW Posted April 20, 2016 Share Posted April 20, 2016 (edited) moved Edited April 20, 2016 by TFW Link to comment Share on other sites More sharing options...
GaetanoH Posted April 20, 2016 Share Posted April 20, 2016 (edited) Could it be that the Area you are checking is too small and you may use 4-5 as the argument? Edited April 20, 2016 by GaetanoH Link to comment Share on other sites More sharing options...
TFW Posted April 20, 2016 Author Share Posted April 20, 2016 Could it be that the Area you are checking is too small and you may use 4-5 as the argument? Hmm I'll give it another go with a int of 5. Thanks for some wisdom Link to comment Share on other sites More sharing options...
GaetanoH Posted April 20, 2016 Share Posted April 20, 2016 I think you're just overseeing something, I do not get what you're doing in the if-statement Link to comment Share on other sites More sharing options...
Explv Posted April 20, 2016 Share Posted April 20, 2016 (edited) I am having some trouble here. It seems that npc.getArea(int).contains(myPosition()) is returning false on me? Anytime the character is in the area of the (filtered NPC OR the interacting) and in melee range -> walk somewhere random Why don't you just do: if(npc.getPosition().distance(myPosition()) <= 3) // if npc is less than or equal to 3 tiles away Edited April 20, 2016 by Explv Link to comment Share on other sites More sharing options...
TFW Posted April 20, 2016 Author Share Posted April 20, 2016 Why don't you just do: if(npc.getPosition().distance(myPosition()) <= 3) // if npc is less than or equal to 3 tiles away It's essentially same thing kind of. I just don't want to be in the NPC area everytime I go to attack Link to comment Share on other sites More sharing options...
TFW Posted April 20, 2016 Author Share Posted April 20, 2016 Why don't you just do: if(npc.getPosition().distance(myPosition()) <= 3) // if npc is less than or equal to 3 tiles away I ended up fixing it Link to comment Share on other sites More sharing options...