mob
proc
Save()
var/savefile/S = new("Saves/[copytext(src.ckey,1,2)]/[src.ckey]")
S["x"] << src.x
S["y"] << src.y
S["z"] << src.z
src.Write(S)
Load()
if(fexists("Saves/[copytext(src.ckey,1,2)]/[src.ckey]"))
var/savefile/S = new("Saves/[copytext(src.ckey,1,2)]/[src.ckey]")
src.Read(S)
src.loc = locate(S["x"],S["y"],S["z"])
Logout()
usr.Save()
del usr
Problem description:
I am a little confused because it will create a save file but it won't save until the second time I play. What have I done wrong?
Edit: Forgot to mention the New and Load button are turf with Click() all they do is usr.Load() and new moves the player off the main menu to the map.
Also on the note of this code I attempted to just write S<>usr but that also didn't work so I attempted to save and load just x,y,z. :-/
</<usr>