#define DEBUG
client
proc/Save()
var/savefile/S = new("SaveFiles/Players/[ckey].sav")
S["mob"] << mob
S["x"] << mob.x
S["y"] << mob.y
S["z"] << mob.z
proc/Load()
if(fexists("SaveFiles/Players/[ckey].sav"))
var/savefile/S = new("SaveFiles/Players/[ckey].sav")
var/x;var/y;var/z
S["mob"] >> src.mob
S["x"] >> x
S["y"] >> y
S["z"] >> z
src.mob.loc=locate(x,y,z)
src.mob << "Savefile Loaded."
src.mob.UpdateBars()
client/New()
..()
src.Load()
client/Del()
..()
src.Save()
Problem description:
For some reason every time I start up my game via the RUN command in Dream Maker, I get disconnected and in my output it tells me this:
Connection failed. Reconnecting in 10 seconds... runtime error: Cannot read null.x proc name: Save (/client/proc/Save) source file: Saving & Loading.dm,6 usr: null src: A. Ness (/client) call stack: A. Ness (/client): Save() A. Ness (/client): Del() Login() A. Ness (/client): New()
Now I've been searching these forums all day, I've went through many demo's to see if I had done something wrong. Now I've ended up here asking the BYOND Developers for help. I just can't seem to figure this one out. The code had worked countless times before (even once today September, 6th). Now it just quit working.. I have no clue why I'm getting disconnected when I run my game.
Edit: Also make sure that the person is logged in as a playable character when saving. If someone logs on to the title screen then disconnects, the ghost /mob used for the title screen will overwrite the previous save file (it may not appear to have much of an impact now but later on it will)