ID:141272
 
code:
mob/var
HasPokemon=0
PkmInInven=0
following=0
wandering=0
Training=0
attack=0
follow1=0
follow2=0
TD=0
Pmove=0
mob/verb
Send_Out()
set category = "Pokemon"
var/mob/P=input(usr,"Select a Pokemon to return","Select") in usr.pokemonlist
if(P.returned==1)
P.loc=locate(usr.x,usr.y,usr.z)
usr.PkmInInven-=1
P.returned=0
Pmove=1
usr << "Go [P]!"
return
else
usr << "[P] isnt in its pokeball!"
return
Return()
set category = "Pokemon"
var/mob/P=input(usr,"Select a Pokemon to return","Select") in usr.pokemonlist
if(P.returned==1)
usr<<"They are already in your bag!"
return
if(usr.PkmInInven==9)
usr << "You cant hold anymore pokemon in your pockets!"
return
else
P.overlays-='Train.dmi'
P.loc = usr
P.returned=1
P.following=0
P.wandering=0
P.Training=0
Pmove=0
view(12) << "[P] Return!"
usr.PkmInInven+=0
Release_Pokemon()
set category = "Pokemon"
var/mob/P=input(usr,"Select a Pokemon to return","Select") in usr.pokemonlist
if(P.returned==1)
usr.PkmInInven-=1
P.loc=locate(5,9,1)
usr.pokemonlist-=P
usr << "You have released [P]!"
P.name="pokemon"
P.owner=null
P.owned=0
usr.pokemon-=1
P.overlays-='Train.dmi'

Pokemon_Follow()
set category = "Pokemon"
for(var/mob/Pokemon/P in view())
if(P.owner==usr)

walk_towards(P,src)


Pokemon_Train()
set category = "Pokemon"
for(var/mob/Pokemon/P in view())
if(P.owner==usr)
P.exp+=10
P.str+=1000
P.maxhp+=rand(1000,5000)
P.levelup()
P.Evolve()


Pokemon_Attack_Mode()
set category = "Pokemon"
for(var/mob/Pokemon/P in oview())
if(P.owner == usr&&P.Wfight == 0)
P.Wfight = 1
usr<<"Your pokemon will now attack anything it bumps into."
return
else if(P.owner == usr&&P.Wfight == 1)
usr<<"Your pokemon will no longer attack anything."
P.Wfight = 0
return
else
usr<<"This is not your pokemon!"
return
Rename_Pokemon()
set category = "Pokemon"
var/mob/pkm=input(usr,"Select a Pokemon to rename","Select") in usr.pokemonlist
var/new_name=input("What new name do you want for your pokemon?","")as text|null
pkm.name="[new_name]([usr.name])"
usr << "Your pokemon is now named [pkm.name]!"

Wander()
set category = "Pokemon"
if(src.wandering==1)
var/w=rand(1,4)
if(w==1)step(src,NORTH)
if(w==2)step(src,SOUTH)
if(w==3)step(src,EAST)
if(w==4)step(src,WEST)
spawn(15)src.Wander()

mob/proc/Follow()
if(src.following==1)
step_to(src,owner,1)
mob/proc/PokemonMove()
if(Pmove == 1)
for(var/mob/Pokemon/pkm in world)if(pkm.owner==src&&pkm.wandering==0&&pkm.Training==0&&pkm.following==1)
pkm.loc=locate(src.x,src.y,src.z)
pkm.dir=src.dir
else
return
mob/proc/PokemonTrain()
for(var/mob/Pokemon/pkm in world)if(pkm.owner==src&&pkm.wandering==0&&pkm.Training==1&&pkm.following==0)
pkm.exp+=100
pkm.levelup()
pkm.deathcheck()
spawn(50)src.PokemonTrain()


mob/Move()
usr.PokemonMove()
..()
mob/proc/levelup()
if(src.exp>=src.next)
src.level+=15
src.str+=1000
src.hp+=500
src.maxhp+=1000
src.def+=50
src:owner << "[src] Leveled Up!"
src.exp=0
src.next+=1
mob/proc/deathcheck()
if(src.hp<=0)
src.hp=src.maxhp
world << "[src] Fainted!"
src.loc=locate(44,35,3)
src.wandering=1
src.overlays-='Train.dmi'
src.following=0
src.Training=0
<\dm>





and the prob is

<B>Problem description:</b>loading Pokemon Chrome.dme
Code.dm:41:error:M.returned:undefined var
Code.dm:85:error:M.returned:undefined var
Code.dm:118:error:M.returned:undefined var
Code.dm:175:error:M.returned:undefined var
pokemon tab.dm:16:error:P.returned:undefined var
pokemon tab.dm:19:error:P.returned:undefined var
pokemon tab.dm:29:error:P.returned:undefined var
pokemon tab.dm:38:error:P.returned:undefined var
pokemon tab.dm:48:error:P.returned:undefined var

Pokemon Chrome.dmb - 9 errors, 0 warnings (double-click on an error to jump to it)


Can someone help me on this error please?
Since you only posted code from "pokemon tab.dm" you can only be helped with the errors listed in it (you also have errors in "Code.dm"). I'll just give one example, they're all basically the same.
Narutofoxy123 wrote:
code:
> mob/verb
> Send_Out()
> set category = "Pokemon"
> var/mob/P=input(usr,"Select a Pokemon to return","Select") in usr.pokemonlist
> if(P.returned==1) // this line
> P.loc=locate(usr.x,usr.y,usr.z)
> usr.PkmInInven-=1
> P.returned=0 // this line


That last line is trying to access a variable, "returned" that belongs to the /mob type (since P is declared as var/mob/P). Likely you meant var/mob/Pokemon/P, or you just never made the variable.

Did you even read the errors?
In response to Kuraudo
Kuraudo wrote:
Since you only posted code from "pokemon tab.dm" you can only be helped with the errors listed in it (you also have errors in "Code.dm"). I'll just give one example, they're all basically the same.
Narutofoxy123 wrote:
code:
> > mob/verb
> > Send_Out()
> > set category = "Pokemon"
> > var/mob/P=input(usr,"Select a Pokemon to return","Select") in usr.pokemonlist
> > if(P.returned==1) // this line
> > P.loc=locate(usr.x,usr.y,usr.z)
> > usr.PkmInInven-=1
> > P.returned=0 // this line

That last line is trying to access a variable, "returned" that belongs to the /mob type (since P is declared as var/mob/P). Likely you meant var/mob/Pokemon/P, or you just never made the variable.

Did you even read the errors?

Umm...i dont get it....but thanks