ID:154663
 
i have this specific code that is supposed to make the NPSc wander while i can see them on my screen
mob
NPC

Brolly

name = "{NPC} Brolly"
icon = 'Enemy.dmi'
density = 1

Health=25
Defence=1
Strength=2



New()
. = ..()
spawn()
Wander()


var/mob/PC/P

proc/Wander()
while(src)
var/Found = FALSE
for(P in oview(6)).
step_away(src,P)
Found = TRUE
break
if(Found != TRUE)
sleep(8)
sleep(8)
sleep(8)

i get these errors
NPCs.dm:28:error: P: undefined type: P
NPCs.dm:29:error: P: undefined type: P
i thought i defined P by doing
 var/mob/PC/P
No way to be sure but since it complains about an undefined type and not an undefined var, the first thought that crosses my mind is that you lack the definition of mob/PC somewhere
for(P in oview(6))

should be?

for(var/mob/PC/P in oview(6))

Not a pro coder but, guessing as its not in the proc its not defined.