Its worse than that.... apparently with kobolds, dwarves, and humans(possibly orcs too, I didn't test it), the gui stores a copy of the raw entity file when the gui is started. Then when an option is selected, it is editing the file in memory and then saving the new version over the old. basically if you have the gui open, you can completely delete the entity_good_dwarf.txt file, make one option change that affects the file in memory, then the original version modified by the change is saved from memory.
the issue is that since its a buffer of the original file, lets say that you have a file that is just this line:
YES_INVENTOR[PERMITTED_BUILDING:INVENTOR]
If you turn it the option off it becomes this:
!YES_INVENTOR!PERMITTED_BUILDING:INVENTOR]
if you turn it back on... that's when the problem occurs. the buffer is told to change it back to the original line, but because there is a length change going down the buffer ends up having extra characters left at the end of the buffer variable so the saved file comes out as:
YES_INVENTOR[PERMITTED_BUILDING:INVENTOR]]
it wouldn't be so bad if it was just the 1 tag change over an entire file. but considering every tag like this occurs multiple times and every time one is changed it adds or subtracts to the length of thee file... playing with the options a lot gives you this at the end of the file:
##
#####################################################################################################
#################################
#################################
#################################
##############################################
###################
###############
######################
########
################################
#####################################################################
###############
################
####
29###################################################################################################################################################
30###################################################################################################################################################
#######
#######################
30###################################################################################################################################################
#######################
####
#################
##
#########
###
#
##################################
30###################################################################################################################################################
#####################
#############################
#################################
#################################
#########################################
the good thing is... I can remove those tags when the gui is not running. then load the gui and it wont re add the tags (as best as I can tell) back to the file. if you reduce them down to only 1 tag each (possible in most cases) then the damage to the file is reduced(1 tag would only copy the last character, so you would just end up with a series of \n as that is the last character in the file, not a big deal). If done properly, the editing of the entity files is possible, meaning they can be cleaned up, edited, and made more "readable", standardized etc. but it will be painstaking endeavor. Well its time to deal with RL, I'll look into it more on the other side.