Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

Script Operators

=

Assigns the value of the second operand to the first operand.

+

Addition. Adds two numbers together.

-

Subtraction. Subtracts two numbers from each other.

*

Multiplication. Multiplies two numbers.

/

Division. Divides two numbers.

%

Modulus. Computes the integer remainder from dividing two numbers.

+=

Adds two numbers and assigns the result to the first.

-=

Subtracts two numbers and assigns the result to the first.

*=

Multiplies two numbers and assigns the result to the first.

/=

Divides two numbers and assigns the result to the first.

%=

Computes the modulus of two numbers and assigns the result to the first.

++

Increment. Adds the value of 1 from a variable representing a number.

--

Decrement. Subtracts the value of 1 from a variable representing a number.

~

Bitwise NOT. Flips the bits of its operand.

|

Bitwise OR. Returns a one in a bit if the bits of either operand is one.

&

Bitwise AND. Returns a one in each bit position if bits of both operands are one.

^

Bitwise XOR. Returns a one in a bit position if bits of one but not both operands are one.

<<

Left bit shift. Shifts it's first operand in binary representation of the number of bits to the left specified in the second operand, shifting in zeros from the right.

>>

Sign-propagating Right bit shift. Shifts the first operand in binary representation the number of bits to the right specified in the second operand, discarding bits shifted off.

|=

Performs a bitwise OR and assigns the result to the first operand.

&=

Performs a bitwise AND and assigns the result to the first operand.

^=

Performs a bitwise XOR and assigns the result to the first operand.

<<=

Performs a left shift and assigns the result to the first operand.

>>=

Performs a sign-propagating right shift and assigns the result to the first operand.

@

Concatenates one or more values together to form a new value.

NL

Concatenates one value together with a new line to form a new value.

TAB

Concatenates one value together with a tab to form a new value.

SPC

Concatenates one value together with a space to form a new value.

!

Evaluates the opposite of the value specified.

&&

Requires both values to be true for the result to be true.

||

Requires only one value to be true for the result to be true.

==

Evaluates whether value1 and value2 are equal.

!=

Evaluates whether value1 and value2 are not equal.

<

Evaluates whether value1 is less than value2

>

Evaluates whether value1 is greater than value2.

<=

Evaluates whether value1 is less than or equal to value2.

>=

Evaluates whether value1 is greater than or equal to value2.

$=

Evaluates whether string1 is equal to string2

!$=

Evaluates whether string1 is not equal to string2.