ID:2187720
 
(See the best response by Ter13.)
How would I go about preventing the player's sprite from changing its .dir var whenever I have the player move via movement verbs that call the step() or move() procs?

Best response
atom/movable
var/tmp
force_dir = 0

Move(atom/NewLoc,Dir=0,Step_x=0,Step_y=0)
Dir = force_dir||Dir
return ..()


Now just set force_dir to a valid direction. When you no longer want the direction the player faces to be forced, set force_dir back to 0.
Won't that just have force_dir be the default value for Move() to call if none is provided?
Yes. The way Move() works when it comes to directions, is basically this:

If Dir:
    set dir to Dir
Else:
    set dir to get_dir(src,NewLoc)


By adding Dir=force_dir in the arguments, we're effectively changing that logic to:

If Dir:
    set dir to Dir
Else if force_dir:
    set dir to force_dir
Else:
    set dir to get_dir(src,NewLoc)
I thought moving/step passed dir in?
Yep, you are correct. I actually use my own Step() variants defined under atom/movable, rather than the global procs. Mine don't actually provide the direction of the movement by default. Original post has been amended to reflect the globals.
And just to be sure, does step() change the direction, or is it Move() that does it, normally?
I'm pretty sure that step() just aliases Move(), meaning Move() is what causes all direction changes.