Log in

View Full Version : XenoBot Bug - Open [Other] Adding a Walker.IsStuck() func



heitorsales
09-11-2015, 03:10 PM
Bug ReportOperating System:
Other Short Description:
Adding a Walker.IsStuck() func Behaviors: Client Debug
Feature error

Indepth Description:
It would be interesting if the method Walker.IsStuck() would be added to the Xenobot API. I've noticed that my Walker sometimes skips "Stand" points, also ignoring some "Self.UseDoor" method calls. Having a Walker.IsStuck() would come in handy to detect such issues in the script routine itself, allowing the client programmer to properly handle such conditions (for example, as restarting the walk path).
To attain a better design pattern, having the "Walker Stuck" being handled by event listeners through the registerEventListener method would make the code even more elegant for that purpose.

Nakuu
09-11-2015, 03:25 PM
There is such function already?

shadowart
09-11-2015, 03:37 PM
It returns false if the walker is skipping waypoints though, which can lead to you getting stuck in some deadly infinite loops.

heitorsales
09-11-2015, 03:54 PM
Interesting, I will take a look at it (Thanks Nakuu and shadowart). Maybe the person responsible for the API should consider writing this method in the documentation? http://xenobot.wikia.com/wiki/Walker

I agree that getting stuck in some loops may be dangerous, but it is possible to solve it by using some "Stand" commands in the proper locations. But it is really hard to get rid of unaccessible Stands that reside on the other side of doors when the walker skips "Self.UseDoor" commands.

Nakuu
09-11-2015, 04:05 PM
Everything you need you can find there: C:\Program Files (x86)\XenoBot\Data\xb*.lua, this wikia is unofficial and fairly out of date.

DarkstaR
09-15-2015, 08:47 AM
Interesting, I will take a look at it (Thanks @Nakuu (http://forums.xenobot.net/member.php?u=15142) and @shadowart (http://forums.xenobot.net/member.php?u=56468)). Maybe the person responsible for the API should consider writing this method in the documentation? http://xenobot.wikia.com/wiki/Walker

I agree that getting stuck in some loops may be dangerous, but it is possible to solve it by using some "Stand" commands in the proper locations. But it is really hard to get rid of unaccessible Stands that reside on the other side of doors when the walker skips "Self.UseDoor" commands.

The docs aren't maintained by me because I don't have time. Check out the lua files Nakku pointed you to, they contain the entire library (just look at the latest one, there are many copies for many xeno versions). Every function is in there, and they are all documented with comments above their declarations.