ID:2361190
 
(See the best response by Ter13.)
Code:
for(var/obj/B in range(src,10))   //gathers obj references
if(B.Move(get_step(B,B.dir),B.dir)) //supposed to see if the object move proc's arguments are equal to whats listed.
walk(B,turn(B.dir,180)) //the end result is reversing movement direction.


Problem description: Above is just one example i tried to use to figure if an object is moving or not, I was wondering if there is any method to determine if an object is moving or not? Or also if the Move() and walk() are being called for an object.

Best response
The only time an object is moving is during Bump(), Enter()/Exit()/Cross()/Uncross(), Entered()/Exited()/Uncrossed()/Crossed().

At no other time is an object technically considered moving.

Also, walk() calls Move(). There is no distinction between movements from a client and a walk() or step() proc, because all of these methods internally call to Move().

Further, checking every object in a range of 10 from a player is a 21x21 square tile area, which is 441 tiles to check if the tile being checked is a particular tile. If you already know the particular tile you want to check, you should not need to check 441 different tiles.

Maybe you could describe what you are actually trying to do, and we can help you find a better means of doing it.
The end result is reversing the direction of moving objects. Im feeling the only way to get it to work properly is using a var to become true if moving and false if it stops. However I was trying to avoid that because I was hoping I could check which procs are running on an object.
Yeah, in programming, you generally don't check if a function is running, because... Well, generally speaking the concept doesn't really exist in a meaningful fashion.

Even in threaded environments, you aren't supposed to have that kind of access to another thread's operations, and in single-threaded environments, there is generally no such concept as a concurrent or suspended operation. DM is a bit of a different animal that trains us to think about what procs are a little wrong, since they can be rescheduled amid-operation.

But generally speaking, the idea of "is something running" doesn't apply to procs. At least from a particular semantic perspective.

In general, tracking these kinds of things yourself like you just said is the recommend way of dealing with your exact problem.
Okay, then am I able to edit the walk proc? If its possible to expand it, then itll be easy to track movement.
Nope. You'll have to wrap it with a custom function:

Put this in your DME file above the include block and below the preferences block:

atom/movable
var
walking = 0

client
Move()
walk_x(mob,0)
. = ..()

//custom wrapper function:
proc
walk_x(atom/movable/Ref,Dir,Lag=0,Speed=0)
if(Dir)
Ref.walking = 1
else
Ref.walking = 0
walk(Ref,Dir,Lag,Speed)

walk_to_x(atom/movable/Ref,atom/Trg,Min=0,Lag=0,Speed=0)
Ref.walking = 1
walk_to(Ref,Trg,Min,Lag,Speed)

walk_away_x(atom/movable/Ref,atom/Trg,Max=0,Lag=0,Speed=0)
Ref.walking = 1
walk_away(Ref,Trg,Max,Lag,Speed)

walk_rand_x(atom/movable/Ref,Lag=0,Speed=0)
Ref.walking = 1
walk_rand(Ref,Lag,Speed)

walk_towards_x(atom/movable/Ref,atom/Trg,Lag=0,Speed=0)
Ref.walking = 1
walk_towards(Ref,Trg,Lag,Speed)

//replacing walk() with the wrapper function:
#define walk(Ref,Dir...) walk_x(Ref,##Dir)
#define walk_to(Ref,Trg...) walk_to_x(Ref,##Trg)
#define walk_away(Ref,Trg...) walk_away_x(Ref,##Trg)
#define walk_towards(Ref,Trg...) walk_towards_x(Ref,##Trg)
#define walk_rand(Ref...) walk_rand_x(##Ref)


This is what it'll look like:



This will allow you to wrap walk() while allowing you to forget about the difference between the wrapper function and the normal one.
thank you, very much.