ID:841757
 
(See the best response by Albro1.)
Code:
mob/var/list/hot_slots=list()
mob/proc
SaveSkills()
for(var/Skill/S in usr.client.screen)
if(S)
hot_slots[S] = S
LoadSkills()
for(var/Skill/T in usr.hot_slots)
if(T)
src.client.screen += T


Problem description:
Well i tried to make an hot key slots (0-9), it's worked but the problem is when i trying to save it, it's gives me an error (well the save works)
runtime error: Cannot read null.screen
proc name: New (/obj/Huds/Slots/Hud5/New)
usr: null
src: Hud5 (/obj/Huds/Slots/Hud5)
call stack:
Hud5 (/obj/Huds/Slots/Hud5): New(null)

i tried to fix it, but it just won't work..

#ZeroDay .
Don't use usr in procs. Use src.

usr is what called the proc - in which case, usr could even be another proc.
src is the source of the proc, which is the mob.
In response to Albro1 (#1)
Albro1 wrote:
Don't use usr in procs. Use src.

usr is what called the proc - in which case, usr could even be another proc.
src is the source of the proc, which is the mob.

it's the code edited code.. i tryed to change it to [usr] for fixing it, but src doesn't works also..
This error isn't even in SaveSkills().

Your error is in /obj/Huds/Slots/Hud5/New().
In response to Albro1 (#3)
Albro1 wrote:
This error isn't even in SaveSkills().

Your error is in /obj/Huds/Slots/Hud5/New().

i know, but it doesn't really matter the object it's above to the skill i setted..
The error is in the HUD's New() proc. I'm not sure what is so hard to understand about that.

You are doing something with a .screen variable and the source you are using for it ends up being null. Post the HUD's New() proc.
In response to Albro1 (#5)
Albro1 wrote:
The error is in the HUD's New() proc. I'm not sure what is so hard to understand about that.

You are doing something with a .screen variable and the source you are using for it ends up being null. Post the HUD's New() proc.

i do understanding it bro,
but the problem it's above to the key i setted ! if i set 4
it's will display Hud5 error, if i setted 1 that's display Hud2 error !
icon='Hud.dmi'
icon_state="7"
layer = 100
New(client/c)
screen_loc="2,1"
c.screen+=src
Best response
You are calling New() somewhere in your code and you aren't sending a client to the argument.
In response to Albro1 (#7)
Albro1 wrote:
You are calling New() somewhere in your code and you aren't sending a client to the argument.

I'm calling it right..
mob
proc
Hud()
new/obj/Huds/Hud1(src.client)
new/obj/Huds/Slots/Hud2(src.client)
new/obj/Huds/Slots/Hud3(src.client)
new/obj/Huds/Slots/Hud4(src.client)
new/obj/Huds/Slots/Hud5(src.client)
new/obj/Huds/Slots/Hud6(src.client)
new/obj/Huds/Slots/Hud7(src.client)
new/obj/Huds/Slots/Hud8(src.client)
new/obj/Huds/Slots/Hud9(src.client)
new/obj/Huds/Slots/Hud10(src.client)
new/obj/Huds/Slots/Hud11(src.client)
new/obj/Huds/Slots/Number1(src.client)
new/obj/Huds/Slots/Number2(src.client)
new/obj/Huds/Slots/Number3(src.client)
new/obj/Huds/Slots/Number4(src.client)
new/obj/Huds/Slots/Number5(src.client)
new/obj/Huds/Slots/Number6(src.client)
new/obj/Huds/Slots/Number7(src.client)
new/obj/Huds/Slots/Number8(src.client)
new/obj/Huds/Slots/Number9(src.client)
new/obj/Huds/Slots/Number0(src.client)
new/obj/Huds/Attack(src.client)
new/obj/Huds/Power(src.client)
new/obj/Huds/Dash(src.client)
new/obj/Huds/Action(src.client)
new/obj/Huds/Preform(src.client)
When are you calling mob.Hud()?
In response to Kaiochao (#9)
Kaiochao wrote:
When are you calling mob.Hud()?

When he logs in & creating new char
*Bump* Still don't know how to solve it..
*Bump* [?]
Is there anywhere else you are calling the New() procs for this?
In response to Albro1 (#13)
Albro1 wrote:
Is there anywhere else you are calling the New() procs for this?

Not really.. =\
can i give you want a Team Viewer access or something like that dude ?
*Bump*
Common guys..
I'll TeamView you. Page me with the details and I'll be on in a bit.
In response to Albro1 (#16)
Albro1 wrote:
I'll TeamView you. Page me with the details and I'll be on in a bit.

Sent you a request, please confirm .
What? I said page me. With BYOND. Page me the details to access you.
In response to ZeroDay (#10)
ZeroDay wrote:
Kaiochao wrote:
When are you calling mob.Hud()?

When he logs in & creating new char

Does the mob that you're calling it on have a client set? Many people will create a secondary mob during character creation, and then only assign the client to it at the end (so if you're doing this as well, and you called Hud() on that secondary mob, it might not have the client set yet).

Anyways, show us the code where you're calling Hud().