ID:165679
 
ok i need to know hwo to make a monster (NPC) go torward the player once they get so clase (maybe 4 tiles away) then it bumps into them alot till they die (you know bump())
Hah. Just been going through a similar kind of strife. :O

In order to make the mob avoid obstacles before reaching the target, see the [resolved] post (original post: "Attacking...")

but here's some code for attacking in a straight line:
mob/Monster
//********************************MONSTER NEW**************************************************************
New() //when new mob is created, make it call the wander() proc
.=..()
spawn(25)
Wander()

//********************************MONSTER BUMP**************************************************************
Bump(mob/M) //Override this to tell what it does
if(istype(M,/mob/player)) //if is a mob/player (so if it bumps into something else it wont attak it)
MonsterAttack(M) //Attack it with a proc that is defined below.

//********************************MONSTER MOVEMENT**********************************************************
mob/proc
Wander()
for(var/mob/M in orange(10,src))
if(M.client) //if human player in range of 10 is there
if(get_dist(src,M) <= 5) //and its closer than 5 tiles
walk_towards(src,M,src.movespeed-2) //run up (walk_towards calls the bump proc(walk_to does not))
else
walk_rand(src,70) //if its more than 5 tiles, wander (if no one can see the mob, it won't move)
spawn(9)Wander() //repeat the process

//********************************MONSTER ATTACK**************************************************************
MonsterAttack(mob/M)
//put your own attack process here (could just use an attack verb and convert it to proc format)