Incrementvar: Difference between revisions
Jump to navigation
Jump to search
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.
m (Dark pre.) |
m (Replacing {{console command}}. This operation was performed by a bot.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{this is a|console command|name=incrementvar}} | ||
<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. | ||
Line 12: | Line 12: | ||
==See also== | ==See also== | ||
*{{ent| | *{{ent|toggle}} | ||
*{{ent|multvar}}, multiply var. | *{{ent|multvar}}, multiply var. |
Latest revision as of 17:55, 7 January 2024
incrementvar
is a console command available in all Source games.
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.
