ID:147487
 
I posted this before, but I dunno if anyone noticed

This wont save when its supposed to but it doesnt crash the server neither. Any reasons why? Its the exact same thing as OBJSAVE by Super11 (name??)

var/list/objs = list ()
obj
var/lastx
var/lasty
var/lastz

area
var/lastx
var/lasty
var/lastz

world/New()
..()
if(fexists('Map.sav'))
var/savefile/F = new ("Map.sav")
F >> objs
for(var/obj/o in objs)
o.loc = locate(o.lastx, o.lasty, o.lastz)
objs.Cut()
return ..()

world/Del()
var/savefile/F = new("Map.sav")
for(var/obj/o in world.contents)
o.lastx = o.x
o.lasty = o.y
o.lastz = o.z
objs.Add(o)
F << objs
return ..()

Any reasons why?
I'm sure we all hadn't noticed when you tagged this exact same question onto another thread that hasn't even dropped off the page yet. Anyway, to answer your question, read over the posts in this thread: [link]
In response to tenkuu
Okay I read it over, but it doesnt really help too much. I tried everything that was in example there, and still no help. Im soooo confused.
Metroid wrote:

> world/New()
> ..()
> if(fexists('Map.sav'))
> var/savefile/F = new ("Map.sav")
> >> F["objs"] >> objs
> for(var/obj/o in objs)
> o.loc = locate(o.lastx, o.lasty, o.lastz)
> objs.Cut()
> return ..()
>
> world/Del()
> var/savefile/F = new("Map.sav")
> for(var/obj/o in world.contents)
> o.lastx = o.x
> o.lasty = o.y
> o.lastz = o.z
> objs.Add(o)
> >> F["objs"] << objs
> >> ..()
>

Any reasons why?
Not sure if this will help, but the changes i made are with the >> next to the lines. With the saving and loading, instead of just saving into F, try putting then into a section of F, eg /objs. And with the world/Del(), instead of returning ..(), just calling ..() might help.
Then again, it might not.
In response to Lazyboy
Hmmm It didnt work but let me try something else....

YES! By making it a Proc like my Area Saving, it saved it, dunno why the other way didnt work. Either way, I just tested but for some reason my Area saving wont work again...*SIGH* Any reason why? Since its saving, it belongs here =P

proc/Newobjs()
// ..()
if(fexists("Map.sav"))
var/savefile/F = new ("Map.sav")
F >> objs
for(var/obj/o in objs)
o.loc = locate(o.lastx, o.lasty, o.lastz)
objs.Cut()
if(fexists('Housing.sav'))
var/savefile/f = new("Housing.sav")
f["areas"] >> areas
for(var/area/housing/h in world)
for(var/i in areas)
if(i["[h.x] [h.y]"])
h = i["[h.x] [h.y]"]
// return ..()

proc/Delobjs()
var/savefile/F = new("Map.sav")
for(var/obj/o in world.contents)
o.lastx = o.x
o.lasty = o.y
o.lastz = o.z
objs.Add(o)
F << objs
var/savefile/f = new("Housing.sav")
for(var/area/housing/a in world)
areas += "[a.x] [a.y]"
areas["[a.x] [a.y]"] = a
f["areas"] << areas

I put both the Area and Obj saving in the same proc. The Map.sav part will work, but the Housing.sav part wont. Help? Theres no runtimes.
In response to Metroid
Please help! If you need anything aditional like anything else that goes with it, please ask, I need this to work!
In response to Metroid
Metroid wrote:
Please help! If you need anything aditional like anything else that goes with it, please ask, I need this to work!

You put House.sav in SINGLE quotes. Then you're loading it in double quotes.
In response to SSJ4_Gohan_Majin
To add to that: You don't want single quotes here. Single quotes are for files you want to be saved in the RSC at compile-time, like DMIs and WAVs. Always reference savefiles with double quotes.
In response to Crispy
Ive tried chaning all the " to ' and all the ways of " to ' and " with ' or whatever, it doesnt work, nothing will fix it, there doesnt seem to be anything wrong with the code. What do I need to change the "" to to make it work, if thats the problem, im very confused.
In response to Metroid
nononono, change all the " to '...
There's only one time when you used that though