Commented autoload items get removed entirely

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
mofumofu
Posts: 10
Joined: Sun Apr 15, 2018 6:40 pm
Graphics Processor: nVidia with Vulkan support

Commented autoload items get removed entirely

Post by mofumofu »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Commented autoload items get removed entirely

Post by Graf Zahl »

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.
User avatar
RKD
Posts: 148
Joined: Sat Mar 19, 2022 9:52 am
Location: Argentina

Re: Commented autoload items get removed entirely

Post by RKD »

Alternatively, ZDL also exists.
User avatar
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

Post by Matt »

too much work
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.
User avatar
nova++
Posts: 177
Joined: Sat Sep 04, 2021 3:13 am

Re: Commented autoload items get removed entirely

Post by nova++ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Commented autoload items get removed entirely

Post by Graf Zahl »

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.
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Re: Commented autoload items get removed entirely

Post by JPL »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Commented autoload items get removed entirely

Post by Graf Zahl »

You can already do that. Unknown sections with valid content are retained.
User avatar
nova++
Posts: 177
Joined: Sat Sep 04, 2021 3:13 am

Re: Commented autoload items get removed entirely

Post by nova++ »

Oh, so that's what you meant by
If you want to keep the content, instead rename their key from "Path" to something else.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Commented autoload items get removed entirely

Post by Nash »

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
User avatar
Rachael
Posts: 13914
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Commented autoload items get removed entirely

Post by Rachael »

Until you get into a habit of renaming your files .pk3_ :)
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Commented autoload items get removed entirely

Post by Nash »

Rachael wrote:Until you get into a habit of renaming your files .pk3_ :)
W-who... would even do such a thing?!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Commented autoload items get removed entirely

Post by Graf Zahl »

Lots of people do that to temporarily keep a file from being found.
User avatar
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

Post by Matt »

Nash wrote:
Rachael wrote:Until you get into a habit of renaming your files .pk3_ :)
W-who... would even do such a thing?!
there's also "disabledPath=" which will also keep the line and also provide a clearly visible guide as to what's enabled or not.
Post Reply

Return to “Closed Bugs [GZDoom]”