ID:175305
 
Ok, I want to make it so that monsters check if there is a player within 5 squares of them (can do that already) and then they take ONE step tward them, what is the command to do that? I know of step_towards() but that just makes them jump to the player... is that the only command and i just have to add some major sleep()s or what?
I'll use an example from my game.

mob/monsters
New()
..()
spawn(rand(10))
LifeCycle()
return

LifeCycle()
if (client || isDead())//makes sure the monster isn't dead
return//if it is, runs the proc isDead and deletes the monster

var/action_taken

for (var/mob/other_mob in oview(1, src))
if (istype(other_mob, /mob/monsters) || other_mob.isDead())//makse sure it doesn't attack another monster
continue

Attack(other_mob)//if not, it will attack
action_taken = 1 //it's done something, so it waits and goes down to part 1

for (var/mob/other_mob in oview(3, src))
if (istype(other_mob, /mob/monsters) || other_mob.isDead())
continue
step_towards(src, other_mob)//if it hasn't attacked or done anything like that, it takes ONE step towards a player in oview(3)
action_taken = 1

//part 1
if (action_taken) //if the variable action_taken is 1 or higer, it waits for lifecycle_delay/20ths of a second and starts over.
spawn(lifecycle_delay)
LifeCycle()
return//otherwise, it starts over.
..()//calls the parent.

Hope that helps! if you have anymore questions, post here or page me!