ID:2148957
 
Code:
mob/proc/LoadProc()
var/FileName="Data/Players/[ckey(src.key)].sav"
if(fexists(FileName))
var/savefile/F=new(FileName)
src.Read(F) //line 20
src.loc=locate(F["LastX"],F["LastY"],F["LastZ"])
src<<"Character Loaded..."
if(src.logouttime>0) src.logouttime=0
if(src.mfusable==1)
src.verbs+=typesof(/mob/fusion/verb/)
if(src.ragable==1)
new/obj/RMeter/R_01(src.client)
src.updateRage()
if(src.ss==1)
src.TransDrain()
if(src.dying==1)
if(src.Stamina>src.MaxStamina*0.3)
src.icon_state="Crawl"
src.DyingProc()
if(src.flinching==1)
src.ingame=1
src.skillactive=0
src.attacking=0
src.flinching=0
src.client:perspective = EDGE_PERSPECTIVE
client.eye = src
client.focus=src
src=src
src.keydegrade()
src.RageDrain()
if(src.ssg==1)
new/obj/GMeter/GP_01(src.client)
src.updateGPwr()
src.TransDrain()
src.savable=1
src.Movement()
src.fusebody=null
var/gone=year-src.laston
if(gone>0)
src.age+=gone
src.HUDProc()
return 1
else
return 0


Error Displayed:
runtime error: cannot append to list
proc name: LoadProc (/mob/proc/LoadProc)
source file: SaveSystem.dm,20
usr: (src)
src: the m (/mob)
src.loc: null
call stack:
the m (/mob): LoadProc()
the m (/mob): Login(null)


Problem description:
This problems has never occurred before, however sometimes it does and sometimes it doesn't and I have no clue about what it is that triggers it. The above error may sometimes be displayed when the load button is selected upon running the game, but sometimes the loading process completes itself with no apparent errors while other times I load into the game without an icon and default values in my stat panel.
I would recommend using ExportText() on the savefile when a read error is encountered (you can use a try/catch block for this), so that you can get a closer look at what might possibly be triggering this.

This error message comes up when a list append is an illegal operation. It can mean:

1) Appending to a regular list, the server ran out of memory.
2) Appending to an atom or atom.contents, the item being added can't go there.
3) Appending to an image or image.contents, which is not a thing.
4) Appending to a verbs list, the verb or proc being added isn't valid or for some reason can't be added to this list.
5) Appending to a savefile or savefile.dir, a path can't be created.
6) Appending to client.images, the value isn't an image.
7) Appending to client.screen, the value isn't a movable atom.
8) Appending to any other value as if it's a list, if it isn't.

That looks like a big list but it's actually fairly limited. When seeing your savefile contents, the problem may well jump out.
It's also why I hate using >> (and Read()) to load saves, it makes it almost impossible to track down an issue caused by the save failing to load. At least manually loading and saving things gives you an idea of where to look.

Oh no, your save failed to load because you removed a type-path in your code and forgot to account for it being saved? Too bad, you get to go over potentially thousands of lines of savefile data hoping to find the issue without having any clue what you're looking for.

It would sure be nice if Read() would point at a line in the savefile or something when it failed.
In response to Nadrew
Nadrew wrote:
It would sure be nice if Read() would point at a line in the savefile or something when it failed.

Agreed, although savefile reads aren't line-aware. Lines only exist when the savefile is exported to text.

It would be nice if I could figure out a way to tell which var caused the issue, though.
Thanks for your help guys, I'll look into it using ExportText() as recommended