Skip to content

Variable Manipulation

Variable Manipulation

Applies a transformation function to a Variable, including math, string, and array operations.

Properties

System

Name Explanation Type
Manipulator The transformation function to apply to the target variable, such as abs, floor, round, uppercase, lowercase, or trim. Variable Manipulator
Target The variable to apply the manipulation to. Variable or Value

Examples

Floor the Value in Global Variable 0

This applies the floor function to the value stored in Global Variable 0, rounding it down to the nearest integer.

$gv[0] = manipulate(floor);
{"Data":{"Manipulator":{"$":"FloorVariableManipulator","Metadata":null},"Target":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Index":0,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableManipulationCommand"}

Round the Value in Global Variable 0 to 2 Decimal Places

This rounds the value stored in Global Variable 0 to 2 decimal places.

$gv[0] = manipulate(round, 2);
{"Data":{"Manipulator":{"$":"RoundVariableManipulator","Digits":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"2","VariableIndex":0,"Metadata":null},"Metadata":null},"Target":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Index":0,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableManipulationCommand"}

Convert the String in Global Variable 0 to Uppercase

This converts the string value stored in Global Variable 0 to uppercase.

$gv[0] = manipulate(uppercase);
{"Data":{"Manipulator":{"$":"UppercaseVariableManipulator","Metadata":null},"Target":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Index":0,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.VariableManipulationCommand"}