-
Notifications
You must be signed in to change notification settings - Fork 28
Chasing and modifying variables
The workshop actions Modify Global Variable
, Modify Player Variable
, Modify Global Variable At Index
, and Modify Player Variable At Index
can be used in OSTW using the single function, ModifyVariable
. It works with every variable type including global, player, scoped, and class variables.
ModifyVariable(createdEffects, Operation.AppendToArray, LastCreatedEntity());
You can modify at an index by adding an indexer after the declared variable.
ModifyVariable(lowestNodes[x], Operation.Min, Node.Flags);
Player variables can be modified by preceeding the variable with an expression that resolved to a player. If no player is provided when modifying a player variable, Event Player
will be used by default.
ModifyVariable(target.Links, Operation.AppendToArray, host.Links[i]);
-
Add
* -
Subtract
* -
Multiply
* -
Divide
* -
Modulo
* -
RaiseToPower
* Min
Max
AppendToArray
RemoveFromArrayByValue
RemoveFromArrayByIndex
* These operations can be executed using the respective operators +=
, -=
, *=
, /=
, %=
, and ^=
.
ChaseVariableAtRate
and ChaseVariableOverTime
handle the variable the same as ModifyVariable
except they do not support indexes or non-static class variables.