ID:1753787
 
Keywords: object, save
(See the best response by Kaiochao.)
Code:
var
countobj=0
list
objects=list()

proc
ObjectSave()
var/FileName="Data/Objects.sav"
if(fexists(FileName)) fdel(FileName)
var/savefile/F=new(FileName)
objects=null
for(var/obj/O in world)
F["x[countobj]"]<<O.x
F["y[countobj]"]<<O.y
F["z[countobj]"]<<O.z
objects+=O
countobj++
F["objects"]<<objects
F["countobj"]<<countobj
world<<"Objects Saved([countobj])"


Problem description:

In my game, the map can be altered by players (houses, destruction, etc.). The problem arises when i try to save the objects in the world,i just get nothing at all when i try to load.
Best response
objects=null

// you probably want
objects = list()


Then, you might want to show the loading process.
In response to Kaiochao
    ObjectLoad()
var/FileName="Data/Objects.sav"
if(fexists(FileName))
for(var/obj/O in world)
del O
var/savefile/F=new(FileName)
F["objects"]>>objects
for(var/obj/O in objects)
O.loc=locate(F["x[countobj]"],F["y[countobj]"],F["z[countobj]"])
countobj--
world<<"Objects Loaded"


Sorry i took so long to respond, been busy recently. Here is the load proc