mob/npc
var/list/agrolist
proc/ai_life()
//some more AI code here
var/agronum=0 //Agrovated number (anger level to a mob)
var/mob/M
for(M in oview(5))
//if faction is low
if(M.factionlist[src.race]< -900)
//add to agrolist
ai_add_agro(M,1)
//if there is an agrolist
if(src.agrolist.len)//if there is somethign in the agro list
for(M in src.agrolist)//Get the highest agro'd mob as my target
if(src.agrolist[M]>agronum && M.HP >0)//set target and new agro number and if they have any Hit points
src.enemy=M
agronum=src.agrolist[M]
//attack Target
if(src.enemy.HP > 0)//If the target has any hitpoint
walk_to(src,src.enemy,1)
src.Attack()
sleep(10)//delay
src.ai_life()//Check agro list again
Problem description:
Heres a bit of code from my AI procs. Im really not sure what part is giving me the problem so I dont exspect allot, but I was hoping that if there is somethign obvious to someone else maybe they'll point it out.
I get Index errors when running my game but the compiler sees no troubles
As far as I can tell, you never initialized the list.