The modify_variable action modifies the value of one of the logic variables.
Each group comes with a set of 4 variables with IDs ranging from 0 to 3. Variables are floating point values.
Local variables are the variables of the current group, and they are expressed with a 'v' followed by the variable ID (0-3), for example: v0
.
Note that foreign variables are accessible only if the group name is unique in the manager or in the world. They are expressed with the group name followed by a colon ':' and then followed by a local variable identifier (v), for example: group_1:v2
.
Constant values are floating-point numerical expressions in base 10.
<local_variable | foreign_variable> < = | + | - | * | / > <local_variable | foreign_variable | constant_value>
+
operator acts like +=
in C.This example modifies variable 3 of my_npc_group, incrementing it by 1.
my_npc_group:v3 + 1
modify_variable
.modify_variable
.modify_variable
to create randomized behavior.