Change Switch

Change Switch

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

Targets

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

Values

Name Explanation
Value Leverages a value, as a Toggle (On or Off).
Local Leverages a single Local Switch.
Global Leverages a single Global Switches.
Random Leverages a random state.

Examples

Set Global Switch 0 to Random

This sets the Global Switch 0 to a random value.

{"Data":{"Random":1,"Value":0,"Index":0,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SwitchCommand"}

Set Global Switches 0 - 99 to Off

This sets Global Switches 0 - 99 to Off.

{"Data":{"Random":0,"Value":0,"Index":0,"IndexEnd":99,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SwitchCommand"}

Set Global Switch by Reference, Based on Global Variable 3

This sets a Global Switch, with an index specified by Global Variable 3, to On.

{"Data":{"Random":0,"Value":1,"Index":3,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":1,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SwitchCommand"}

Set Local Switch 0 to Global Switch 0

This sets the Local Switch 0 to the value in Global Switch 0.

{"Data":{"Random":0,"Value":0,"Index":3,"IndexEnd":null,"IsLocal":1,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":0,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SwitchCommand"}