ID:138869
 
Code:
mob
Tame
New()
src.Wandera()

mob/proc/Wandera()
while(src)
step_rand(src)
sleep(10)

mob
Hostile
New()
src.Wanderh()

mob/proc/Wanderh()
text="Å"
var/mob/M
while(src)
if(M in oview(3))
if(M.client)
step_towards(src, M)
sleep(10)
else
step_rand(src)
sleep(10)



Problem description:
The Hostile AI doesn't seem to work - the mob walks randomly, but it doesn't seem to take notice of the player. Anybody know what I did wrong?
It does not work because you are not setting the <code>M</code> variable to anything.

for( var/mob/player in oview ( 5 ) )

some_list += player ; M = pick( some_list )
In response to Neimo
Ah, thanks, knew I'd forgotten something...