mob
Monster
Drag1
Multi = new/list()
New()
Multitile('Drag1.dmi',"UR","UR",src)
Multitile('Drag1.dmi',"BL","BL",src)
Multitile('Drag1.dmi',"BR","BR",src)
Del()
for(var/obj/O in Multi)
del O
..()
proc/Multitile(icon/A,var/B,var/C,var/mob/NPC/D)
var/obj/Multi/O = new/obj/Multi
O.Pos = "[C]"
O.icon = A
O.icon_state = "[B]"
D.Multi.Add(O)
if(O.Pos == "UR")
O.loc = locate(usr.x+1,usr.y,usr.z)
O.dir = usr.dir
if(O.Pos == "BR")
O.loc = locate(usr.x+1,usr.y-1,usr.z)
O.dir = usr.dir
if(O.Pos == "BL")
O.loc = locate(usr.x,usr.y-1,usr.z)
O.dir = usr.dir
Now this makes a Dragon that stands still and does nothing. But when I call my monster wander proc everything goes wrong. I get loads of errors, then the mob disappears leaving only his extra tiles behind! Here is my wander proc;
ai_random_wander()//random wander if no mobs are in range to attack
if(src.key)//if the source is human
return//don't call the rest
if(AI==1)
var/turf/T
var/Dir=0
do
Dir=pick(1,2,4,8,5,6,9,10)
T=get_step(src,Dir)
while(!T||T.density||T.loc!=loc.loc)
step(src,Dir)
src.ai_run_away()//checks for run away
spawn(7)//delay for one tick
if(AI==1)
ai_random_wander()//wander some more
ai_run_away()//used for checking to see if it should run or attack
PROC
ai_walk_to()//someone came into view
PROC
ai_walk_to2(var/mob/M)//someone shot src
PROC
checktrg(atom/target)
if(target.loc.loc==loc.loc)
return 1
else
return 0
Thank you very much for your time!
~Ease~