ID:177125
 
I know there are a lot of tutorials explaining how to do this, but I am kinda bored of looking through them trying to understand and I don't want to be a copy/paste programmer. So, can someone please explain me how to load a char? I know how to save, no idea how to load. Ya know, check if the file exists and ask to load instead of creating a new one? Can someone, please?
Regards
Leandro
look up fexists().
In response to Soccerguy13
fexists proc

Format:
fexists(File)

Args:
File: name of file to test

Returns:
1 if file exists; 0 otherwise.

ok...now I know how to know if the file exists. How do I load it?
In response to Leahn
No worries about it anymore
Dreadon made a tutorial at BYOND FAQ
I am gonna check and learn
Sankyuu
In response to Leahn
I am not ending this thread yet
I studied the Deadron's Tutorial about basics of saving
I studied all the script and now I know how to save ONE variable. I tried to change some things to suit my needs and I ended up with:

client/proc
SaveCharacter(char_name)
var/savefile/F = new("players.sav")
var/safe_name = ckey(char_name)
F.cd = "/[ckey]/[safe_name]"
F["full_name"] << mob

It says "Can't read null.ckey"
How do I fix, please?
In response to Leahn
I changed some things
Now I have this:

client/proc
SaveCharacter(char_name)
var/savefile/F = new("jogadores.sav")
var/safe_name = ckey(char_name)

F["[usr.key]/[safe_name]"] << mob

It says "can't read null.mob"
the error message says the src = null
How do I fix this? Please?
In response to Leahn
Where are you calling it from? Can you post the code where you're calling it from?