ID:140874
 
Code:
            Rename()
var/hehe = input(usr,"What will you call this pokemon?")as text
var/mob/M = src.Capture
if(!M.client)
for(var/mob/O in src.contents)
O.name = hehe
src.name = "Pokeball [hehe]"


Problem description:It doesn't ask me to rename the pokemon.

Code:
mob
proc
updateHealth()
var/percent=round(src.hp/src.maxhp*100,5)
if(percent>100) percent=100
if(percent<0) percent=0
if(src.client.screen)//the check doesn't work
for(var/obj/hudMeters/o in src.client.screen)
o.icon_state=num2text(percent)
spawn(10)
src.updateHealth()


Problem description:When i send the pokemon out or in the pokeball i get a runtime error:

runtime error: Cannot read null.screen
proc name: updateHealth (/mob/proc/updateHealth)
source file: Hpbar.dm,8
usr: the dgf (/mob/player)
src: Wild Chikorita (/mob/enemy/Chikorita)
call stack:
Wild Chikorita (/mob/enemy/Chikorita): updateHealth()
Wild Chikorita (/mob/enemy/Chikorita): updateHealth()

1) Did you call the Rename() procedure?
2) You should check if the "src.client" exists, not "src.client.screen".
In response to GhostAnime
1)It's a verb,so i right click on a pokeball in the inventory and press rename and nothing happens
2)Works,thx.
In response to Destrojer
Does the poke ball have its own different rename verb?
In response to Chowder
nope,it has 1 rename,1 send out...and both are placed on the pokeball. (i use a different pokeball for throwing and that one has only get/drop/throw)
In response to Destrojer
Uhhh....i fixed it,thx Chowder.....it was blocked by the rename in owner rights x_x....xD
updateHealth() shouldn't loop. Just call it whenever you change hp or maxhp.