world // World stuff
view = 6
New() // When World is created
LoadNames() // Load Names/Villages
LoadVillages()
..()
Del() // When World is closed
SaveNames() // Save Names/Villages
SaveVillages()
..()
var
list
Names = list()
Villages = list()
Here are the saving procs
SaveNames() // Saves names to SaveFile
var/savefile/F = new("Names")
F["Names"] << Names
LoadNames() // Loads names from SaveFile
var/savefile/F = new("Names")
F["Names"] >> Names
SaveVillages() // Saves Villages
for(var/Village/X in Villages)
X.Save()
LoadVillages() // Loads Villages
for(var/Village/X in Villages)
X.Load()
// These next are under Village datum //
Save() // Saves village data
var/savefile/F = new("Villages/[src.Name]")
src.Write(F)
Load() // Loads village data
var/savefile/F = new("Villages/[src.Name]")
src.Read(F)
I'm a big fan of Read()/Write() and last night they WERE working, I tested them with debugging verbs that called Save/Load procs listed under world.New()
Each time I run the game, and use a villages() verb (Which returns the names of all Villages in list/Villages) it only returns the one that I created myself in. And I can name myself the same thing over and over again because the LoadNames() doesn't seem to work properly. Any ideas?
The creation of save files without me personally calling the Save() functions tells me that world.Del() is working properly (or at least, is doing something). That leaves world.New() to not be working properly and I can't imagine why.
EDIT: Upon closer investigation, I realize that list/Villages() is initialized to an empty list upon creation, so there's an excuse for that to not work. The names, however, does not.
Isn't Villages an empty list? Or is there some other part of the code that populates this list? If so, you should do that before calling LoadVillages()
And a side-note, world.New() doesn't do anything so calling the parent is not necessary