Saltar al contenido principal

Variables

Evaluate Math Expression

Set a variable to the result of evaluating a math expression.

References
/docs/scripting/math-expressions

Evaluate Math Expression
Variable
$Variable0
Expression
e.g. 5 + (6 * $health)...
  • Variable: The variable to use.
  • Expression: The expression to evaluate.

Si la variable se compara con valor

Conditionally run part of the script based on the value of a variable compared with a value.

Si la variable se compara con valor
Variable
$Variable0
Comparison
==
Valor
0
Verdadero
Add Event
Sino
  • Variable: The variable to use.
  • Comparison: The comparison operator to use e.g. 'Less Than' or 'Greater Than'.
  • Valor: The value to compare with.
  • Verdadero: The script to run if the condition is true.
  • Falso: The script to run if the condition is false.

Si la variable se compara con variable

Conditionally run part of the script based on the value of a variable compared with another variable.

Si la variable se compara con variable
Variable
$Variable0
Comparison
==
Other Variable
$Variable0
Verdadero
Add Event
Sino
  • Variable: The variable to use.
  • Comparison: The comparison operator to use e.g. 'Less Than' or 'Greater Than'.
  • Other Variable: The variable to compare with.
  • Verdadero: The script to run if the condition is true.
  • Falso: The script to run if the condition is false.

Variable: Funciones matemáticas

Allows you to perform various maths functions on a variable to add/subtract/multiply/divide/modulus a value/variable/random number.

Variable: Funciones matemáticas
Variable
$Variable0
Operation
Definir como
Valor
Verdadero
  • Variable: The variable to use.
  • Operation: The operation to use for modifying the variable value.
  • Valor: The value to combine with the variable using the selected operation.

Variable: Reiniciar todas la variables

Reset all variables used by your project back to false.

Variable: Reiniciar todas la variables
Reiniciar todas las variables.

Seed Random Number Generator

Place this to run in response to user input to ensure random numbers change between playthroughs.

Seed Random Number Generator
Place this to run in response to user input to ensure random numbers change between playthroughs

Actor: Almacenar posición en variables

Store the current position of an actor within two variables, one to store the horizontal position and another to store the vertical position.

Actor: Almacenar posición en variables
Actor
Actor 1
X
$Variable0
Y
$Variable0
  • Actor: The actor you want to check.
  • X: The variable to use for the horizontal position.
  • Y: The variable to use for the vertical position.

Store Engine Field In Variable

Store the value of an Engine Field in a variable.

References
/docs/settings/#engine-settings

Store Engine Field In Variable
Engine Field
Jump Velocity
  • Engine Field: The engine field to read the value of.

Store Variable from Game Data In Variable

Read a variable's value from a specified save slot and store it in a variable.

Store Variable from Game Data In Variable
Set Variable
$Variable0
Para Variable
$Variable0
From Save Slot
Slot 1
Slot 2
Slot 3
  • Set Variable: The variable to update.
  • Para Variable: The variable to read the value of.
  • From Save Slot: The save slot to use.

Variable: Disminuir por 1

Decrease the value of the specified variable by one.

Variable: Disminuir por 1
Variable
$Variable0
  • Variable: The variable to use.

Variable Flags Add

Set selected flags to true on a variable. All unselected flags will keep their previous value.

Variable Flags Add
Variable
$Variable0
Flag 1
Flag 2
Flag 3
Flag 4
Flag 5
Flag 6
Flag 7
Flag 8
Flag 9
Flag 10
Flag 11
Flag 12
Flag 13
Flag 14
Flag 15
Flag 16
  • Variable: The variable to use.
  • Flag 1: Set flag 1 to true.
  • Flag 2: Set flag 2 to true.
  • Flag 3: Set flag 3 to true.

Variable Flags Clear

Set selected flags to false on a variable. All unselected flags will keep their previous value.

Variable Flags Clear
Variable
$Variable0
Flag 1
Flag 2
Flag 3
Flag 4
Flag 5
Flag 6
Flag 7
Flag 8
Flag 9
Flag 10
Flag 11
Flag 12
Flag 13
Flag 14
Flag 15
Flag 16
  • Variable: The variable to use.
  • Flag 1: Set flag 1 to false.
  • Flag 2: Set flag 2 to false.
  • Flag 3: Set flag 3 to false.

Variable Flags Set

Set the value of a variable by enabling individual bits of the 16-bit number. Allows 16 true/false values to be stored within a single variable. Setting the flags will replace the previous value of the variable.

Variable Flags Set
Variable
$Variable0
Flag 1
Flag 2
Flag 3
Flag 4
Flag 5
Flag 6
Flag 7
Flag 8
Flag 9
Flag 10
Flag 11
Flag 12
Flag 13
Flag 14
Flag 15
Flag 16
  • Variable: The variable to use.
  • Flag 1: Set flag 1 to true.
  • Flag 2: Set flag 2 to true.
  • Flag 3: Set flag 3 to true.

Variable: Incrementar por 1

Increase the value of the specified variable by one.

Variable: Incrementar por 1
Variable
$Variable0
  • Variable: The variable to use.

Variable: Cambiar a 'Falso'

Set the value of the specified variable to false.

Variable: Cambiar a 'Falso'
Variable
$Variable0
  • Variable: The variable to use.

Variable: Cambiar a 'Verdadero'

Set the value of the specified variable to true.

Variable: Cambiar a 'Verdadero'
Variable
$Variable0
  • Variable: The variable to use.

Variable: Cambiar a valor

Set the specified variable to a defined value.

Variable: Cambiar a valor
Variable
$Variable0
Valor
0
  • Variable: The variable to use.
  • Valor: The value to set the selected variable to.