Difference between revisions of "Variable Reference"
Jump to navigation
Jump to search
→Defining Variables: Included the table of default values to make it more prominent
imported>Cipscis (Corrected terminology: "reference variables" is Legacy terminology; updated to Papyrus' "object variables" terminology) |
imported>Cipscis (→Defining Variables: Included the table of default values to make it more prominent) |
||
Line 9: | Line 9: | ||
Variables are defined simply by writing the type, followed by the [[Identifier Reference|identifier]] to use for the variable. | Variables are defined simply by writing the type, followed by the [[Identifier Reference|identifier]] to use for the variable. | ||
You may optionally follow the variable with an equals sign and an expression (in a function) or value (in a script) to initialize the variable with that value on the same line. | You may optionally follow the variable with an equals sign and an expression (in a function) or value (in a script) to initialize the variable with that value on the same line. {{:Default Value Reference}} | ||
If a variable is declared outside of a function or event, it can only be initialized as a [[Literals_Reference|literal]]. Inside a function or event, [[Expression_Reference|expressions]] can be used in variable initialisations. | If a variable is declared outside of a function or event, it can only be initialized as a [[Literals_Reference|literal]]. Inside a function or event, [[Expression_Reference|expressions]] can be used in variable initialisations. |