mob
var
saved_x
saved_y
saved_z
Write(savefile/F)
saved_x = x
saved_y = y
saved_z = z
..()
Read(savefile/F)
..()
Move(locate(saved_x,saved_y,saved_z))
var/savefile/SaveFile = new("players.sav")
mob/Login()
SaveFile.cd = "/"
if(ckey in SaveFile.dir)
SaveFile.cd = ckey
Read(SaveFile)
usr << "[usr] has come back!"
else
usr << "[usr] has began!"
if(client.gender=="male")
usr.icon='mobs.dmi'
usr.icon_state = "mm1"
else if(client.gender=="female")
usr.icon='mobs.dmi'
usr.icon_state = "fm1"
..()
mob/Logout()
var/savefile/F = new(ckey)
Write(F)
del(src)
Problem description:
I know almost nothing about coding, and I needed some sort of auto-saving file for my game so I contacted a friend for help. He did this code for me, but has now been too busy doing nothing to help me. (HAH) The problem i'm finding with this code, is that when you go to login, it makes the save file and all, but when you logout, then come back into the game, it makes a whole new save file. Then when you logout again, it overwrites the one before that. Can anyone help me? :S
Try reading this:
http://www.deadron.com/Games/ByondBasicSavefiles.html