ID:269011
 
I don't really want to write a save system that saves over 200~ vars, then loads them back up. Is there an easier way?
Hell Ramen wrote:
I don't really want to write a save system that saves over 200~ vars, then loads them back up. Is there an easier way?

Be more specific: what are you trying to do? Having 200 variables in the first place should, if possible, be avoided.
In response to Wizkidd0123
Wizkidd0123 wrote:
Be more specific: what are you trying to do? Having 200 variables in the first place should, if possible, be avoided.

I mean so I don't have to do stuff like this:
var/savefile/q = new("ASDF/ASDF.qqq")
q["var1"]<<src.var1
q["var2"]<<src.var2
//etc.


And, also, it's around 50 vars for mobs, not counting objects and other things.
In response to Hell Ramen
Hell Ramen wrote:
And, also, it's around 50 vars for mobs, not counting objects and other things.

var/savefile/q = new("ASDF/ASDF.qqq")
q << src


You can just do that =)

I recommend that you take a look at Deadron's BYOND Basic Savefiles if you haven't yet.
In response to Hell Ramen
you could use vars:
<code> var/list/varsToSave = list("var1","something","another var","var7") var/savefile/q = new("ASDF/ASDF.qqq") for(var/v in varsToSave) q[v] << src.vars[v] </code>
In response to OneFishDown
OneFishDown wrote:
you could use vars:
<code> > var/list/varsToSave = list("var1","something","another var","var7") > > var/savefile/q = new("ASDF/ASDF.qqq") > for(var/v in varsToSave) > q[v] << src.vars[v] > </code>

Or possibly the other way around, with a list of vars NOT to save, then just loop through the vars list.