Savefile not loading lists inside of an object? in Developer Help
|
|
Code:
book Write() contents=new/list() ..() player Write(savefile/F) F["version"] << SAVEFILE_VERSION ..() F["save_x"] << x F["save_y"] << y F["save_z"] << z
Read(savefile/F) loc = locate(F["save_x"],F["save_y"],F["save_z"]) var/version F["version"] >> version if(isnull(version)) version = 0
switch(version) if(1) if(isnull(hp)) hp = new /restricted(0,100,100) ..() update_grids()
|
Problem description:
In my game, I save an object that contains a list of objects. For some reason, when I look at my savefile, it shows all of the objects there (only using one for testing purposes), but when I load it, it becomes null. The /spell type doesn't have any overridden Read/Write procs, so I'm not sure what went wrong in loading the list.
The only read/write procs I have are on the player himself, and a Write on the book itself, but it only destroys the contents, not the list.
Savefile:
equipment = list("Book" = object(".0"),"Body" = object(".1")) .0 type = /book/Epic_Book spells = list(object(".0"),null,null,null,null,null,null,null,null,null) .0 type = /spell owner = object("../../../../..") initial_components = list(object(".0")) .0 type = /root/igni uses = object(".0") .0 type = /restricted initial = -7 minimum = 0 current = -7 maximum = -7 current_components = list(object(".0")) .0 type = /root/igni uses = object(".0") .0 type = /restricted initial = -7 minimum = 0 current = -7 maximum = -7 component_count = list("igni" = 1) element = 128 range = 0 power = 5 speed = 0 sustain = 0 average_tier = 1 name = "Igni" icon_state = "igni1" suffix = "Equipped" overlays = list(object("../../.1/overlays",6))
|
But after I load, the whole .0 disappears. :(
|