Bryno 21 Share Posted September 20, 2021 Hi there! I see there is canReach methods and such but I was wondering if there was a way of determining WHY can't I reach that object? For example, if I just try to attack a Chicken, it might say you can't reach because door is closed, and then I can do something like: // Can't reach the chicken, because this door is closed in the way Gameobject door = objectInWay(Chicken); // Open that door so I can reach chicken. door.interact("Open"); Thanks! Link to comment Share on other sites More sharing options...
holic 233 Share Posted September 20, 2021 Here's essentially what I do, just force it to walk (i.e. handle obstacles) if (!Walking.canReach(Chicken)) { if (Walking.shouldWalk(Calculations.random(4,9)) { Walking.walk(chicken); sleep(5,10); } } if (canReach....) Also some less common, but still common, obstacles need to be added to the walker but doors and such should already be covered. Link to comment Share on other sites More sharing options...
Bryno 21 Author Share Posted September 20, 2021 9 minutes ago, holic said: Here's essentially what I do, just force it to walk (i.e. handle obstacles) if (!Walking.canReach(Chicken)) { if (Walking.shouldWalk(Calculations.random(4,9)) { Walking.walk(chicken); sleep(5,10); } } if (canReach....) Also some less common, but still common, obstacles need to be added to the walker but doors and such should already be covered. Wait... NO WAY! You're telling me they implemented door handling in the "walk()" method.... That is CRAZY amazing! I have to test that out... I just assumed you would always have to implement your own door-object handling based on your script :O Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.