mob/Monster/Rebel
icon = 'jedi2.dmi'
icon_state = "stormtrooperanim"
hp = 25
Power = 15
expgive = 7
exp = 10
def = 2
str = 2
armor = 0
var/mob/player/P
var/mob/Monster/StormtrooperB/E
New()
..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(P in oview(9,src))
if(P.dark >= 1)
step_towards(src,P)
Found = TRUE
missile(/obj/blasterfire,usr,P)
walk(/obj/blasterfire,usr.dir)
sleep(get_dist(usr,P))
var/damage = pick(20)
P.hp -= damage
if(P.hp <= 0)
P.Death(P,src)
sleep(10)
src.Wander()
else
return
for(E in oview(5,src))
step_towards(src,E)
Found = TRUE
missile(/obj/blasterfire,usr,E)
sleep(get_dist(usr,E))
var/damage = pick(20)
E.hp -= damage
if(E.hp <= 0)
E.Death(E,src)
sleep(10)
src.Wander()
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
// Bump(mob/M)
//if(istype(M,/mob/player))
//missile(/obj/blasterfire,usr,P)
//walk(/obj/blasterfire,usr.dir)
//sleep(get_dist(usr,P))
//var/damage = pick(20)
//P.hp -= damage
//P.Death(src)
//sleep(10)
//src.Wander()
//if(istype(M,/mob/Monster))
//missile(/obj/blasterfire,usr,E)
//walk(/obj/blasterfire,usr.dir)
//sleep(get_dist(usr,E))
//var/damage = pick(20)
//E.hp -= damage
//E.Death(src)
//sleep(10)
//src.Wander()
Problem description: At the very beggining i get a login error: runtime error: Cannot read null.hp
proc name: Wander (/mob/Monster/StormtrooperB/proc/Wander)
usr: StormtrooperB (/mob/Monster/StormtrooperB)
src: StormtrooperB (/mob/Monster/StormtrooperB)
call stack:
StormtrooperB (/mob/Monster/StormtrooperB): Wander()
StormtrooperB (/mob/Monster/StormtrooperB): New(the grass (20,12,9) (/turf/grass))
: New()
runtime error: Cannot read null.hp
proc name: Wander (/mob/Monster/Rebel/proc/Wander)
usr: Rebel (/mob/Monster/Rebel)
src: Rebel (/mob/Monster/Rebel)
call stack:
Rebel (/mob/Monster/Rebel): Wander()
Rebel (/mob/Monster/Rebel): New(the grass (16,13,9) (/turf/grass))
: New()
runtime error: Cannot read null.hp
proc name: Wander (/mob/Monster/StormtrooperB/proc/Wander)
usr: StormtrooperB (/mob/Monster/StormtrooperB)
src: StormtrooperB (/mob/Monster/StormtrooperB)
call stack:
StormtrooperB (/mob/Monster/StormtrooperB): Wander()
StormtrooperB (/mob/Monster/StormtrooperB): New(the grass (20,13,9) (/turf/grass))
: New()
runtime error: Cannot read null.hp
proc name: Wander (/mob/Monster/Rebel/proc/Wander)
usr: Rebel (/mob/Monster/Rebel)
src: Rebel (/mob/Monster/Rebel)
call stack:
Rebel (/mob/Monster/Rebel): Wander()
Rebel (/mob/Monster/Rebel): New(the grass (16,11,9) (/turf/grass))
: New() yeah that huge long one and this code up there is the same for both mobs
I would like to know hy i'm getting that runtime error when i login and also why my Npcs stop moving after they kill something
------------------
Sorry this is my first game; I coded it from scratch
-------------------
This also happens at later times. I beleive this error happens whenever one of the rebels or monsters die
-----------------------------
I FIXED IT
------------------------