ID:154890
 
If i wanted a move proc to be called when Bump() happens, what would be the arguements if i wanted the mob to move x number of pixels toward the opposite dir that the mob is facing? I've looked in the guide and the built in help on DM but i can't seem to find it.

Baltraven
ok so ive done some more reading, and it seems step_away() is a better proc than move, but when inputting the arguements, it gives me errors saying i dont have enough arguements.

Bump(mob/M as mob in oview(1))
if(M != src)
var/damage= M.str - src.def
if(damage <= 0)
src<<"You bumped into [M] but took no damage!"
step_away(src,M,Max=3,Speed=2)
else
src<<"You bumped into [M] causing [damage] damage!"
src.hp-=damage


what would be the correct form of the arguements of step_away? can someone give an example plz?


Baltraven
In response to Baltraven
Ok well a pretty noob mistake. i fixed the arguements part, but it seems that when Bump() happens, and my mob steps away, he changes his dir. Is there a way i can make him step back away from a location, instead of turning away and stepping?
In response to Baltraven
I have not tried this out, so you should try it out yourself, but maybe this will work in your code?

usr.dir = //NORTH, SOUTH, WEST, EAST, whatever direction you want...


idk, I'm pretty much a beginner myself, and I'm beginning to see some lights XD. idk if this is even a working code, so you should really try it out.
In response to Baltraven
Are you talking about the step_away() proc? Or even use the Move() proc, and use the dir argument to make them face whatever direction.