ID:149396
 
i decided to change it down, is there a way to stop a radomly moving mob after 'X' number of steps

this is my code so far...

mob
mob
icon = 'mob.dmi'
icon_state = "walking"
New()
..()
LCycle1()

mob
proc
LCycle1()
if(client)
return
step_rand(src)
spawn(7)
world << "[src] is at '[x], [y]!'"
spawn(7) LCycle1()

(>=1 tab) any suggestions would be helpfull!
i could realy use some help with this... thanks
Setup something with a for loop (They're a bit complicated if you're new, so be sure to look them up first.)

<code>mob/proc/TimedMove(times, delay) for(var/move=times, times>0, times--) sleep(delay) step_rand(src) return</code>

When you activate this for a mob like this:

<code>mob/New() spawn() src.TimedMove(10,10)</code>

Where "times" in the proc above is the number of times you want them to move, and "delay" is the number of ticks you want to pass by before each move; then the mob will actively move about randomly after every "delay" period passes, until the number of times you told it to move experies at which point the proc will terminate.

Does that make sense?
In response to Foomer
yeah thanks