ID:149700
 
Ok here's my code:

area
KeepObj_Area
New()
var/savefile/F = new("KeepObj_Data.dat")
F << src
del(F)
..()
Del()
var/savefile/F = new("KeepObj_Data.dat")
F >> src
del(F)
..()


What I'm trying to do is save all the objects that are in the area when it is deleted, and load them when it is created. But so far nothing seems to work (been at it for 2 hours now), any ideas?
You would have to save everything in src.contents contents being anything that are in src's loc.
In response to Nadrew
I tried the same code with src.contents instead, but still got the same result :\
In response to Dreq
You could also try

area
blah
New()
var/savefile/F = new("blah.sav")
for(var/atom/A in src.loc)//It might me .loc.loc I can't remember
F["items"] << A

I think it's because of the:
del(F)

Your creating a savefile, saving data to it, then deleting the savefile. Then when your try to load it you create a new savefile, try to load something that isn't there (because you deleted it) then you delete that savefile.

I've never actually used:
del(F)
with a savefile but I'd assume that would delete the savefile...
In response to English
Ehm del(F) closes the save file. And I know it's saving data to it because theres a file there with data in it when i run/stop the game (i deleted the data and tried to confirm). THOUGH, nandrew's code simply did the SAME THING mine was doing, only manually listed the things in a part of the file, instead of letting byond do the work. Nedless to say it STILL DIDN'T WORK.....

I've even tried the: thearea.Write(F) thearea.Read(F) but even that didn't work.....