Incrementvar: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Dark pre.)
Line 3: Line 3:


==Syntax==
==Syntax==
<pre>incrementvar CVAR MINVALUE MAXVALUE DELTA</pre>
{{pre|incrementvar CVAR MINVALUE MAXVALUE DELTA}}
*CVAR: a console variable we want to change.
*<tt>CVAR</tt>: a console variable we want to change.
*MINVALUE: a minimum bound for our variable.
*<tt>MINVALUE</tt>: a minimum bound for our variable.
*MAXVALUE: a maximum bound for our variable.
*<tt>MAXVALUE</tt>: a maximum bound for our variable.
*DELTA: the amount to increase CVAR by. Set this to a negative number to ''decrement''.
*<tt>DELTA</tt>: the amount to increase <tt>CVAR</tt> by. Set this to a negative number to ''decrement''.


{{note|Incrementing a variable past the MAXVALUE specified causes the variable to loop around to the MINVALUE. The same happens the other way around, too.}}
{{note|Incrementing a variable past the <tt>MAXVALUE</tt> specified causes the variable to loop around to the <tt>MINVALUE</tt>. The same happens the other way around, too.}}


==See also==
==See also==
*{{ent|BindToggle}}, a console command that works off this one.
*{{ent|BindToggle}}, a console command that works off this one.
*{{ent|multvar}}, multiply var.
*{{ent|multvar}}, multiply var.

Revision as of 18:08, 30 July 2023

Template:Console command incrementvar is a console command which can increment a given console variable. In tandem with setinfo, it can be used to count things arbitrarily.

Syntax

incrementvar CVAR MINVALUE MAXVALUE DELTA
  • CVAR: a console variable we want to change.
  • MINVALUE: a minimum bound for our variable.
  • MAXVALUE: a maximum bound for our variable.
  • DELTA: the amount to increase CVAR by. Set this to a negative number to decrement.
Note.pngNote:Incrementing a variable past the MAXVALUE specified causes the variable to loop around to the MINVALUE. The same happens the other way around, too.

See also