SC2Mapster Wiki
mNo edit summary
No edit summary
 
Line 21: Line 21:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|Size=normal
 
|Size=normal
|NavBar=Yes
+
|NavBar=y
 
}}
 
}}

Latest revision as of 15:49, 22 April 2018

Math Frame

The MathFrame takes in two math values and an operator value. It then produces a result based on the inputs.

Structure

N/A

Math Frame Properties

Math Frame inherits from Frame and shares all of its properties. Additionally it has:


A
The is the first value of a MathFrame.


B
The is the Second value of a MathFrame.


Operator
The is the Operator of a MathFrame. It is a required field for the frame to give a result.

It can have the following values: Add, Subtract, Multiply, Divide, Negate, Modulo, Absolute, Random, RandomStl

When calculating the results if the value of Operator is Add, Subtract, Multiply, Divide, or Modulo: it does A (Operator) B.

If the value is Negate, the result is -1 * A

If the value is Absolute, the result is the absolute value of A

If it's Random or RandomStl, the result is a random value between A and B. This value will change only if the input values change. Alternatively, you can use an Animation's Property Controller to change the Operator between RandomStl and Random to generate a new random value.


Result
The is the result value of a MathFrame. This is a READ-ONLY value.

The Result is given as a decimal value.


ResultInt
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultInt is given as a Integer value.


ResultRound
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultRound is given as an integer value.

This is the value of Result rounded to the nearest integer value.


ResultCeil
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultCeil is given as an integer value.

This is the value of Result rounded up.


ResultValid
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultValid is given as a Boolean value.

This will be true if you are not dividing by 0 or B < A for a random generator.

Examples

<Frame type="MathFrame" name="YRatio">
    <A val="{$parent/YDistFrame/@Distance}"/>
    <B val="100"/>
    <Operator val="Divide"/>
    <Handle val="YRatio"/>
</Frame>