ID:170974
 
Hey, I have a question about saving datums, I'm trying to make my guild system as you've seen below, and I'm wondering if this will actually do what I want and save the datum.

proc/SaveDatum()
var/savefile/F = new("lists/Guild_System.sav")
/datum/guild_system/ >> F


Or something of the sort
Lenox wrote:
Hey, I have a question about saving datums, I'm trying to make my guild system as you've seen below, and I'm wondering if this will actually do what I want and save the datum.

proc/SaveDatum()
var/savefile/F = new("lists/Guild_System.sav")
/datum/guild_system/ >> F

Or something of the sort

Close, but not quite. The file should be on the left side and the value you are storing on the right. The operator should point to the file though.

Also, you want to store an instance of the guildsystem, not just the type path for it.


You should change the second line of that proc to:
    F << var_that_holds_a_guildsystem_instance


Or better yet, save your entire guilds list in one action:
proc/SaveDatum()
var/savefile/F = new("lists/Guild_System.sav")
F << var_that_holds_your_list_of_guilds