ID:172989
 
Hey, I'm giving DM another try and am trying to understand how to write to a file from within the program.
Could anyone give me simple examples of how to use the "savefile()" proc? I am hoping to implement into saving a mob.

Please don't link me. I have already checked out: http://www.byond.com/docs/guide/chap12.html
BYOND has a built in save file system.
Basically to use it you declare a new var of the type /savefile (var/savefile/F), then create a new /savefile object and enter it's file name in as an argument in new (F = new /savefile("[player.ckey].sav")).

Now to save vars from F (the savefile), we just do F["name"] << player.name. To load you just do the same thing, but with >> instead of <<.

I belive their is a BYONDscape article that explains it all much clearer, so you'll probably want to give that a look. It's written by Deadron.
In response to DarkView
There are also Read() and Write() procs, which save and load most variables for you, in no particular order. They also save some space.