How would I go about saving a map? I haven't done much with saving yet... could someone give me a quick example?
[edit]
I should make this more clear... in my game, people can build things. But, whenever the server restarts or crashes, it all goes poof. I'd like to have a way in which I can save the world when the server crashes.
ID:179049
![]() Feb 23 2002, 2:22 pm (Edited on Feb 23 2002, 2:36 pm)
|
|
I tested this and it works awesome.
proc/Saveworld() var/turf/O var/savefile/F=new("world.sav") for(O in world.contents) F<<O proc/loadworld() var/turf/O var/savefile/F=new("world.sav") for(O in world.contents) F>>O obj/stuff icon='s.dmi' Click() usr.thing=/obj/stuff mob/var thing mob icon='m.dmi' turf icon='t.dmi' Click() overlays+=usr.thing mob/Stat() statpanel("thing") stat(new/obj/stuff) world/New() loadworld() ..() world/Del() Saveworld() ..() |
i came across theses posts and wanted to see if the map saves would work for me since i'm in the same postion. They didn't work. could someone tell me if i need a verb before the code that was not posted? it would really help me out
|
Okay... I've almost got it.. just how do I restore multiple obj from a savefile?
proc/Saveworld() |
Yes I did. I couldn't get it to work, and what's with the rest of it? The mob, and clicking and overlays...
|
I think you could either:
A) Save the whole thing
B) Save everything but a tile, say grass.
My beta code for this is:
Too bad it has an error. ;(
P.S. WARNING: The above save code is bad. It will crash Dream Seaker trying to save the world.... (Must... think up... better... way!)