Commented autoload items get removed entirely
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Commented autoload items get removed entirely
Issue description:
Using # to comment out a line under the autoload header in the configuration file causes GZDoom to remove the entry (upon launch?)
Reproduction steps:
* Add an entry under any Autoload section in the .ini file
* Comment out the entry using a # mark
* Launch the appropriate game
* Exit and check the configuration file again
* Note that the commented line has been deleted entirely
Suggested fix:
* Do not delete commented lines
Why is this an issue:
It's convenient to use comments to temporarily disable items in autoload to test when you have a problem. Frankly I did not expect the engine to delete them and was a little frustrated when I lost the contents of my autoload, lol.
Using # to comment out a line under the autoload header in the configuration file causes GZDoom to remove the entry (upon launch?)
Reproduction steps:
* Add an entry under any Autoload section in the .ini file
* Comment out the entry using a # mark
* Launch the appropriate game
* Exit and check the configuration file again
* Note that the commented line has been deleted entirely
Suggested fix:
* Do not delete commented lines
Why is this an issue:
It's convenient to use comments to temporarily disable items in autoload to test when you have a problem. Frankly I did not expect the engine to delete them and was a little frustrated when I lost the contents of my autoload, lol.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Commented autoload items get removed entirely
The config file format has no way to retain the comments - they just get thrown away if the config is loaded. Ultimately this is too much work for too little gain.
If you want to keep the content, instead rename their key from "Path" to something else.
If you want to keep the content, instead rename their key from "Path" to something else.
Re: Commented autoload items get removed entirely
Alternatively, ZDL also exists.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Commented autoload items get removed entirely
I'd love to volunteer if I had the slightest idea what I'm supposed to be doing code-wise, so I'll just comment like this and hope someone out there takes the hint - being able to comment what stuff does in an ini file can be a huge QOL improvement for some people.too much work
Re: Commented autoload items get removed entirely
I agree with Matt. I feel like there could be some sort of internal buffer for comments when a config file is loaded or something of that nature. I suppose another change would be the idea of bifurcating the config into different files (does the engine ever really modify the autoload section on its own?). Or really, it could be aware to some degree of the different sections etc.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Commented autoload items get removed entirely
In a perfect world the config should be split up, using JSON for its internal data so that it can be stored in hierarcial fashion plus a user-visible extra file for these special sections. But that still won't help you because the config parser just skips over comments, never parsing what they contain.
Re: Commented autoload items get removed entirely
An alternative would be to have a "Disabled Autoloads" section of the cfg directly beneath it that you could move (with your text editor, which I assume is how people are adding autoloads) stuff to and from, that would be effectively ignored. But given how autoloads are subdivided by game, that could get a little complicated.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Commented autoload items get removed entirely
You can already do that. Unknown sections with valid content are retained.
Re: Commented autoload items get removed entirely
Oh, so that's what you meant by
If you want to keep the content, instead rename their key from "Path" to something else.
Re: Commented autoload items get removed entirely
I just do it the ghetto way and add an underscore to any autoloads I'd like to temporarily disable, for example:
Path=./mods/Autoload/bmplus/bmplus_vanilla.pk3
becomes
Path=./mods/Autoload/bmplus/bmplus_vanilla.pk3_
Works for me. =P
Path=./mods/Autoload/bmplus/bmplus_vanilla.pk3
becomes
Path=./mods/Autoload/bmplus/bmplus_vanilla.pk3_
Works for me. =P
Re: Commented autoload items get removed entirely
Until you get into a habit of renaming your files .pk3_ 

Re: Commented autoload items get removed entirely
W-who... would even do such a thing?!Rachael wrote:Until you get into a habit of renaming your files .pk3_ :)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Commented autoload items get removed entirely
Lots of people do that to temporarily keep a file from being found.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Commented autoload items get removed entirely
there's also "disabledPath=" which will also keep the line and also provide a clearly visible guide as to what's enabled or not.Nash wrote:W-who... would even do such a thing?!Rachael wrote:Until you get into a habit of renaming your files .pk3_