mob/proc
SavePlayer()
var/savefile/F = new()
Write(F) //saves all non-tmp vars in the src mob
client.Export(F) //exports save file to key
LoadPlayer()
var/savefile/F = client.Import()
if(F) Read(F) //get savefile from client and apply
..()
This compiles and runs, but on calling LoadPlayer() in-game (I have a verb set up to call it, and it calls automatically as part of Login()), this happens:
//where keyname is the key of the user
runtime error: bad file
proc name: LoadPlayer (/mob/proc/LoadPlayer)
usr: (src)
src: keyname (/mob)
src.loc: null
call stack:
keyname (/mob): LoadPlayer()
keyname (/mob): Login()
Any ideas what I've done wrong?
Mind you, client-side saves are an iffy business. They're prone to tampering and there's ultimately nothing you can do to prevent that, only to mitigate it.