Set Lines
When you want to change variables from script, you do it with a
set line, for example:
Optionally you can use an "
=" between the variable name and the value if you want, but you don't have to.
All variables are considered to be dialogue scoped variables,
unless they are prefixed with global., in which case they are set as
global variables.
Setting Literal Values
Here's how you set variables using each of the supported types from simple literals:
Integers
Floating point
Note: do not include any suffix like 'f'
Boolean
Supported arguments are
true,True,falseandFalse
Text
This is for text (FText) you expect to display to the player.
If you need to include double quotes inside the text, you can escape them like so:
Note: Literal text is automatically tagged for localisation just like text in speaker lines and choices.
Name
Names (FNames) are not localised unlike text, so are good for signalling more descriptive values to / from code.
Gender
The 3 gender options are
masculine,feminineandneuter
Setting Values Using Expressions
Rather than a literal value, you can set a variable based on an expression, which is a potentially compound statement, which can reference other variables and perform operations.
See the Expressions section for a complete discussion, but for example you could do things like this:
[set SomeInt = {SomeInt} + 1]
[set SomeBoolean = {AIsTrue} or {BIsTrue}]
[set IsLargeEnough = {SomeInt} > 10]
Note that I've used the '
=' symbol here; I don't have to, it's optional, but I find it easier to read when there are expressions on the right instead of literals.