Comparisons
Use Cases:
Buying items
Checking if a player has completed a task
Verifying if a player possesses the correct item
Determining if a player has specific items equipped
Triggering events based on value ranges
Initiating random events based on values
Unlocking quests
Verifying puzzle completion by the player
Checking if the player has entered the correct sequence
Set Broadcast Type to All or Rules to send messages from objects to the Rules System.
Compare Numbers
With the Compare numbers Rule it is possible to compare a number variable with another value. When the condition is met a message will be sent. This can be used to trigger a victory event when a player scored enough goals or to define which team has won in a multiplayer game. The Rule can be set up to check immediately upon receiving the trigger or can wait for the condition to be true to send the outgoing message.
It is possible to use different conditions like equals or greater than to cover a multitude of uses.

Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Number variable to compare
This defines the number variable that is compared by this rule.
Condition
The condition defines how two values are compared. There are multiple selectable options:
Equals: When both values are the same, the message will be sent. A = B
NotEquals: When both values are different, the message will be sent. A ≠ B
Greater: When the Number Variable’s value is higher than the compare value, the message will be sent. A>B
GreaterEquals: When the Number Variable’s value is higher or the same as the compare value, the message will be sent. A≥B
Lower: When the Number Variable’s value is lower than the compare value, the message will be sent. A<B
LowerEquals: When the Number Variable’s value is lower or the same as the compare value, the message will be sent. A≤B
Number variable to compare with
There are three modes to define the number the initial number variable is compared with:
Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. An input field will appear to enter the number value.
Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.
Comparison duration
With this checkbox ticked the condition will not only be checked when the Rule is activated but will wait until the condition is true and sent the outgoing message.
Message to send
The outgoing message that is sent when the condition is met.
Compare True/False
Required Message
Select the incoming message to trigger the rule.
True/false variable to compare
Select the true/false variable to compare.
Condition
Select a condition to compare.
True false variable to compare with
Select what to compare the true/false variable with:
Variable - Select a second variable to compare with.
Message Argument - The Required Message that triggers this rule may include a message argument of true/false type.
Fixed Value - Use the toggle to select a fixed value of True or False.
Comparison Duration
Define how often the condition is checked once the rule is triggered:
Once - The rule will only check when it is triggered by the Required Message.
Constantly - The rule will always check the condition until it is met.
Message to Send
Select the outgoing message to be sent when the condition is met.
If/Else
This rule checks a true/false value and sends a message if either true or false.

Required Message
Select the incoming message to trigger the rule.
True/False Value
Select a true/false value to check if it is true or false:
Variable - Select a true/false variable to check.
Message Argument - The Required Message that triggers this rule may include a message argument of true/false type to check.
Fixed Value - Use the toggle to select a fixed value of True or False.
Message to Send When True
Message to send if the selected true/false value is true.
Message to Send When False
Message to send if the selected true/false value is false.
Check if number is in range
Set up a Lootbox or adjust the result of something depending on the score of the player.
The Check if number is in range Rule will check whether a value is within a predefined range. The Rule can be set up to check immediately upon receiving the trigger or can wait for the condition to be true to send the outgoing message.

Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Minimum value
There are three modes to define the lowest value the number can be for the comparison to return true:
Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. An input field will appear to enter the number value.
Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.
Maximum value
There are three modes to define the highest value the number can be for the comparison to return true:
Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. An input field will appear to enter the number value.
Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.
Number variable to compare
There are three modes to define the number value that is compared if it is in range:
Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Roll a Random Number, Add/Subtract number or Set number value Rules. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. An input field will appear to enter the number value.
Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the number type for it to be selectable here. A dropdown menu will appear to select the message argument.
Comparison duration
With this checkbox ticked the condition will not only be checked when the Rule is activated but will wait until the condition is met and sent the outgoing message.
Message to send
The outgoing message that is sent when the condition is met.
Last updated
Was this helpful?


