Incrementvar: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Syntax: typo)
(Lowercase title)
Line 1: Line 1:
'''<code>incrementvar</code>''' is a [[console command]] which can increment a given console variable. In tandem with {{ent|setinfo}}, it can be used to count things arbitrarily.
<code>'''incrementvar'''</code> is a [[console command]] which can increment a given console variable. In tandem with {{ent|setinfo}}, it can be used to count things arbitrarily.


==Syntax==
==Syntax==
Line 10: Line 10:
{{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 MAXVALUE specified causes the variable to loop around to the MINVALUE. 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.


[[Category:Console Commands]]
[[Category:Console Commands]]
{{lowercase title}}

Revision as of 21:14, 3 April 2020

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

  • BindToggle, a console command that works off this one.