ID:139918
 
Code:
mob
proc
Save() //Save procedure
var/list/temp_verbs
src.verbs += temp_verbs
S["last_x"] << src.x //stores last X coordinate
S["last_y"] << src.y //stores last Y coordinate
S["last_z"] << src.z //stores last Z coordinate
S["mob"] << src
S["verbs"] << temp_verbs
var/char = ckeyEx(usr.name)//setting the char var
S["/[ckey]/[char]"]<<src//saving all the players vars
Write(S) // Writes the stored files into one
Load() //Load procedure
if(fexists("Saves/[src.ckey]")) // Looks for written save file and if it exists it allows acces to load
var/savefile/S = new("Saves/[src.ckey]") //opens the old save file
Read(S) //Reads it
var/list/temp_verbs
S["mob"] >> src
S["last_x"] >> src.x //Loads the last X Coordinate
S["last_y"] >> src.y //Loads the last Y Coordinate
S["last_z"] >> src.z //Loads the last Z Coordinate
S["verb"] >> temp_verbs
src.verbs += temp_verbs
var/char = ckeyEx(usr.name)//setting the char var
S["/[ckey]/[char]"]>>src//saving all the players vars
runtime error: wrong type of value for list is the error I get everytime it saves.

Problem description:

Personally, I say you should never save verbs for any reason. I believe verbs should be given and re-given upon login.
In response to Spunky_Girl
You would still need to save which ones to re-give, somehow.
In response to Falacy
No, you wouldn't.
var/list/blah = list("Falacy")
client/New()
..()
if(src.key in blah)
src.verbs += typesof("whatever")

This is just one example of how to do it.
In response to Spunky_Girl
You wouldn't be able to use that for anything dynamically character based. At least not without saving something, somewhere, to denote which verbs to add.
ie: If I join a leaf village in naruto rip #9001, unless I somehow save that I'm in leaf land then I won't know to add leaf verbs.
In response to Falacy
Well that's a poor example since those rips have horrible game design to begin with. But if you had to do something, you could check their village upon login and then what hand seals they know and give them their village's verbs accordingly. Granted, all they would have to do is relog upon learning all the hand seals and then magically they'd receive their verbs, but that just reinforces my earlier statement about those rips having poor game design from the beginning.

EDIT
I use objs for my "skills", and if they have a verb attached to them, then the player receives it (obviously). That's one way of indirectly saving the verbs I suppose.
You are attempting to add null to src.verbs. Hence, the error.

Regardless, you are saving incorrectly. The correct format is like so:

client
proc
Save()
var/savefile/F = new("[ckey].sav")
F["mob"] << mob
// Do not add anything more to be saved here
Load()
if(fexists("[ckey].sav"))
var/savefile/F = new("[ckey].sav")
F["mob"] >> mob
// Do not add anything more to be loaded here

mob
Write(var/savefile/F)
..()
// Add any special processing for saving here
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
// Add any special processing for loading here
loc = locate(F["x"], F["y"], F["z"])
In response to Garthor
Yeah, it works now. But I constantly update the game, so is there any way to make it so it saves them even when I restart server?
In response to Colin1011
Save before you restart the server.
In response to Garthor
What do you mean by that?