FOnline Development > Questions and Answers

Check for critter running

(1/1)

paradoxresolved:
Hello all,

I can usually figure this out by reverse engineering, but I'm attempting to detect when a critter is running.  I tried critter.IsRuning, but that flag remains true even if the critter stops to engage in hand-to-hand combat.  Anyone know how to detect if a critter is running?

Thanks! :)

Lidae:
This is a bit tricky, but with the 2238 SDK you can use the DLL function IsRunning (check parameters.cpp and Walking.cpp). Depending on what you need it for (on 2238 it was used to set AC to 0 if you're not running), you can keep the usage to the DLL and that would be the simplest.

(You need Visual Studio 2010 to change the DLL).

paradoxresolved:
Cool!  I have VS 2010, but until now I haven't done much digging into the dll's.  I've give it a shot.  Thanks for the pointer! :)

Atom:
2238's Critter::IsRunning() is a conjunction of Critter::IsRuning and Critter:IsMoving(). The latter checks if the critter changed its hex in the last n ms, where n is the time needed for walking one hex for the critter's current crtype, as defined in CritterTypes.cfg.
Critter::IsMoving() also contains a bit of ugly hackery in order to obtain current game time in the DLL, which wasn't directly possible in the time of its writing.

Navigation

[0] Message Index

Go to full version