ID:146686
 
Code:
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

Ishtama wrote:
Can anyone help me? :S

Try reading this:

http://www.deadron.com/Games/ByondBasicSavefiles.html
In response to Deadron
Thanks for giving me that site to look at, but like I said before, I suck at coding..and when I say I suck, I reaallly mean it. I can barely understand anything unless it is explained directly to me :S

Thank's again for showing me that...but i'm gonna need more explanation of like..where the problems are, what you have to do to fix them, so on. You know, like hands on trayining :P.