View Single Post
Re: towards a better layout of WalkPath() functions
Old
  (#2)
A$$A$$IN
Guest
 
Status:
Posts: n/a
Default Re: towards a better layout of WalkPath() functions - 21-01-2004

I think the simplest way would be for the bot to compare its current x,y,x location to its x,y,x location the last time the function was called.

If (ABS(CurrX-PrevX) + ABS(CurrY-PrevY) + ABS(CurrZ-PrevZ) < MinimumWalkSpeed) And ImTryingToMove Then
OhCrapImStuck
Else
CoolImNotStuck
EndIF

ABS()=absolute value function

I'm a VB coder and don't speak C/C++ very well. But that seems to me to be the simplest most reliable way to solve the problem. BTW, PrevX, PrevY, and PrevZ should be declared static and updated with the bot's current x,y,z coordinates as the last step before the function exits. If testing to see if jumping unsticks the bot, do the above, but without the Z coordinate (assuming jumping causes the Z coordinate to change).
  
Reply With Quote