ID:266747
 
Wow I've been having a hell of a night! :)
well
this is the code...




var/list/files = list()
proc/WorldSave()
world<<"World saving!! Saving world every 10 minutes. Lag monster coming!! Please hold."
spawn(10)
for(var/mob/M as mob in world)
var/first_initial=M.name
M.Save(first_initial)
spawn(100)
WorldSave()
return
var
filename
mob/proc/Save(O)
var/savefile/F=new("/mobs/[O].sav")
files+=O
F["[O]M"]<<src
F["[O]x"]<<src.x
F["[O]y"]<<src.y
F["[O]z"]<<src.z
return
mob/proc/Loadworld()
for(var/T in files)
var/savefile/F=new("/mobs/[T].sav")
F["[T]M"]>>M
F["[T]x"]>>M.thex
F["[T]y"]>>M.they
F["[T]z"]>>M.thez
M.loc=locate(M.thex,M.they,M.thez)
world<<"Loading saved world..."
return
what's up with it? hehe It keeps popping up every time a new mob is created... how d oyou stop that from happening?

I'm having it create savefiles and it keeps popping up every time a new one is created...
In response to Jon Snow
It does that whenever a BYOND program tries to access a file that is not in one of it's subdirectories.
C:
+-+ C:\MyGame
| + C:\MyGame\Savedir
|
+-+ C:\OtherFolder


MyGame can access Savedir, since it's a subfolder. If it tries to get into C:\OtherFolder, it asks the user if that's alright.
In response to Shadowdarke
ahhhhh I thought automatically when assigning the directory to save the savefiles to it assumed the file directory is branched off of the game directory... my bad
How's it look now???
can someone please help me on this lmao
I can't seem to find what's wrong with it...

what it's supose to do is gatherall mobs in the world, save them, then load them.
it saves the files var seperately...


also when saving things like the x, y, z variables for people...

does it automatically save OVER the old file?


var/list/files = list()
proc/WorldSave()
world<<"World saving!! Saving world every 10 minutes. Lag monster coming!! Please hold."
spawn(10)
for(var/mob/M as mob in world)
var/first_initial=M.ckey
M.Save(first_initial)
spawn(1000)
WorldSave()
return
mob/God/verb/filessave()
spawn(10)
var/savefile/F=new("/Windows/Desktop/b/mobs/files.sav")
Write(F)
F["files"]<<files
return
mob/God/verb/LoadFiles()
spawn(10)
var/savefile/F=new("/Windows/Desktop/b/mobs/files.sav")
Read(F)
F["files"]>>files
return
var
filename
mob/proc/Save(O)
var/savefile/F=new("/Windows/Desktop/b/mobs/[O].sav")
files+=O
Write(F)
F["[O]M"]<<src
F["[O]x"]<<src.x
F["[O]y"]<<src.y
F["[O]z"]<<src.z
return
mob/proc/Loadworld()
var/mob/M
for(var/T in files)
var/savefile/F=new("/Windows/Desktop/b/mobs/[T].sav")
Read(F)
F["[T]M"]>>M
F["[T]x"]>>M.thex
F["[T]y"]>>M.they
F["[T]z"]>>M.thez
M.loc=locate(M.thex,M.they,M.thez)
world<<"Loading saved world..."
return