ID:140923
 
Code:
mob/Monster/Goblin
icon = 'golem_top.dmi'
icon_state = ""
New()
..()
var/obj/mobbottom/MT=new
MT.name="[name]"
overlays+=MT
hp = 25
var/mob/P
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(P in oview(5,src))
step_towards(src,P)
Found = TRUE
break
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob))
Attack(M)


Problem description:
well this is my code for a monster i get no errors. when i put as is the monsters attack each other. but when i add /player to the bump proc , in side if parenthesis. EXample:
if(istype(M,/mob/player)). they stand there and look around getting stuck on each other. i have tried lots of things but i can not get it right can some one plz help me.
That's because they bump into the mob, but it isn't a player, so they do nothing about it. However, because P is defined as a mob, they keep bumping into the mob despite it not being a player. You'd need to define P as a /mob/player for it to work the way you want it to.
In response to Demon_F0rce
could u show me how it should look?
In response to Cnsdddarrius
I've told what you need to do - you should then be able to do it. If you need me how to show you how to change one line, then you worry me because:

1) You didn't write this yourself, so have no idea what it does, and/or

2) You don't know how everything in there works. In programming, no matter what language, you should know what each line does, or else you're in trouble.
In response to Demon_F0rce
mob/Monster/Goblin
icon = 'golem_top.dmi'
icon_state = ""
New()
..()
var/obj/mobbottom/MT=new
MT.name="[name]"
overlays+=MT
hp = 25
var/mob/player
New()
. = ..()
spawn()
proc/Wander()
while(src)
var/Found = FALSE
for(player in oview(5,src))
step_towards(src,player)
Found = TRUE
break
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob))
Attack(M)


this is wut i turned into
In response to Cnsdddarrius
See, all that does is change the variable's name; which is basically nothing. You want it to be mob/player/P. That's all you needed to change, which is what I said.
In response to Demon_F0rce
ok now i have a problem with line 27. example : if(istype(M,/mob/player/P)) I GET AN ERROR undefined type path?
In response to Cnsdddarrius
Okay, I'm just gonna be really blunt.

BACK TO THE ORIGINAL CODE.

Everything stays the same but these two lines:

var/mob/P

if(istype(M,/mob))


Which become:

var/mob/player/P

if(istype(M,/mob/player))


And if you do not know why this is, look it up, or give up programming now.
In response to Demon_F0rce
i did that and they still wont attack or follow me they just wander around
In response to Cnsdddarrius
Well then you aren't a /mob/player, are you?
In response to Demon_F0rce
i found the problem i had my (mob =) set as something else my guess my lil brother being jealous of me making my own game.