ID:1691286
 
Keywords: atom, dir, direction
What procedure in DM's system is in charge of changing an atom's direction? I'm looking to check whenever an atom's direction is changed by DM's system. I thought Move(atom)handled direction changes but it seems that direction changes are handled internally.

I want to know whenever a direction is changed regardless of when atom.dir is set.
There isn't a built-in way to track when dir changes. At least, not that I'm aware.
Nope, there isn't. Internal calls to atom.Move() through client.Move() (aka default movement keys) or step()/walk() provide a "dir" argument to atom.Move() that changes the direction.

Aside from that, no procs are called when you change a variable, ever. The only exception is mob.key or mob.client, which causes old_mob.Logout() and new_mob.Login().
Sir Quizalot wrote:
What procedure in DM's system is in charge of changing an atom's direction? I'm looking to check whenever an atom's direction is changed by DM's system. I thought Move(atom)handled direction changes but it seems that direction changes are handled internally.

I want to know whenever a direction is changed regardless of when atom.dir is set.You could make a loop on the mob that checks if the direction is changed.


    proc/monDir(atom/Ref){
set waitfor=0;

var
curDir = Ref.dir;

while(Ref){

if(curDir != Ref.dir){
/*
Do other code here.
*/


curDir = Ref.dir;
}

sleep(world.tick_lag);
}
}


I don't believe there is any other way this loop requires no CPU time that I can tell however whatever code you add would change that most likely. In general having persist ant loops is a bad idea.