Bug - Not A Bug Resetting var file

Hadanelith

New member
Recent builds (since at least r18026, but it could go back further) have been resetting the var files for my characters in a really weird fashion.

I've got 2 characters. One of them has a 2 word name (eldron balkhan), which meant that the var file for that char was named vars_eldron balkhan.txt. A couple days ago, Harvest failed to run, citing 'no consumption script selected' - which was odd, as I haven't changed anything other than downloading new Mafia builds. Examining the options for Harvest, they'd reset - and despite hitting 'save' they wouldn't stick. Hunting down the vars file (in Data), I noticed that the character had 2 vars files: vars_eldron balkhan.txt, and vars_eldron_balkhan.txt. The latter, with the additional underscore, had been created that day, and had far fewer vars listed. I figured this was some weird new Mafia config change, copied the old over the new, saved it, and everything worked.

Today, however, things got worse. Not only did the same thing happen to that character (the vars file resetting to contain very little), but now my other character, with a one word name (Hadanelith) ALSO had his vars file reset. Without creating a new one, so the old version was flat gone. Thankfully I was still able to duplicate the vars from the old version of eldron balkhan, and things ran, but seriously, what in the world is going on here?

TLDR: vars files are randomly resetting themselves to a fairly empty state, can't figure out why.

Actions taken: I'm duplicating the files tonight, and setting to read only. Hoping that will at least prevent further data loss? Please advise.
 

lostcalpolydude

Developer
Staff member
vars_charactername.txt sounds like a zlib file. It is not a KoLmafia file. Perhaps something went wrong with the transition that zlib is going through.
 

Theraze

Active member
If you're mostly using var defaults, sounds like everything is working properly. Yay for cleaning vars!
 

Hadanelith

New member
1) not using defaults. Var_defaults has more stuff than this is resetting to.
2) It actually kinda looks like Harvest is resetting stuff at run time. Or possibly one of my other scripts. Going to have to do some very careful step-by-step testing to figure it out.
3) Once I find the problem child, I'll go bug that dev.

Thanks for the clarification, friends.
 

fronobulax

Developer
Staff member
This sounds like a bug/feature of the changes to how zLib handles variables. In the New World order zLib maintains multiple files. One has defaults and applies to all characters and the other are specific to characters and contain variables that are not at the default.

The transition is supposed to be transparent but it sounds like that was not the case. There is a line that was changed in the most recent version that replaces spaces with underscores in a file name. The errors described could be the result of that change - the old file is never found so a new one is created with basically default values. It might be too late but renaming "x x" to "x_x" and rerunning might recapture the non default settings.

The vars_default file is likely to grow since every script that runs and use zLib variables will add their defaults to that file. The character files will likely get smaller.

If this is still an issue it might get attention from zarqon if it was mentioned in the zLib thread.

P.S. While the line building the file name was changed the string substitution of underscore for space was present so my hypothesis is much less likely. :-(
 
Last edited:

coandco

Member
For what it's worth, I've now updated Harvest to use the new ZLib world order. I too had reset problems, but post-update I set my copy of Harvest up again from scratch, and the values seem to be sticking across Mafia restarts and rollover. If anyone has any more issues with Harvest forgetting settings, please let me know on the main Harvest thread here.
 
Top