Bryno 21 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!
holic 237 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.
Bryno 21 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.