mob/Monsters
proc
Agressive()
spawn(1)
while(1)
var/mob/Target = /mob
for(Target in oview(10))
if(Target.Player == 1)
Target.Health -= Damage
if(Target.Bar == 0)
Target.Bar = 1
healthBar = new(Target, 'Health Bar.dmi', 14, "Health", "Max_Health", pixel_y = -8)
spawn(1)
overlays = null
Bar = 0
Target << sound('slash.wav')
Target.Player_DeathCheck()
sleep(10)
mob/Monsters
New()
Agressive()
while(src)
var/mob/Target = /mob
var/Monster
var/Rounds = 1
for(Target in oview(10))
if(Target.Player == 1)
while(Rounds <= 8)
Monster = locate(/mob/Monsters in get_step(Target,Rounds))
if(!Monster)
walk_towards(src,get_step(Target,Rounds),5)
sleep(6)
Rounds ++
sleep(10)
Problem description:
The Aggressive process can actually do what I want it to do but for some reason it doesn't start functioning for about 10 seconds and when it does work, it has random fluctuations in completion time.
Any ideas on what's going wrong? I'm stumped.
Extra : Everything after Agressive() keeps going even though Agressive() does nothing for ages.
Double Extra : The actual timing won't be logical because I'm made most if not all 1 in order to make sure the 10 seconds it's taking isn't possible.
Everything in New() is continuing because you've spawn()'d off the loop in proc/Agressive(). This is a good thing, or the constructor would never return.