SavePlayer()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["Name"]<<src.name
F["TFP"] << src.TotalFreezePoints
F["TUF"] << src.TotalUnFreezePoints
F["THS"] << src.TotalHideScore
F["TIT"] << src.Times_IT
F["NIT"] << src.non_IT_times
F["GW"] << src.GamesWon
F["TF"] << src.TimesFrozen
F["Music"] << src.music
F["MF"] << src.MostFreezes
F["MUF"] << src.MostUnFreezes
F["LS"] << src.LongestSurvival
return
//-----------------------------------------------------------------------------------------------------------------
LoadPlayer() //Load proc
var/firstletter=copytext(src.ckey, 1, 2)
if(fexists("players/[firstletter]/[src.ckey].sav"))
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["Name"] >> src.name
F["TFP"] >> src.TotalFreezePoints
F["TUF"] >> src.TotalUnFreezePoints
F["THS"] >> src.TotalHideScore
F["TIT"] >> src.Times_IT
F["NIT"] >> src.non_IT_times
F["GW"] >> src.GamesWon
F["TF"] >> src.TimesFrozen
F["Music"] >> src.music
F["MF"] >> src.MostFreezes
F["MUF"] >> src.MostUnFreezes
F["LS"] >> src.LongestSurvival
return
Problem description:
This works close to perfectly, it nearly always saves peoples scores, but sometimes without me deleting any files, it doesn't load certain peoples files...
I give credit to Dark Emrald for helping with this, but obviously it still needs work.
-KirbyAllStar
Any runtime errors, or just they go to load the player and it does absolutely nothing? When this happens, do they actually have save files and they're just not loading, or are they mysteriously disappearing? Did you try writing some kind of troubleshooting proc that will output the contents of the save files to see that they contain valid data?
Also, I'm not sure what kind of game you're running, but you know you can just save and load the mob directly instead of each individual variable, right? Theres only a couple exceptions like loc.