Rule Types
Last updated
Last updated
Copyright ©The Sandbox. All Rights Reserved.
GAME MAKER 0.10 UPDATE
This documentation is being updated to remove replaced rules and detail new ones.
More advanced Math rule replaces Add/Subtract Number, Multiply Number, and Add/Subtract Time rules
New rules expand creative possiblities: Key Input, Mouse Input, OnPlayerEntry, OnPlayerExit, Send Message, Set Player Name, If/Else, Compare if True/False
HUD
enhanced with icons, slot sizes, dynamic show/hide, improved Banner and Popup
Any Message that is sent to the Game Rules system needs to be broadcast to All receivers or explicitly to Rules.
Reduce a numerical variable with a negative value.
Math rules have been reworked in Game Maker 0.10 to offer greater flexibility and more advanced calculations.
Math Rules allow you to change a variable:
Math (new with Game Maker 0.10)
Add/Subtract number continuously
Add/Subtract number (removed with Game Maker 0.10)
Multiply number (removed with Game Maker 0.10)
Use Cases:
Currency systems
Health systems
Damage systems
Upgrade systems
Leveling up and scaling
The Add/Subtract number continuously Rule is a way for the creator to set up a additional stats for their players or continuously increasing scores. The Rule can count up or down within the boundaries set by the creator.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This defines the time variable, that is used to measure time in this tree.
Duration
There are three modes to define the time between each increase/decrease:
Variable will allow you to define an existing variable to modify the timer. 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
This defines the number variable that is modified by this rule. This could be a players score or stat like hunger.
Value change
There are three modes to define how much time will be added to the number:
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.
Minimum Value
There are three modes to define the minimal value. The number variable won’t be lower than this value.
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 maximal value. The number variable won’t be higher than this value.
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.
Message to stop the rule
This message is stop the rule from running.
This rule has been removed in Game Maker 0.10 (see the new Math rule).
With the Add/Subtract number rule existing variables can be modified. This is helpful to saving players scores or other interactions. Both increasing and reducing the variable’s value is possible. This tree will always change the variable’s value based on its current value. To (randomly) set a number check the according rules.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Number variable
This defines the number variable that is modified by this rule. This could be a players score.
Value change
There are three modes to define how much will be added to the number:
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.
Message to send
This message is sent after the value is modified.
This rule has been removed in Game Maker 0.10 (see the new Math rule).
The Multiply number Rule is a simple and easy way to multiply values, which could be used for a score multiplier by a creator.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Number variable
This defines the number variable that is modified by this rule. This could be a players score.
Multiply with
There are three modes to define how much the number will be multiplied 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.
Message to send
This message is sent after the value is modified.
The Add/Subtract Time rule has been removed in Game Maker 0.10 since time and number variables now work similarly.
Time Rules allow you to create timers and stopwatches that can be affected by player actions:
Start Timer
Stopwatch
Pause Time
Set Time Value
Add/Subtract Time (removed with Game Maker 0.10)
Use Cases:
Racing games
Poison system
Damage over time systems
Crafting timers
Areas upgrading and degrading over time for management or resource gathering
Preparation time at cooking stations
Lock outs
Puzzles
The Start Time rule allows creators to create descending timers that will send a message once they reach 0. This allows for more dynamic timed and delayed events. Close a door if a player is too slow to reach it, Spawn new waves of enemies after a certain time or simply delay a reaction to a players interaction.
Required Message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This will define which Variable of the type Time will be modified by this rule.
Duration
There are three modes to define how much time will be on the timer after it starts
Variable will allow you to define an existing variable to modify the timer. 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.
Message to stop the rule
If the timer needs to be stopped prematurely it can be done using this message.
Message to send
The message that is sent out when the timer is finished.
With the Stopwatch rule it is possible to create an ascending stopwatch. It will run until it is stopped and the timer can trigger messages by using the Compare Time rule.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This will define which Variable of the type Time will be modified by this rule.
Message to stop
With this message the Stopwatch can be stopped, for example when crossing a finish line.
With the Pause time rule you can pause and unpause a running time variable. It is also possible to react to a timer being paused or unpaused by sending a message each time the state changes.
Required Message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This will define which Variable of the type Time will be modified by this rule.
Pause State
There are three modes to define how much time will be added to the timer:
Variable will allow you to define an existing variable to modify the timer. This variable can be modified elsewhere using the Set true/false value rule. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. An checkbox will appear to toggle the 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 true/false type for it to be selectable here. A dropdown menu will appear to select the message argument.
A true value (a ticked checkbox) will cause the timer to be paused, while a false value will un-pause the timer.
Message to send
This message can be send out after the timer is paused or un-paused. This is an optional field an can be set to none.
The Set Time value rule is an easy way to set the timer to a specific value without having to calculate anything. The timer can be set to new values or be set to zero if a race is over or lost.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This will define which Variable of the type Time will be modified by this rule.
New time value
There are three modes to define the value the time will set to:
Variable will allow you to define an existing variable to modify the timer. 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.
This rule has been removed in Game Maker 0.10 (see the new Math rule).
Add/Subtract Time allows creators to increase or reduce the value of a time variable. Doing this can affect both the Stopwatch rule and the Timer rule. This can be used to create a checkpoint race, where players might get a little bonus time for each checkpoint. It’s also possible for specific actions, consumables or enemies to modify the timer.
Required Message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Time variable
This will define which Variable of the type Time will be modified by this rule.
Value change
There are three modes to define how much time will be added to the timer:
Variable will allow you to define an existing variable to modify the timer. 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.
The Comparison Time rule has been removed in Game Maker 0.10 since time and number variables now work similarly.
Comparison Rules allow you to check a variable against a static value or range of values:
Compare Numbers
Compare True/False
If/Else (new with Game Maker 0.10)
Check if Number is in Range
Send Message (new with Game Maker 0.10)
Compare time (removed with Game Maker 0.10 - use Compare Numbers)
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
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.
During the comparisons this value will be 'A'.
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.
During the comparisions this variable will be 'B'.
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.
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.
This rule has been removed in Game Maker 0.10 (see the Compare Numbers rule).
The Compare Time Rule acts similar to the Compare Numbers but it will compare the value of a Timer instead of a numerical value. Different comparison conditions allow for creative usage of this rule. 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.
Time variable to compare
This defines the time variable that is compared by this rule.
During the comparisons this value will be 'A'.
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 Time Variable’s value is higher than the compare value, the message will be sent. A>B
GreaterEquals: When the Time Variable’s value is higher or the same as the compare value, the message will be sent. A≥B
Lower: When the Time Variable’s value is lower than the compare value, the message will be sent. A<B
LowerEquals: When the Time Variable’s value is lower or the same as the compare value, the message will be sent. A≤B
Time variable to compare with
There are three modes to define the number the initial time 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.
During the comparisons this variable will be 'B'.
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.
New Set Player Name rule in Game Maker 0.10.
Set variable values allow you to generate a random number or set variables (except for time):
Set Number Value
Set True/False Value
Set Text Value
Set Player Name (new with Game Maker 0.10)
Roll a Random Number
Use Cases:
Loot systems
Turn-based battle systems
Memory-based puzzle games
Upgrading outcomes with a random chance to obtain rare items
Spawning rare monsters, equipment, bosses, quests, events
Providing different outcomes for the same quest
Lockouts
Puzzles
Use the Set Number Rule to simply set a number variable to a new value. This can be used to reset a value to 0.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Number variable
This is the number variable, that will be changed.
New number value
There are three modes to define the value the selected variable will be set to:
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.
The Set True/False allows creators to change a Bool from True to False or from False to True. This could be useful when trying to adjust the visibility of the Rules UI.
Required Message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
True/False variable
This defines the true/false variable that is modified by this rule.
New true/false variable
There are three modes to define the new value of the true/false variable:
Variable will allow you to define an existing variable to modify the number. This variable can be modified elsewhere using the Set true/false value Rule. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. A checkbox will appear to toggle the 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 true/false type for it to be selectable here. A dropdown menu will appear to select the message argument.
The Set Text value Rule allows creators to change text variables based on an incoming message. This can be used to reuse a variable for different banners, or show quest like messages in the UI.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Text Variable
This defines the text variable that is modified by this rule.
New Text
There are three modes to define the new text value:
Variable will allow you to define an existing variable to modify the text. This variable can be modified elsewhere using the Set text 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 text.
Message Argument will allow you to use an argument sent within the message. The message has to be created with an argument of the HashedText type for it to be selectable here. A dropdown menu will appear to select the message argument.
The Choose Random Number Rule is a quick and accessible way to create random numbers. It is possible to define the range in which the number will lie and send a message after the value is applied to a variable. This allows creators to create random based events, like enemy spawns or opening paths in a maze or simple dice rolls.
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 number that can be rolled:
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 number that can be rolled:
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
This defines the number variable that is modified by this rule.
Message to send
This message is sent after the value is modified.
Game Screen rules have been reworked in Game Maker 0.10 to introduce new HUD slot formatting, a new top slot, and a new Show/Hide HUD rule.
Game Screen rules allow you to control what appears on the player's screen:
HUD (new with Game Maker 0.10)
Show/Hide HUD (new with Game Maker 0.10)
Banner
Popup Window
Display Variable on HUD (removed with Game Maker 0.10 - see HUD)
Use Cases:
Showing items or money obtained for use as a game mechanic
Displaying health/life count
Displaying timers, stopwatches, laps, etc
Displaying player status, progression, achievements, etc.
Displaying warnings/clues
Displaying important information for the player such as location, event announcements, etc.
The Banner rule is a handy way to inform your players about anything happening in your experience. You can set up individual texts that are displayed in the banner. It is also possible to show numerical values in the banner.
Required Message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Displayed variable
The variable set in the dropdown menu will be displayed on the banner. The variable’s display name will be shown on the left side while its value is shown on the right side of the banner. By using a text variable it is possible to display longer texts.
Duration
There are three modes to define the time the banner is shown:
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.
Message to send on close
This message is sent after the Banner has disappeared.
If you are using more complex gameplay in your experience you may need text elements to give the player the information he needs. For this you can use the Show Popup rule. It will show a small popup that has to be manually closed by the player by clicking the OK or Close Button. This will grab the player’s attention!
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Title
This will be displayed as the title of your text box to the player
Description
This is the main body of your message to the player. It can contain a maximum of ~500 letters.
Message to send on close
This message is sent after the Popup has closed.
This rule has been removed with Game Maker 0.10. See the new HUD rule.
With the Display Variable on HUD rule you can show or hide any variables in the client HUD so player can see them. This is useful for game modes where players should be able to see their time, score or other information. It is also possible to use this rule to hide any variables that is not important for the player when they progress through your game.
The values will be part of the Rules HUD which can be turned on or off setting the local Show Rules HUD variable.
Required message
The message to activate this tree. Every time this message is broadcast the tree will be triggered.
Variable
This will define which Variable is shown (or hidden) in the HUD.
Displayed variable
There are three modes to define if the value is shown or hidden.
Variable will allow you to define an existing variable to toggle the visibility of the value. A dropdown menu will appear to select a variable.
Fix value will allow you to set up a constant value. A checkbox will appear to set this 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 True/False (Bool) type for it to be selectable here. A dropdown menu will appear to select the message argument.
New rule type introduced with Game Maker 0.10.
Triggers allow you to send a message with specified inputs:
Key Input (0-9)
Mouse Input (left, center, and right mouse buttons)
New rule type introduced with Game Maker 0.10.
New Slot Types
Format to show variables in custom ways.
HUD Slot Icons
Use icons to represent custom game information.
HUD Slot Sizes
Emphasize variable importance by size.
Slots Show Dynamically & New Top Slot