Change Variable

Change Variable

Change Variable alters the value of a Variable. It can also apply to a range of variables, and operate on Local or Global variables.

Targets

Name Explanation
Global / Local Targets a single Variable.
Global / Local Range Targets multiple contiguous Variables.
Global / Local Reference Targets a single Variable based on a Variable index.

Values

Name Explanation
Value Leverages a value, as a Number or String.
Local Leverages a single Local Variable.
Global Leverages a single Global Variables.
Random Leverages a random Number value, between a Minimum and Maximum.

Properties

System

Name Explanation Type
Operation The operation to perform on the variable. Operator

Examples

Set Global Variable 3 to Random

This sets the Global Variable 3 to a random value between 6 and 12.

{"Data":{"Operation":0,"RandomEnd":"12","RandomStart":"6","Value":"","Index":3,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableCommand"}

Add 20 to Local Variables 0 - 6

This adds 20 to Local Variables 0 - 6.

{"Data":{"Operation":1,"RandomEnd":null,"RandomStart":null,"Value":"20","Index":0,"IndexEnd":6,"IsLocal":1,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableCommand"}

Subtract 1 from Global Variable by Reference, Based on Global Variable 0

This subtracts 1 from a Global Variable, with an index specified by Global Variable 0.

{"Data":{"Operation":1,"RandomEnd":null,"RandomStart":null,"Value":"20","Index":0,"IndexEnd":6,"IsLocal":1,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableCommand"}

Multiply by 5 on Global Variable by Reference, Based on Local Variable 0

This multiplies by 5 to the value in a Global Variable, with an index specified by Local Variable 0.

{"Data":{"Operation":3,"RandomEnd":null,"RandomStart":null,"Value":"5","Index":0,"IndexEnd":null,"IsLocal":1,"IsOperandReference":0,"IsReference":1,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableCommand"}

Set Local Variable 0 to Global Variable 5

This sets the Local Variable 0 to the value in Global Variable 5.

{"Data":{"Operation":0,"RandomEnd":"","RandomStart":"","Value":"","Index":0,"IndexEnd":null,"IsLocal":1,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":5,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableCommand"}