[Console] CvarAdd command

Moderator: GZDoom Developers

Post Reply
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

[Console] CvarAdd command

Post by D2JK »

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

Re: [Console] CvarAdd command

Post by Graf Zahl »

Isn't the 'eval' CCMD sufficient?
User avatar
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

Post by Major Cooke »

It's unwieldy as hell, and sometimes I couldn't get it to work at all.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: [Console] CvarAdd command

Post by D2JK »

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?
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: [Console] CvarAdd command

Post by D2JK »

The above question was left unanswered, so should I make a dedicated feature request for it then?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”