ID:171942
 
I don't understand why I'm getting a runtime error with this, I never have before.
mob/proc/Name_hud()
var/obj/char_back/a = new
screen_loc = "8,12"
client.screen += a
var/obj/char_back/b = new
b.screen_loc = "9,12"
client.screen += b

obj/char_back
icon='back.dmi'

And these are the errors I'm getting.

runtime error: Cannot read null.screen
proc name: New (/obj/New)
usr: Troglodyte (/mob)
src: the char back (/obj/char_back)
call stack:
the char back (/obj/char_back): New(null)
Troglodyte (/mob): Name hud()
Troglodyte (/mob): CreateCharacter()
Troglodyte (/mob): Pick Name()
runtime error: Cannot read null.screen
proc name: New (/obj/New)
usr: Troglodyte (/mob)
src: the char back (/obj/char_back)
call stack:
the char back (/obj/char_back): New(null)
Troglodyte (/mob): Name hud()
Troglodyte (/mob): CreateCharacter()
Troglodyte (/mob): Pick Name()

Anyone have any ideas?
You've modified obj/New() somewhere and it's attempting to do something for a client and you've never passed a client as a parameter. Check the proc crash information: proc name: New (/obj/New). That's the code you need to provide.
In response to tenkuu
So would this be it?
And if so, what should I change to it to fix the problem?


objmenu/arrow
icon='arrow.dmi'
layer=MOB_LAYER+7
New(client/C)C.screen+=src
In response to Troglodyte
Oops, I could have sworn I posted the whole proc crash info, but src is /obj/char_back so you must have New() overriden for obj/char_back somewhere and you never pass in a client as a parameter.
In response to tenkuu
Alright I fixed the problem but what should I replace client with as the parameter?
Troglodyte wrote:
I don't understand why I'm getting a runtime error with this, I never have before.
mob/proc/Name_hud()
var/obj/char_back/a = new
a.screen_loc = "8,12"//I'm pretty sure "a" is supposed to be there
client.screen += a
var/obj/char_back/b = new
b.screen_loc = "9,12"
client.screen += b