ID:142306
 
Code:
mob/Login()
if(prob(50))
src.loc = locate(9,9,1)
else
src.loc = locate(27,9,1)
src << browse(loginmessage)
src.client.screen += new/obj/hudMeters/health_01
src.client.screen += new/obj/hudMeters/health_02
src.client.screen += new/obj/exphudMeters/exp_01
src.client.screen += new/obj/exphudMeters/exp_02
src.updateHealth()
src.updateEXP()

mob
proc
updateHealth()
var/percent=round(src.health/src.mhealth*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/o in src.client.screen)
o.icon_state=num2text(percent)
spawn(10) src.updateHealth()
mob
proc
updateEXP()
var/percent=round(src.exp/src.mexp*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/exphudMeters/o in src.client.screen)
o.icon_state=num2text(percent)
spawn(10) src.updateEXP()


obj
hudMeters
health_01
icon='meter_01.dmi'
icon_state="0"
New(client/c)
screen_loc="1,1"
c.screen+=src
health_02
icon='meter_02.dmi'
icon_state="0"
New(client/c)
screen_loc="2,1"
c.screen+=src
exphudMeters
exp_01
icon='emeters_01.dmi'
icon_state="0"
New(client/c)
screen_loc="1,2"
c.screen+=src
exp_02
icon='emeters_02.dmi'
icon_state="0"
New(client/c)
screen_loc="2,2"
c.screen+=src


Problem description:

proc name: updateHealth (/mob/proc/updateHealth)
runtime error: Cannot read null.screen
proc name: updateEXP (/mob/proc/updateEXP)
runtime error: Cannot read null.screen
proc name: New (/obj/hudMeters/health_01/New)
runtime error: Cannot read null.screen
proc name: New (/obj/hudMeters/health_02/New)
runtime error: Cannot read null.screen
proc name: New (/obj/exphudMeters/exp_01/New)
runtime error: Cannot read null.screen
proc name: New (/obj/exphudMeters/exp_02/New)
BYOND Warning: further proc crash messages are being suppressed to prevent overload...


This has only happened when the client clicked load to load his/her character. There was much more than this, but it was the same runtime error for each person, so I just narrowed it down to the one of each.
Use Client/New() to add things to the screen instead of Login(), i'm fairly sure you'll see better restults.

Also, make sure you have #define DEBUG in your code so you can pinpoint EXACTLY what line the error is comming from.
When you load a character, your client logs out on the current mob and logs in to the saved mob.

The previous mob continuously calls updateHealth() and updateEXP(). Remember that you logged out from that mob? That means its client is null. (Like what the runtime error says)
Howey wrote:
Code:
> mob/Login()
> if(prob(50))
> src.loc = locate(9,9,1)
> else
> src.loc = locate(27,9,1)
> src << browse(loginmessage)
> src.client.screen += new/obj/hudMeters/health_01
> src.client.screen += new/obj/hudMeters/health_02
> src.client.screen += new/obj/exphudMeters/exp_01
> src.client.screen += new/obj/exphudMeters/exp_02
> src.updateHealth()
> src.updateEXP()
>


Your issue is here, you're not creating the objects how the New() function you defined expects them to be created. You need to do:

new/obj/hudMeters/health_01(src.client)

And whatnot instead, because inside of New() you're adding to the screen already and you're telling it that it needs a client passed as the argument. Without that argument you're trying to add the object to nothing's screen.