ID:145714
 
Code:
var/ACiD_Handling/Handle=new
ACiD_Handling
var
savedir="Players"
list/access=list("chwgt","cheetoz")
characters_allowed=0
proc/DeleteSave(mob/M)
if(fexists("./[savedir]/[M.ckey]"))
if((M.TimedAlert("Do you really wish to delete your character?","Are you sure?","Yes","No",20))=="Yes")
fdel("./[savedir]/[M.ckey]")
return 1
return 0
proc/LoadSave(mob/M)
if(fexists("./[savedir]/[M.ckey]"))
var/savefile/F=new("./[savedir]/[M.ckey]")
F["Loc"] >> M.loc
Read(F)
proc/CreateNew(mob/M)
if(fexists("./[savedir]/[M.ckey]"))
alert(M,"If you chose to create a new character, your old one will be deleted.")
if(Handle.DeleteSave(M))
M.loc=locate(8,6,9)
else M.loc=locate(8,6,9)
proc/Save(mob/M=src)
var/savefile/F=new("./[savedir]/[M.ckey]")
F["Loc"] << M.loc
Write(F)

mob/var/alert/alert
alert
proc/Alert(mob/C,msg,win,Opt1="Yes",Opt2="No",seconds)
if(!C) return
if(seconds)spawn(seconds*10)del(src)
var/answer=alert(C,msg,win,Opt1,Opt2)
if((answer==Opt1)) return Opt1
return Opt2
mob/proc
TimedAlert(msg,win,Opt1="Yes",Opt2="No",seconds=20)
if(alert)del(alert)
var/alert/Ask=new
alert=Ask
.=Ask.Alert(src,msg,win,Opt1,Opt2,seconds)
del(Ask)


Problem description: runtime error: Cannot modify null.loc.
proc name: LoadSave (/ACiD_Handling/proc/LoadSave)
source file: Character Handling.dm,16
usr: null
src: /ACiD_Handling (/ACiD_Handling)
call stack:
/ACiD_Handling (/ACiD_Handling): LoadSave(null)
(8,3,10) (/turf/Login_Stuff/Load_Character): Click( (8,3,10) (/turf/Login_Stuff/Load_Character))


If anyone could help, i'd appreciate it.
F["Loc"] >> M.loc

You can't save and load locations like that. You have to use seperate variables for x,y, and z. Your location is a turf, and everytime the world is opened or close, entirely new turfs are created.

[Edit]
mai msn r [email protected]
mai aim r superllamalicker

I must speak with you about a library or demo of yours.
In response to CaptFalcon33035
You can save and load locations like that, I admit, I was being lazy with it by not saving seperate x,y, and z in the savefile, but, the problem was fixed by taking out mob/Logout() and replacing it with


client/Del()Handle.Save(mob)






EDIT: Yes, and I know the snippet is horribly chopped, I was rushing to get it to him, and as we speak I am going through it and optimizing it, and fixing some useless things.