:StoreVariables/doc

Terraria Wiki
둘러보기로 이동 검색으로 이동

This template is a simple helper template that stores its parameter input to variables. The variable names are prefixed with sv_, which can be adjusted via {{options}}.

It is mainly intended to be used in cargo queries.

Usage

{{ storeVariables | <variable name 1> = <variable value 1> | <variable name 2> = <variable value 2> | ... | <variable name n> = <variable value n> }}

There is another version of the template, {{storeVariables/sum}}, which, if it receives the name of a variable for which there is already a value, adds the existing value of the variable to the newly passed value. Note that this means that manual resetting of variables will likely be required.

Examples

Code Result
{{storeVariables|damage=10|usetime=fast}}
damage: {{#var:sv_damage}}, usetime: {{#var:sv_usetime}}
틀:StoreVariables
damage: , usetime:
{{storeVariables/sum|crit=0.4|knockback=strong}}
{{storeVariables/sum|crit=0.7|knockback=weak}}
crit: {{#var:sv_crit}}, knockback: {{#var:sv_knockback}}
틀:StoreVariables/sum
틀:StoreVariables/sum
crit: , knockback:

Options

This template supports options through {{options}} template. All valid options are listed below, see {{options}} for usage and other infomation.

See Template:storeVariables/initOptions for the initial options setting of this template.

NameAliasInitial ValueValue Mapping[1]Note
prefixsv_
  1. Values with mapping will be stored and loaded as mapped value. Other values without mapping will be stored and loaded as-is.