Calc measure

Measure=Calc calculates mathematical formulas.

Options

General measure options
All general measure options are valid.
Formula Default: 0
Formula to calculate. The syntax can be found on the Formulas page. The calc measure utilizes addition syntax as described below.
UpdateRandom Default: 0
If set to 1, the random constant is regenerated on each update cycle.
UniqueRandom Default: 0
If set to 1, any measure using the random constant and UpdateRandom will not repeat until all values between and including LowBound and HighBound have been used.

Any dynamic change to LowBound or HighBound will reset the unique tracking of values.

Note: UniqueRandom will only function if the difference between LowBound and HighBound is at most a 16bit unsigned integer, or 65535.
LowBound Default: 0.0
Lower bound of the random constant.
HighBound Default: 100.0
Upper bound of the random constant.

Note: The maximum value of HighBound is a 32bit signed integer, or 2147483647.

Additional Formula Syntax

Functions

Note: These functions are only available in the context the Formula option of a Calc measure, and not in other (formulas) in other measure or meter types.

  • Random: A random number. The number will be between and include the values set in LowBound and HighBound.
  • Counter: The number of update cycles from the time the skin is loaded. This number only resets when the skin is unloaded and then loaded again - not when the skin is refreshed.

Other Bases

The Calc measure allows numbers to be represented numbering systems other than decimal. To use another base, prefix the number with a zero then the letter representing the system you wish to use. The following are accepted prefixes, which are case (lower) sensitive:

  • 0b - Binary number (base 2) (ex: 0b110110 - returns 54 in decimal)
  • 0o - Octal number (base 8) (ex: 0o123 - returns 83 in decimal)
  • 0x - Hexadecimal number (base 16) (ex: 0xF1 - returns 241 in decimal)

Measure Values

The use of measure values in the Formula option of a Calc measure does not require the use of Dynamic Variables. Simply omit the [] and the number value of the measure will be retrieved. If the measure does not have a number value, 0 will be used. Section Variables, Variables and Built-in Variables follow the normal rules. For more information see the Dynamic Cheat Sheet.

[MeasureOne]
Measure=Calc
Formula=5
[MeasureTwo]
Measure=Calc
Formula=MeasureOne < 6 ? 0 : 10