mob
Villager
icon = 'M-norm.dmi'
icon_state = "Normal"
strength = 2
defense = 1
level = 5
dex = 1
money = 10
player = 0
New()
Wander()
..()
proc/Wander()
while(src) //without this your code only runs once
sleep(20) //without this it runs so fast it freezes the game
for(var/mob/M in view(9)) //this defines M during the while code
var/distanced = get_step_to(src,M,9)
if(!distanced)
if(M.player == 1)
if(M in oview(1))
walk(src,0)
if(!M.client) //if no mob return
return..()
else
NPCZ(M) // attack proc here
deathcheck(M)
else
step_towards(src,M) //this might be a better code to use to give more arguments
else
walk_rand(src,20)
else
walk_rand(src,20)
Problem description:
The NPCs will walk around fine and come towards me, but sometimes they skip a few squares and when they are standing next to me attacking me I want them to stop moving but if there are other npcs attacking me at the same time, they all move.
Not sure if I didi this right but give it a go and let me know.
- Dark Emrald