I'd like to suggest a new console command: CvarAdd. The command would add the given value to the given console variable.
Usage: CvarAdd <CvarName> <Value>
Examples:
CvarAdd Mouse_Sensitivity .01
CvarAdd FoV -5
Bind mwheelup CvarAdd MyVariable 4
Bind mwheeldown CvarAdd MyVariable -4
The mouse wheel bind example illustrates how this would be useful for mod developers trying to get something to look or positioned just right (utilizing the GetCvar() command).
[Console] CvarAdd command
Moderator: GZDoom Developers
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Console] CvarAdd command
Isn't the 'eval' CCMD sufficient?
- Major Cooke
- Posts: 8209
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: [Console] CvarAdd command
It's unwieldy as hell, and sometimes I couldn't get it to work at all.
Re: [Console] CvarAdd command
Ah. I tried to look if a command like this already exists, but I missed this functionality in "eval". Eval seems more powerful as well. I wish someone had mentioned this when I asked in the "How do I" thread.
But now, while reading up the following table of eval expressions, I was also amazed to find out something: the console can not only compute exponentiation, it can do this even with non-integer exponents! Yet we don't seem to have a generic exponentiation functionality as a Decorate expression. Why is this?
But now, while reading up the following table of eval expressions, I was also amazed to find out something: the console can not only compute exponentiation, it can do this even with non-integer exponents! Yet we don't seem to have a generic exponentiation functionality as a Decorate expression. Why is this?
Re: [Console] CvarAdd command
The above question was left unanswered, so should I make a dedicated feature request for it then?