ID:140714
 
My save system used to work, and I discovered later on that after making a new character and playing while still logged on, it works still. After logging off, and coming back on, and re-logging into the Mob, the save system no longer works. Any help here? Thanks in advance! (If you need the save snippet, just ask.)
I see little chance if somebody figuring where you went wrong without showing what you actually did to begin with.
So, yes, adding the code seems beneficial.
I'll move this to 'Code Problems'.
In response to Schnitzelnagler
Code:
mob
proc
saveproc()
if(src.cansave)
var/savefile/save
save = new ("players/[src.key]")
save["mob"] << src
save["x"] << src.x
save["y"] << src.y
save["z"] << src.z
src<<"Your Game has been saved!"


Problem description:

My save system no longer works. When you make a new character and try to save, it works. But, when you log off and log back in, and attempt to save, it no longer works. Help, please?

In response to Xorbah
How is cansave determined? Is it coded in as always true or is it changed to true when a player creates? Because I'm not seeing any saving of variables there so from what I understand whenever a player logs on, regardless of what they were when they logged off they will always revert to the base variable that are hard-coded.
In response to THESINKING
F << src is saving src, including all variables that aren't declared as tmp or are just inherently unsaveable.
In response to Xorbah
You need to elaborate on "it no longer works". Does it produce an error message? Does the proc never run? Does the proc never reach the saving? Does the proc attempt to save but nothing is saved? You need to be specific, especially when you are only posting a small portion of your code.
In response to Garthor
Garthor wrote:
F << src is saving src, including all variables that aren't declared as tmp or are just inherently unsaveable.
Ah, ok, thanks, then that's not the problem. Though I would still like to know how cansave is determined, is it possible that somehow it's getting changed to false when you are loading your character?