mob/Enemies
New()
.=..()
src.exp_give = rand(1,15)
spawn(1)
Wander()
proc
Wander()
var/mob/PC/P
while(src)
for(P in oview(13,src))
world << "[src] steps to [P]"
step_to(src,P,1)
world << "[src] step closer to [P]"
if(P in oview(1))
EAttack()
sleep(10)
mob/Enemies/Bear
icon = 'bear.dmi'
ID:171518
![]() Sep 12 2004, 5:47 am
|
|
The code below works but the NPC mob/Enemies doesn't step to the target. I left those to debug messeges to see if it was working, and it works. the EAttack() proc is called when the enemy is next to the mob/PC/P which is the character mob. The only thing that seems to not work is step_to(src,P,1) which should be "src steps to P until they are 1 block away". I've also tried step_towards(), walk_to(), walk_towards() but they all seem to not work for me.
|
Try that.
By the way, i dont see how the NPC will be wandering around with that code.