var/mob/P
var/mob/PC/O
New()
. = ..()
src.CreateName()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(O in oview(6))
if(O.safe==0|O.dead==0)
step_towards(src,O)
Found = TRUE
break
if(Found != TRUE)
for(P in oview(6))
if(P.safe==0|P.dead==0)
step_towards(src,P)
break
sleep(3)
sleep(2)
Bump(mob/M)
if(istype(M,/mob))
Attack2(M)
if(M.dodge==1)
src.Evade(M)
Problem description: Ok so, what I am trying to do, is get certain mobs active throughout the world. By that I mean, I want to get mobs to fight each other when players are not around. The thing works perfectly fine when it actually runs. I get 0 errors and 0 warnings. But when I run it, within a few minutes, the game freezes and i get a message saying "Dream Seeker has stopped responding" and yada yada (the windows thing). As I code this code in to other mobs, the crashing gets worse and quicker. I am pretty sure it has to do with me using faulty loops...but I would like to know exactly where I went wrong. Any help will be much appreciated.
I would suggest, if you really want mobs to fight each other, is to make them do it when a player is around, even randomly take hp before they start so the player thinks they have been fighting for awhile.