Operation
An operation reads a state, performs processes such as delays, randomization, or calculations, and writes the result back to the state. For a list of operations, see Operation components.
What is logic?
Logic is an operation that reads messages, performs various calculations, and notifies the result as a message.
Common logic settings
The settings for each logic component are as follows:
- The target and identifier of the message (Signal) that serves as the starting point for the calculation
- The calculation step (executed in order from the top)
- Add a step
- The target, identifier, and type for notifying the calculated result as a message (If “Signal” is selected as the message type, the message is sent when the calculation result is true)
- The operator and function to apply
- Argument 1
- Argument 2 (the number of arguments varies depending on the function)
List of operators and functions that can be set in logic
Operator / Function | Description |
---|---|
= | Returns the value of the argument as is. |
Not | Returns false if the value is true. Otherwise, returns true. |
Minus | Returns the value with its sign inverted. |
Add | Returns the sum of two values. |
Multiply | Returns the product of two values. |
Subtract | Returns the result of subtracting the value of argument 2 from argument 1. |
Divide | Returns the result of dividing the value of argument 1 by argument 2. |
Modulo | Returns the remainder after dividing the value of argument 1 by argument 2. |
Equals | Returns true if two values are equal. Otherwise, returns false. For Float types, returns true if the two values are within a small range of each other. |
NotEquals | Returns false if two values are equal. Otherwise, returns true. For Float types, returns false if the two values are within a small range of each other. |
GreaterThan | Returns true if the value of argument 1 is greater than argument 2. Otherwise, returns false. |
GreaterThanOrEqual | Returns true if the value of argument 1 is greater than or equal to argument 2. Otherwise, returns false. |
LessThan | Returns true if the value of argument 1 is less than argument 2. Otherwise, returns false. |
LessThanOrEqual | Returns true if the value of argument 1 is less than or equal to argument 2. Otherwise, returns false. |
And | Returns true if both values are true. Otherwise, returns false. |
Or | Returns true if either value is true. Otherwise, returns false. |
Condition | Returns the value of argument 2 if the value of argument 1 is true. Otherwise, returns the value of argument 3. |
Min | Returns the smaller of two values. |
Max | Returns the larger of two values. |
Clamp | Returns argument 1 clamped within the range of argument 2 and argument 3. |
Length | Returns the length of the vector in the argument. |
Sqrt | Returns the square root of the argument. |
Dot | Returns the dot product of two vectors. |
Cross | Returns the cross product of two three-dimensional vectors. |
Rotate | If argument 1 is a number, returns the result of rotating the two-dimensional vector in argument 2 counterclockwise by the angle (in degrees) of argument 1. If argument 1 is a Vector3, it applies the rotation represented by argument 1 as Euler angles (in degrees) to the three-dimensional vector in argument 2. |
Types of arguments that can be set in logic
Argument Type | Description |
---|---|
Constant | Set when using a constant, specifying its type and value. |
RoomState | Set when using a message, specifying its type, target, and identifier. When using the Double type, all value types can be read commonly. |
For more details on message types and values, see the common settings section of Trigger.
- Swap with the step above
- Delete the step
- Swap with the step below