ID:802793
 
(See the best response by LordAndrew.)
Code:
Load:
mob
icon = 'guy.dmi'
icon_state = "guy"
screen_loc = "10,10"
Login()
usr.load()
world << "<b>\green [usr] has logged on!</b>"
possiblebattle = 0
usr.Debug()
..()
Logout()
world << "<b>\green [usr] has logged out!</b"
usr.Debug()
del(src)
client
Del()
usr.save()
sleep(10)
..()
mob
proc
save()
var path = "savefiles/[ckey]/main.sav"
var pathlocx = "savefiles/[ckey]/location/x.sav"
var pathlocy = "savefiles/[ckey]/location/y.sav"
var pathlocz = "savefiles/[ckey]/location/z.sav"
var areapath = "savefiles/areas/[name].sav"
if(fexists(path))
fdel(path)
if(fexists(pathlocx))
fdel(pathlocx)
if(fexists(pathlocy))
fdel(pathlocy)
if(fexists(pathlocz))
fdel(pathlocz)
if(fexists(areapath))
fdel(areapath)
new /savefile ("savefiles/[ckey]/location/x.sav") << usr.x
new /savefile ("savefiles/[ckey]/location/y.sav") << usr.y
new /savefile ("savefiles/[ckey]/location/z.sav") << usr.z
new /savefile ("savefiles/[ckey]/main.sav") << usr
var/b = usr.loc
new /savefile ("savefiles/[ckey]/loc.sav") << b
for(var/area/a in world)
new /savefile ("savefiles/areas/[a.name].sav") << a
return 1

load()
var path = "savefiles/[ckey]/main.sav"
var pathlocx = "savefiles/[ckey]/location/x.sav"
var pathlocy = "savefiles/[ckey]/location/y.sav"
var pathlocz = "savefiles/[ckey]/location/z.sav"
var areapath = "savefiles/areas/[name].sav"
if(!fexists(path)) return 0.
if(!fexists(pathlocx)) return 0.
if(!fexists(pathlocy)) return 0.
if(!fexists(pathlocz)) return 0.
new /savefile (path) >> usr
usr.Move(locate(pathlocx,pathlocy,pathlocz))
if(!fexists(areapath)) return 0.
for(var/area/a in areapath)
new /savefile (areapath) << a.loc
return 1



Area:
area
var/areaname = ""
var/battles = 0
var/min = 0
var/max = 0
var/areaano = 0
var/monsters = list()
Entered()
..()
if(!(usr.ckey == null))
if(areaano == 1)
usr << "You entered [areaname]!"
if(!(usr.area == src))
usr.area = src
if(src.battles == 1)
usr.possiblebattle = 1
..()
else
usr.possiblebattle = 0
return ..()
area
delaria
areaname = "Delaria"
battles = 0
areaano = 1
area
blackmarket
areaano = 1
areaname = "The Black market"
battles = 0
area
outside1 //the area outside delaria
areaano = 1
areaname = "Outer deleria"
battles = 1
monsters = list(new/obj/monsters/slime)
min = 1
max = 2
area
forest
areaname = "Forest"
battles = 1
min = 1
max = 4
monsters = list(new/obj/monsters/slime)
area
desert
areaano = 1
areaname = "The Desert"
battles = 1
min = 1
max = 4
monsters = list(new/obj/monsters/smily)



Problem description:ok my savesystem and area is messing my game all up theres void(black tiles) all throughout my map and all my turfs/objs are scattered this ONLY happened after i added my areas and it only happens when it loads my location,ive changed my savefiles a bit thinking of different problems and solutions and it stores all the data fine but wwill not load my location or my vars can anyone be of any help?

Note:i posted 2 different topics about this first thinking it was a problem with my area's then thinking it was with my saves but im not sure anymore can someone help me?(both topics before have been deleted by me :o)
Best response
Why are you saving your location in three different savefiles? That seems extremely circuitous and more trouble than its worth.
yeah i got deperate and was trying to break it down and find the problem :/
lolz whoops
Why are you saving the areas and the turf the user is on? Saving an area will bring with it a copy of every turf in its contents, and saving a turf will include all of its contents, so you're effectively saving a good chunk of the map.