ID:157896
 
sry i have never actually tried this before until now but i keep trying to make a mob move but it wont work...i tried sending it directly to the client with usr and another with src but it just wont work i tried a lot of stuff even step which i later found out(2mins later)will not work so can anyone help me?
here is wat i did remember i tried a whole bunch of ways before this but now it just moves normally :(
mob/var/tmp/Confused = 0
mob
Move()
if(Confused)
usr.dir = pick(NORTH,SOUTH,EAST,WEST)
...()
return








Thanks in advance
when the mob is not confused, the code returns.
First of all, you should have accurately described in detail WHAT you're actually trying to do, how you want it to work, etc. Then you get to the part of what you've tried and how it works or doesn't work, etc.

It seems what you want is this: when a player is confused and tries to make a step, ignore the direction he was trying to move in and instead move him in a random direction. To do that, atom/movable/Move() is largely inappropriate. You should use client/Move() instead, which is called when a player moves his mob. Then, if the player's mob is confused, just imitate client/Move() default function, but with a random moving direction instead. In other words, call Move() on the player's mob to cause it to move to a location in a random direction from his current one (you can use get_step() with Move() to do that, or the shorthand step() instruction).
Also, never use usr in procs, except the /atom mouse procs.