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
Copyright © 2025 BYOND Software.
All rights reserved.
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.