ID:269657
 
I've tried everything, the only thing that seemed that would work though was:
mob/Move(l,d)
if(d&NORTH||d&SOUTH)
if(d&EAST)step(src,EAST)
else if(d&WEST)step(src,WEST)
else return ..()
return ..()

But alas, it didn't work. :/
I want to make it so if the mob attempts to step NORTHEAST, they step east and then north.
=/ Is there a way to get something similar to this working?
Ol' Yeller wrote:
I've tried everything, the only thing that seemed that would work though was:
> mob/Move(l,d)
> if(d&NORTH||d&SOUTH))
> if(d&EAST)step(src,EAST)
> else if(d&WEST)step(src,WEST)
> else return ..()
> return ..()

But alas, it didn't work. :/
I want to make it so if the mob attempts to step NORTHEAST, they step east and then north.
=/ Is there a way to get something similar to this working?

Since you did not provide what the output was, I'm assuming that if a mob tries to move NORTHEAST, they move EAST then NORTHEAST. A simple fix that comes to mind almost immediately would be like:

mob/Move(l,d)   // Thanks for using good var names XD
var/remain_d = d
if((d&NORTH||d&SOUTH)&&l in oview(1,src))
if(d&EAST){step(src,EAST);remain_d-=EAST} // Remember: EAST is really an integer
else if(d&WEST){step(src,WEST);remain_d-=WEST}
step(src,remain_d)
else return ..()


Granted I just thought that up out of nowhere, so it may need some testing/debugging and whatnot. I hope it helps, at least some(especially since nobody else wanted to touch a piece of Ol' Yeller's code XD)

Post back any problems and such.

Hiead

[EDIT]
Also, you would probably want to throw in some checks and such. Consider:<pre> X|--- |</pre>
Assume that X is a mob, and everything else is dense turfs/objs. If you tried to move NORTHEAST, and it was set to move EAST, then NORTH, You would only move NORTH, when you would probably want the mob to step NORTH, then EAST to make it around the corner.

Hiead

2nd one:
Actually I think my suggestion fails also, so I'm sorta stumped.
[/EDIT]