ID:175379
 
Ok, I've been through the book and help section and even looked through deadron character handling, but I really don't get savefiles for some reason :(. I'm trying to save an in-game message board. The board works fine using topics as objects and putting them in the boards contents, but it loses it's appeal when everything dissappears at reboot. This is one of my attemts to save the contents:

var/savefile/Mboard = new("mboard.sav")
obj/msgboard
Del()
Saveboard()
..()
New()
Loadboard()
proc
Saveboard()
Mboard << src.contents
Loadboard()
Mboard >> src.contents

It actually makes a savefile, but I don't see the previous messages. Do I still even place the obj on the map if I'm saving and loading? Am I doing any of this right? Any help would be appreciated. :)</<>
Jnco904 wrote:
Ok, I've been through the book and help section and even looked through deadron character handling, but I really don't get savefiles for some reason :(.

Try reading this tutorial:

http://www.deadron.com/Games/ByondBasicSavefiles.html
In response to Deadron
Ok, will do. Thanks :)
In response to Deadron
Thats still not on the bwicki? I'l add it when I get back home for you. That is presuming you have not gained problems about this?
In response to Deadron
I've been trying to save the contents of this message board for a while now. I have managed to get it to save(though I'm not sure if it is saved correctly because I can't read the file lol), but I can't seem to get it to load. Here is my code:

obj/msgboard/proc/Saveboard()
var/savefile/F = new("mboard.sav")
var/obj/topic/T
for(T in src.contents)
F["/topics/[T.name]"] << T
obj/msgboard/proc/Loadboard()
var/savefile/F = new("mboard.sav")
var/obj/msgboard/M = /obj/msgboard
F.cd = "/topics"
var/list/topics = F.dir
for(M)
M.contents += topics



It tells me that I cannot append to list when Loadboard is called. I don't get it, does that mean I'm trying to add stuff the wrong way, or is that just not possible and I have to find out how to save the whole object? Anymore help would be appreciated.