ID:261896
 
var/X
var/Y
var/Z
mob
var
saved = 1
mob/login

verb
NewGame()
set category = "*Start*"
usr << "New Game Started"
usr.loc = locate(7,5,1)
usr.verbs-= /mob/login/verb/Load
usr.verbs-= /mob/login/verb/NewGame
Save2()
set category = "Misc"
set name = "*Save*"
var/savefile/F = new(ckey)
Write(F)
usr << "Saved!"
Load()
set category = "*Start*"
if(usr.saved)
var/savefile/F = new(ckey)
Read(F)
usr << "Loaded!"
usr.loc = locate(7,5,3)
usr.verbs-= /mob/login/verb/Load
usr.verbs-= /mob/login/verb/NewGame
else
usr << "You've never saved, so you can't load!"

Write(savefile/F)
..()
F["last_x"] << x
F["last_y"] << y
F["last_x"] << z
F["X"] << X
F["Y"] << Y
F["Z"] << Z
Read(savefile/F)
..()
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_x"] >> last_z
F["X"] >> X
F["Y"] >> Y
F["Z"] >> Z
src.loc=locate(X,Y,Z)
src.loc=locate(last_x,last_y,last_z)


Alright.
sometimes i get some weird errors... but thats not why im posting this..

What this is... is.. Either i can get it to save.... and load fine.. but if you have no save state and click 'load' it just directs you to the starting point.

But if i change the var 'saved' to 0.. then.. you cant load even IF you saved..

..sooo.. whats wrong here?

Thx
Cait.


</<></<></<></<></< ></<>
Umm, what's telling it that saved is 1 when the player logs in? Rather than using a hopeless saved variable, do a check if the file exists with fexists().