Lots of CVARs and config saving [split]
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Lots of CVARs and config saving [split]
So if you have a mod that adds 50 CVARs (there is one such mod), and you want to have default values each time the mod starts up, you have to load each and every CVAR's default value in autoexec.cfg? Or even worse, delete the CVARs from the user's ini file? Your workaround may work, but it's exactly 0% practical, even for non-mod CVARs.
Re: "don't save changes on exit" cvar
First I have to wonder - what does a mod need 50 CVARs for - and secondly, is there any reason you're particular over all 50 of them?
Re: "don't save changes on exit" cvar
Didn't quite get your second question, but to answer the first - CustomDoom has 72 CVARs and I need those to be able to adjust each option separately. There's a lot of stuff in there. I've put a "Restore to defaults" button, of course, but that's a rare case. I think a CVAR to rule them all is not a bad idea. Being able to purposely not save only the CVARs (both mod and non-mod) may or may not prove useful. Saving the .ini like Blue Shadow said may backfire if you change your controls or other options and forget to update the .ini. You'll end up with an old copy. Been there, done that, but with a mod. Accidentally reverted a few changes which opened some work for me.
Re: "don't save changes on exit" cvar
The second question was asking why all 50 (or 72 in this case) needed to be explicitly set.
I guess for CustomDoom, that makes a bit of sense. For that, though, it might just be more practical to write an INI manager that can export and import CustomDoom's settings, creating a kind of "profile" system. Everything ZDoom exports for CustomDoom, specifically, will be in its own section, making it easy to extract and replace the section easily.
I guess for CustomDoom, that makes a bit of sense. For that, though, it might just be more practical to write an INI manager that can export and import CustomDoom's settings, creating a kind of "profile" system. Everything ZDoom exports for CustomDoom, specifically, will be in its own section, making it easy to extract and replace the section easily.
Re: "don't save changes on exit" cvar
Well, to not have them changed, that's why. Of course, you could set only the ones you want to use so they won't get overwritten, but with a mod like that you never know what you'll use at a given moment.
As for the export thingy, that actually sounds like a very good idea, but I don't really know how to make one such system. How to get ZDoom to export the CVARs in their own section? (You can PM me if you don't feel like derailing the thread.)
As for the export thingy, that actually sounds like a very good idea, but I don't really know how to make one such system. How to get ZDoom to export the CVARs in their own section? (You can PM me if you don't feel like derailing the thread.)
Re: "don't save changes on exit" cvar
ZDoom itself can't do it, but it wouldn't be too hard to write a program that can. That same program can translate each variable into a console command, so that you can exec them in on the fly.
Re: "don't save changes on exit" cvar
Seems like I lack both the imagination and skill to make such a program.
Re: "don't save changes on exit" cvar
Can you post or PM a config snippet? I'm not able to get CustomDoom to export settings, myself, so I am stuck trying to develop a script blind for it.
Re: Lots of CVARs and config saving [split]
Spoiler: CVARINFO
Spoiler: Config FileI suppose the CVARs is what you need. Here are all of them with their default values. And, Eruanna, thank you for taking your time to write that script. Putting your name on the special thanks list. May not mean much, but it's better than nothing, I guess. Even if you don't succeed, the name will stay. Efforts like these are greatly appreciated.
EDIT: Thanks go to wildweasel, too, for moving the thread.
Re: Lots of CVARs and config saving [split]
I'm creating a cmd script - I mostly just needed the section name. Having the actual entries will be useful too, though, as it will allow me to test.
Re: Lots of CVARs and config saving [split]
Still, I don't even remember the last time I wrote a batch file. Most useful one I've written was a simple copy, rename, delete to automate a mod backup. I thought you were writing it in Python or something.
Re: Lots of CVARs and config saving [split]
Okay, wow, this is going to be harder than I thought. I thought ZDoom separates each mod's CVAR list to its own section, I was wrong. I'll have to use the CVARINFO after all. This script is going to be a little lengthy, but I am using subroutines as much as possible to cut down on repeated code.
Re: Lots of CVARs and config saving [split]
Could you give me more info on how the script is expected to work? Do you feed it external values from a file which it reads and modifies in the actual config file? It might be kinda pointless in the case of CustomDoom to keep the values to their defaults as there's a "Reset to defaults" button which is handled directly by the mod. Unless the point of this is to make a profiling system.
Re: Lots of CVARs and config saving [split]
Well, what I thought you wanted was a script where you would type at the command line, something like:
And then it would export the variables from your zdoom.ini file (using a bit of a "search" to find where it is) and export all custom doom variables into a file, like this:
so that you could later execute in ZDoom's console this command:
And bam.
Code: Select all
> custom-doom-export super-hard-profile.cfgCode: Select all
set custom_doom_var1 0
set custom_doom_var2 3
... etcCode: Select all
exec super-hard-profile.cfgRe: Lots of CVARs and config saving [split]
Hmm, I gotta try this out for myself. I am starting to understand now. One question, though: what will happen if I add more CVARs? I suppose I'll have to edit the source code of the script in order to reflect the changes and whatnot.