Hi there is my code For my game a rpg i cant i keep geting thes error: proc definition not allowed in side another proc
:can you helpme the Problem with the cod Wander() thank you
world
mob=/mob/person
mob
person
icon='person.dmi'
verb
say(msg as text)
view(src)<<"[usr] says:[msg]"
Login()
icon_state=gender
usr.loc=locate(3,2,1)
mob/pc
var
HP=30
Max_HP=30
strength=3
exp=0
exp_give=0
verb
attack(mob/M in oview(1))
var/damage=rand(1,strength)
usr<<"you attack [M]!"
usr<<"[damage] damage!"
M<<"usr attacks you!"
M<<"[damage] damage!"
M.HP-=damage
M.DeathCheck()
mob
var
HP
Max_HP
strength
exp
exp_give
proc
DeathCheck(mob/M)
if(src.type==/mob/pc)
PCDeathCheck()
else
if(src.HP<=0)
usr.exp+=src.exp_give
del(src)
PCDeathCheck(mob/M)
if(src.HP<=0)
src.loc=locate(3,2,1)
src.HP=Max_HP
NPC
Bug
name="bug"
icon='bug.dmi'
HP=20
Max_HP=20
strength=3
exp_give=5
var/mob/pc/p
New()
.=..()
spawn(1)
Wander()
proc/Wander()
while(src)
if(P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
Spawn(40)
Wander()
bump(mob/M)
if(istype(M,/mob/pc))
attack(M)
proc/attack(mob/M)
flick("bug",src)
sleep(2)
var/damage=rand(1,strength)
M.HP-=damage
view(src)<<"[src} attacks[M]!"
view(src)<<"[damage] damage!"
M.PCDeathCheck()
mob/stat()
stat("stats;",src.desc)
if(src==usr)statpanel("inventory",src.contents)
stat(" HP:",HP)
stat(" strength:",strength)
stat(" Experience:",exp)
ID:148595
Dec 21 2002, 9:47 am
|
|
world Something like this, I fixed the code up a bit more. Hopefully it works now. RaeKwon |
In response to Koolguy900095
|
|
Both thouwa dont work and the Code you gave me makes more proplems
|
In response to RaeKwon
|
|
The P variable in Wander() is still not the same as the mob variable p.
|
mob
Login() again
if thats not the prob tell me