mob
proc
LoadPlayer()
if(fexists("players/[src.ckey].sav"))
var/savefile/F = new("players/[src.ckey].sav")
Read(F)
for(var/stuff in src.V)
src.verbs += stuff
world<<"<font size=1><font color=red><B>Info: <font color=white>[src]([src.key]) has logged in..."
//src.loc = locate(xco,yco,zco)
src.cansave=1
(Players ||= new) += src // LOL this code o-o
//src.AutoSave() // this starts auto save for players when they hit load
src.logincrap()
SaveK()
var/savefile/F = new("players/[src.ckey].sav")
if(fexists(F)) fdel(F)
src.V = src.verbs
Write(F)
mob/verb/Savenow()
usr.SaveK()
usr<< "Your game has been saved."
mob/Write(savefile/F)
//store coordinates
//F ["saved_verbs"] << verbs
F ["saved_x"] << x
F ["saved_y"] << y
F ["saved_z"] << z
//store variables
..()
mob/Read(savefile/F)
var {saved_x; saved_y; saved_z}
//load coordinates
//F ["saved_verbs"] >> verbs
F ["saved_x"] >> x
F ["saved_y"] >> y
F ["saved_z"] >> z
//restore variables
..()
//restore coordinates
Move(locate(saved_x,saved_y,saved_z))
mob/proc/AutoSave()
set background = 1
src.SaveK()
spawn(3000)
src.AutoSave()
runtime error: cannot open savefile buffer saved_x for write
proc name: Write (/mob/Write)
source file: Naruto.dm,161
usr: (src)
src: the ddgh (/mob)
src.loc: (69,37,1) (/turf/grass/tiles/gs138)
call stack:
the ddgh (/mob): Write(players/kyubikitsune.sav (/savefile))
the ddgh (/mob): SaveK()
the ddgh (/mob): Savenow()
Problem description:
Receiving the runtime error and although it's not DM i figured it would help to separate it. I have a very basic save/load system and my knowledge on it is very limited. I've looked through the DM guide and can't find anything on this but I was experimenting so do ignore the stuff in // as it's probably very wrong lol. However, I'm not sure what the runtime error means, all i know is that it's related to "F ["saved_x"] << x" in the write section. Any help is appreciated, thank you!
Edit--------
Also worth mentioning that it creates two savs; one with my key and one without for some reason. I'm only intending to create one.
</<>