ID:261822
 
Well, here is the problem. It's not calling the Delay() proc.
turf
Click()
var/mob/M = usr
if(M.delay)
M << "You can't do anything yet"
return
if(src in range(M.move,M))
usr.dir = get_dir(M,src)
M.delay = M.movedelay
for(M.loc,M.loc != src.loc,sleep(M.walkdelay))
step_towards(M,src)
M.Delay()
else
M << "A move to that position is not permitted "
return

mob/proc/Delay()
if(src.delay)
for(src.delay,src.delay > 0,src.delay--)
src << delay
sleep(1)
if(src.delay == 1)
sleep(1)
src << "You may perform another action"
src.delay--
break


I've tried doing this
        if(src in range(M.move,M))
usr.dir = get_dir(M,src)
M.delay = M.movedelay
if(walk_to(M,src,0,M.walkdelay))
M.Delay()
Instead of this
        if(src in range(M.move,M))
usr.dir = get_dir(M,src)
M.delay = M.movedelay
for(M.loc,M.loc != src.loc,sleep(M.walkdelay))
step_towards(M,src)
M.Delay()
But that gave me a missing expression error on the following line
if(walk_to(M,src,0,M.walkdelay))


Soooo... which way would be better to use and how would I fix them since neither of them work, lol.

Resonating Light
Try putting "M.Delay()" before the for() statement.
In response to HavenMaster
HavenMaster wrote:
Try putting "M.Delay()" before the for() statement.

Nope. That would start the count down before the player finsihes moving which I don't want to happen. I want it to call the proc after movement is finsihed.

[EDIT]I also took out the var/mob/M = usr line and replaced all the M's with usr... I'm not really sure why I put the var/mob/M = usr in the first place.[/EDIT]

Resonating Light
if(walk_to(M,src,0,M.walkdelay))

I do belive that walk_to() doesn't return anything.
Hence you cannot test if its equal to 0 or not with your if statment.

-Salarn
In response to Salarn
It does return something, but it returns it immediately. Your still right though, it won't work... because even if it did return true it would call the proc immediately and not give me the effect I need. Sooo... how could I fix this?

Resonating Light