Script:set: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{ScriptCommandPage |description=set a script variable |parameters= variable variable Name of the variable to set value value* Value to set the variable t...") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ScriptCommandPage | {{ScriptCommandPage | ||
|description=set a [[Script:Variables|script variable]] | |description=set a [[Script:Variables|script variable]] | ||
|context=any | |||
|parameters= | |parameters= | ||
variable variable Name of the variable to set | variable variable Name of the variable to set | ||
Line 7: | Line 8: | ||
The first character of the variable name determines the [[Script:Variables#Variable types|variable type]]. System variables (those starting with <code>^</code>) cannot be set. | The first character of the variable name determines the [[Script:Variables#Variable types|variable type]]. System variables (those starting with <code>^</code>) cannot be set. | ||
The context entity is ignored when setting global variables. | |||
For {{int}} and {{number}} variables, string variables passed to <code><{{Highlight|value|value}}></code> are not automatically dereferenced. | For {{int}} and {{number}} variables, string variables passed to <code><{{Highlight|value|value}}></code> are not automatically dereferenced. | ||
[[Category:Script commands changing variables]] |
Latest revision as of 21:20, 8 July 2022
The set
script command is used to set a script variable for an entity.
Usage
set <variable> <value*>
Context: Any Entity
Parameters:
Parameter | Type | Description |
---|---|---|
variable |
variable |
Name of the variable to set |
value |
value or variable |
Value to set the variable to |
The first character of the variable name determines the variable type. System variables (those starting with ^
) cannot be set.
The context entity is ignored when setting global variables.
For int
and number
variables, string variables passed to <value>
are not automatically dereferenced.