ID:167589
 
I've asked this before but no one answered. How do I save object variables? Please answer if you know how.
I'm pretty sure you can do something like this:

proc/SaveVars(obj/O)
var/savefile/F = new("ObjVars.sav")
for( var/A in O.vars )
F[A] << O.vars[A]

proc/LoadVars(obj/O)
var/savefile/F = new("ObjVars.sav")
for( var/A in F )
F[A] >> O.vars[A]


Note: Not compiled, not tested.

Also, if your post is off the front page and 24 hours have passed since the last post in it, then you may bump it.
In response to Audeuro
Audeuro wrote:
proc/LoadVars(obj/O)
var/savefile/F = new("ObjVars.sav")
for( var/A in F )
F[A] >> O.vars[A]

Note: Not compiled, not tested.

Ergo, not right. You can't just load vars indiscriminately, and you can't look through F, but rather F.dir. The correct way to load vars is in the DM Guide.

Lummox JR