• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

INI file adds extra entries on its own

Pharrahnox

Grizzled Veteran
Feb 3, 2016
268
71
Cranny mate
I've been having issues with the config file for my mod for a while now. Ever since I made it so that multiple classes use the same .ini, each with their own section, all white space gets removed, and all comments without the "=" symbol in them get removed. So now all of my comments begin with "#=", and I also use that for my 'blank' lines.

Then, when I made my GameInfo** class configurable, it added a whole bunch of entries to the GameInfo class's section:
Spoiler!
These variables are configurable variables present in FrameworkGame and GameInfo.

Also, four variables keep changing the first character to lower-case, regardless of how many times I change it. The actual variable names actually do start with a capital letter in the class file. These variables used to be stored in the Mutator** class, and then assigned to other variables in the GameInfo class, but I moved them into the GameInfo class later.

Now I have started getting yet another issue. I have these entries:
Code:
MapSpawnRateModList[0]=(MapName="KF-BurningParis",Multiplier=100.000000)
MapSpawnRateModList[1]=(MapName="KF-BioticsLab",Multiplier=0.001000)
MapMaxMonstersList[0]=(MapName="KF-BurningParis",Max=5)
MapMaxMonstersList[1]=(MapName="KF-Outpost",Max=200)
MapDynamicMaxMonstersList[0]=(MapName="KF-BurningParis",extra=15)
And it likes to write these extra lines at the bottom of the GameInfo class's section in the .ini file:
Code:
MapSpawnRateModList=(MapName="KF-BurningParis",Multiplier=100.000000)
MapSpawnRateModList=(MapName="KF-BioticsLab",Multiplier=0.001000)
MapMaxMonstersList=(MapName="KF-BurningParis",Max=5)
MapMaxMonstersList=(MapName="KF-Outpost",Max=200)
MapDynamicMaxMonstersList=(MapName="KF-BurningParis",extra=15)
These lines only just started appearing, after I added MapMaxMonstersList and MapDynamicMaxMonstersList. I had MapSpawnRateModList before and it wasn't adding these extra lines. However, at that stage, MapSpawnRateModList was in the Mutator class, and it has just been moved to the GameInfo class.

It seems to be that any variables that are moved to another class have issues in the .ini file. I think that this might be the case because I just removed my .ini file from the folder and ran the mod. A new .ini was created, and contained only the variables that have moved class (as well as the ones in the spoiler), which happens to be only variables in the GameInfo class's section.

Does anyone have an explanation for why this might be happening? I've tried to find these same issues on the internet and have found nothing. Config files seem to be something that is pretty hard to stuff up, and yet here I am. :(


**: When I say the Mutator and GameInfo classes, I mean the classes I'm using that extend those.
 
Last edited: