[Won't change] 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.

Commented autoload items get removed entirely

Postby mofumofu » Sun May 15, 2022 7:04 pm

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
mofumofu
 
Joined: 15 Apr 2018
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Commented autoload items get removed entirely

Postby Graf Zahl » Mon May 16, 2022 12:27 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Commented autoload items get removed entirely

Postby RKD » Mon May 16, 2022 9:04 am

Alternatively, ZDL also exists.
User avatar
RKD
 
Joined: 19 Mar 2022
Location: Argentina
Operating System: Windows 10/8.1/8/201x 64-bit

Re: Commented autoload items get removed entirely

Postby Matt » Thu May 19, 2022 7:36 pm

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
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Commented autoload items get removed entirely

Postby nova++ » Thu May 19, 2022 10:31 pm

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
nova++
Real life space alien (not fake)
 
Joined: 04 Sep 2021
Operating System: Other Linux 64-bit

Re: Commented autoload items get removed entirely

Postby Graf Zahl » Fri May 20, 2022 12:58 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Commented autoload items get removed entirely

Postby JPL » Fri May 20, 2022 4:09 pm

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
JPL
 
 
 
Joined: 09 Apr 2012

Re: Commented autoload items get removed entirely

Postby Graf Zahl » Sat May 21, 2022 12:37 am

You can already do that. Unknown sections with valid content are retained.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Commented autoload items get removed entirely

Postby nova++ » Sat May 21, 2022 11:11 am

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
nova++
Real life space alien (not fake)
 
Joined: 04 Sep 2021
Operating System: Other Linux 64-bit

Re: Commented autoload items get removed entirely

Postby Nash » Sat May 21, 2022 7:27 pm

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
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Commented autoload items get removed entirely

Postby Rachael » Sat May 21, 2022 8:55 pm

Until you get into a habit of renaming your files .pk3_ :)
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Commented autoload items get removed entirely

Postby Nash » Sun May 22, 2022 4:40 am

Rachael wrote:Until you get into a habit of renaming your files .pk3_ :)


W-who... would even do such a thing?!
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Commented autoload items get removed entirely

Postby Graf Zahl » Sun May 22, 2022 5:05 am

Lots of people do that to temporarily keep a file from being found.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Commented autoload items get removed entirely

Postby Matt » Fri May 27, 2022 11:01 pm

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.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest