I'd support something like expanding how the vars map is stored, but leaving vars[] alone (to avoid forcing scripts to update), if possible. The expanded datafile would presumably have the datatype and default value, and so the following would presumably work:
Basically, varsMap would be
The one thing I'm kinda iffy about is that you'd have to iterate over all the elements of varsMap[] to generate vars[].
I'd totally add support for this in relay_zlib.ash, by the way. You'd need a few special types, though, like monsterList for stuff like ftf_olfact. There'd also be issues of "how do we update the current datafile? Assume type is string?" and "well, how will setvar() work now? New overloaded form?". Presumably setvar() would need to be modded to add the info into the map as needed. Overall kinda hacky, but possibly worth it in the long run?
Code:
if (vars["myVar"].to_type().to_string() != vars["myVar"])
vars["myVar"] = varsMap["myVar"].default;
Code:
record {
string val;
string type;
string default;
} [string] varsMap = map_to_file("vars_"+my_name()+".txt");
The one thing I'm kinda iffy about is that you'd have to iterate over all the elements of varsMap[] to generate vars[].
I'd totally add support for this in relay_zlib.ash, by the way. You'd need a few special types, though, like monsterList for stuff like ftf_olfact. There'd also be issues of "how do we update the current datafile? Assume type is string?" and "well, how will setvar() work now? New overloaded form?". Presumably setvar() would need to be modded to add the info into the map as needed. Overall kinda hacky, but possibly worth it in the long run?