Gamepedia Help Wiki
Advertisement

Example 1

Variables can be given a default value before their definition.

{{#vardefine:n|{{#expr:{{#var:k|0}}+1}}}}

Now {{#var:n}} = 1

Otherwise you may get an error or otherwise unexpected result:

{{#vardefine:n|{{#expr:{{#var:k}}*1}}}}

Now {{#var:n}} = Expression error: Unexpected * operator.

Example 2

{{#vardefine:a|7}}{{#vardefine:b|11}}
{{#vardefine:x|{{#expr:2*{{#var:a}}+{{#var:b}}}} }}

Now {{#var:x}} = 25

Advertisement