ID:2331422
 
(See the best response by Spunky_Girl.)
Code: Problem then I try to load the save
proc name: EquipSkill (/obj/Skillcards/proc/EquipSkill)
source file: Hotkeys.dm,344
usr: Ataos (/mob)
src: Key0 (/obj/Skillcards/Skills/Run)
usr.loc: the trilhos (103,110,1) (/turf/Castle/Walls/Complet/trilhos)
src.loc: Ataos (/mob)
call stack:
Key0 (/obj/Skillcards/Skills/Run): EquipSkill("Key0")
Ataos (/mob): BuildHotbar()
Ataos (/mob): loadprocess()
the loadbutton (/obj/hud/Creationhud/loadbutton): Click(null, "default.map1", "icon-x=28;icon-y=4;left=1;scre..."


        proc/EquipSkill(obj/Slot)
var/obj/Skillcards/Skills/t = locate(/obj/Skillcards/Skills) in usr.contents
if(!t) return
if(Slot)
src.Slot1 = Slot.name
src.name = Slot.name
usr.client.screen += src
src.screen_loc=Slot.screen_loc
src.equippedthing = 1
usr.SetKey(Slot.name,src)
mob/proc
BuildHotbar()
for(var/obj/Skillcards/Skills/Z in src.contents)
if(Z.equippedthing==1)
Z.EquipSkill(Z.Slot1)


Problem description: First I was loading some skills then I saw the log and saw tons of erro and tried to change some things, now I cant load any skills, why is this hapenning?
I need to know what line 344 in your Hotkeys.dm file is exactly. I assume your BuildHotbar proc is what's calling your EquipSkill proc at the time of the error being thrown?

Just glancing through your code, your BuildHotbar proc is passing "Z.Slot1" into your EquipSkill proc (which Z is of the /obj/Skillcards/Skills type), and then your EquipSkill proc sets Z.Slot1's Slot1 variable to Z.Slot1's name. I'm fairly certain this isn't intended logic. I don't know what typing (if any) your Slot1 variable has in your /obj/Skillcards/Skills class, so I still can't be 100% positive.
You're setting Slot1 to Slot.name (a string) and then later call Z.equipSkill(Z.slot1) and treating the argument as a reference to an object of some sort. Just remove the entire Slot1 = Slot.name line.
In response to Spunky_Girl
                src.Slot1 = Slot.name
- thats the line 344

I change just for "= Slot" and it's loading, but im seeing a error every time that mob logins
runtime error: Cannot read null.screen
proc name: New (/obj/Keys/New)
source file: Hotkeys.dm,238
usr: null
src: Key1 (/obj/Keys/Key1)
src.loc: null
call stack:
Key1 (/obj/Keys/Key1): New(null)
Guest-253822146 (/mob): loadprocess()
the loadbutton (/obj/hud/Creationhud/loadbutton): Click(null, "default.map1", "icon-x=118;icon-y=26;left=1;sc...")


 C.screen+=src
that's the line 238
    New(client/C)
screen_loc=locc
C.screen+=src


I'm not sure what I have to change for the error stop
In response to Czoaf
Best response
In your original post, you're using "usr" in your EquipSkills proc. Stop that. Entirely. You should never use "usr" in procs other than the mouse-related procs (ie DblClick() and MouseDrag() ).

As for your latest question, the error means exactly what it says - "cannot read null.screen". That means, go to your line 238, and whatever part of it specifically says "whatever.screen" is actually null.screen during runtime when this error occurs.

Looking at your provided code for your line 238 (which is very minimalistic, by the way, if you want help), that New() proc you wrote isn't being passed anything when it's called. When you create a new whatever object that New belongs to, you should check to see if one of its arguments was actually passed to it before proceeding.
obj
New(var/loc, var/client/c)
..()
if(!c) //if no client is passed as an argument when this object is created...
del src //delete this object
world<<"[src.name] was created successfully"
In response to Spunky_Girl
thank you !