My question is pretty much as the title states, how do I change multiple CVARs in MenuDef?
I'm doing up a mod with some custom CVAR setup in the menus, and I'm trying to have a single button that sets most of the CVARs to predefined values, not unlike a "Reset to Defaults" button. How can I go about doing this?
Changing multiple CVARs in MenuDef
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- LanHikariDS
- Posts: 179
- Joined: Tue Aug 04, 2015 11:30 pm
- Location: Playing in the snow
- Lord Misfit
- Posts: 221
- Joined: Wed Dec 27, 2006 8:13 pm
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
- Location: Canton, OH
- Contact:
Re: Changing multiple CVARs in MenuDef
You need to define aliases for your "set to default" command in the KEYCONF lump of your project:
Then in MENUDEF:
Hope that helps. o.o
Code: Select all
alias mygame_defaults1 "set mygame_var1 [whatever the default number is]; set mygame_var2 [whatever the default number is] (etc)"
Code: Select all
Command "Restore Default Settings", "mygame_defaults1"
- LanHikariDS
- Posts: 179
- Joined: Tue Aug 04, 2015 11:30 pm
- Location: Playing in the snow
Re: Changing multiple CVARs in MenuDef
Aha, thank you!
Re: Changing multiple CVARs in MenuDef
Hey, an old thread relevant to my interests...
The problem with this seems to be that it won't save the cvars between plays. You can't exec an external list of settings from an alias, either. Or force a writeini.
So what do? How would I set something like this up without the player having to hop into the menu every time they play?
The problem with this seems to be that it won't save the cvars between plays. You can't exec an external list of settings from an alias, either. Or force a writeini.
So what do? How would I set something like this up without the player having to hop into the menu every time they play?