mob
proc
Save()
var/savefile/S = new("Saves/[usr.ckey]")
S["last_x"] << usr.x
S["last_y"] << usr.y
S["last_z"] << usr.z
Write(S)
Load()
if(fexists("Saves/[src.ckey]"))
var/savefile/S = new("Saves/[usr.ckey]")
S["last_x"] >> usr.x
S["last_y"] >> usr.y
S["last_z"] >> usr.z
Read(S)
usr.loc=locate(usr.x,usr.y,usr.z)
else
usr << "No savefile detected."
Problem description:
BYOND Error:(Sfile.cpp,1193) failed to open file:
BYOND Error:(Sfile.cpp,1193) C:\Users\Gebruiker\Downloads\MyDbz\DBZ\Saves\
proc name: Save (/mob/proc/Save)
source file: Backup.dm,31
usr: Crakenguy (/mob/player)
src: Crakenguy (/mob/player)
call stack:
Crakenguy (/mob/player): Save()
Crakenguy (/mob/player): Logout()
Darker Legends (/mob/player): Load()
Load (10,233,11) (/turf/TitleButtions/Load): DblClick(Load (10,233,11) (/turf/TitleButtions/Load), "mapwindow.map", "icon-x=4;icon-y=32;left=1;scre...")
Additionally, you are saving/loading wrong. The proper way to do it is so:
Calling Read() and Write() directly will result in mangled savefiles.
<edit> Whoops, misread the error. The mob's ckey is no longer valid after Logout(), so you are trying to open the file "".