🔹Game Rules
Last updated
Last updated
Copyright ©The Sandbox. All Rights Reserved.
GAME MAKER 0.10 UPDATE
This documentation is being updated with the following:
Export and Import Rules with CTRL
+C
and CTRL
+V
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
HUD enhanced with icons, slot sizes, dynamic show/hide, improved Banner and Popup
New float variable for decimals
GAME MAKER 0.9 NEW FEATURE Create new types of gameplay and design complex logic more efficiently with Game Rules!
The Game Rules system is a visual scripting tool located in the Gameplay menu.
It allows you to easily use and manipulate values such as numbers, text, time, and true/false values for your gameplay design needs:
You can create custom mechanics from scratch or use predefined game mechanics called Presets, which is detailed more below. The following Presets are currently available (more will be added in the future):
Rules are a sequence of steps carried out from top to bottom, which can communicate with other rules or object logic (behaviours and components).
Any message sent to the Game Rules system needs to be broadcast to All receivers or explicitly to Rules.
To decrease a variable, use a negative number in the value change logic box.
Rule types currently include: Math, Time, Comparison, Change Variable Values, and Game Screen. Click a Rule type to expand the list of options.
Some Rules offer new possibilities and mechanics, while others offer shortcuts to solve complex problems.
REUSE RULES
Rules reset once they are completed or stopped, so they can be used again.
When you click on a Rule in the Rules list, it is added to the grid board (in a new Ruleset).
Variables are the backbone of the Game Rules system. Almost every Rule can or has to work in combination with a variable.
They can be used to store information like scores or text, timers can be used to trigger delayed events, and boolean variables offer a new way to build more complex logical systems.
Boolean variables store a binary value generally depicted as true or false. The boolean variable in the Gameplay Rules is called “true/false” variable.
Variables are automatically created when you use a Preset in Game Rules (more information below), but you can customise your Experience mechanics to use any variables you like.
Rulesets are a way to visually organise a group of Rules used for the same game mechanic.
Rules may be grouped into a Ruleset, but they still act independently when triggered:
The order in which Rules are placed in a Ruleset does not change the flow of logic.
A Rule's message Out may trigger another Rule in the same Ruleset or in a different one.
Some Rules may not send a message Out.
Example
The Collect Points Ruleset (a Preset) is a gameplay mechanic that includes a chain of two Rules (shown in red below) and other Rules that act independently of the others.
Presets are pre-built Rulesets you add to your grid board with a single click to set up commonly used game mechanics and customise as needed.
When adding a Preset, all necessary variables and messages are automatically generated.
Presets are accessed with a button in the Island Menu on the left. Click on a Preset in the list to add it to the grid board.
You can now customise it and set up or modify existing object logic (behaviours and components) so it will work when players interact with those objects and trigger messages to be sent.
Copy and paste Rulesets with CTRL
+C
and CTRL
+V
. Messages and variables included!
Paste generated text into external sources like a notepad to share.
Paste into other Experiences to reuse your Ruleset!
The Island Menu (left side) contains Presets, Rules, and Variables to build mechanics.
The grid board is the main space for organising Rulesets. It is empty until a Ruleset is added via the Rules or Presets options in the island menu.
A meter (bottom left) indicates the number of Rules added to your grid board. A warning appears when you may experience performance issues by exceeding the recommended limit (currently more than 80 Rules).
The Rules Hierarchy dropdown (bottom right) allows you to:
Trigger A Rule is triggered by a message In. If a message with an argument* is received, it may include an argument that fills a value in a logic box to carry out an action.
Variable(s) A Rule may use zero, one, or multiple stored values defined by name and type.
Action(s) A sequence of actions to carry out, such as changing a variable, comparing values, displaying information in the player's HUD, etc.
Message to Stop the Rule Some rules allow another message In to stop its actions.
Output An optional message Out may trigger another Rule or object logic. Currently these messages can not define custom arguments*.
Right click a Rule and use arrows to view information about each logic box.
DEFINE Create Rulesets made of one or more Rules
A Rule carries out actions using variables you define and values you enter
TRACK Changes to variables caused by Rule actions are stored for reuse Local variables (L) - track individual players Global variables (G) - track all players
RELAY Rules are trigged by messages In and send messages Out to communicate with:
other Rules
behaviours and components (object logic)
Full documentation on how every rule works
Documentation of useful rulesets/Presets
Click the magnify lenses (top right)
CTRL+WASD keys
CTRL+Z - Undo
CTRL+Y - Redo
Player Perspective Enter an area. A timer appears as a door opens, indicating limited time to enter. Re-enter the area to start a timer again.
Logic Flow of the Timer Rule
Trigger - When the player enters an area and is detected, a message is sent to the Rule.
Variable - A time variable will be used to store the timer.
Actions - The timer is displayed and starts to count down.
Output - When the timer reaches 0, a message is sent to close the door. The Rule resets when complete so it can be triggered again.
Shops, scores, stats, inventory, etc.
Display short text in banners or HUD slots such as status, location, level, etc.
Timers and Stopwatches with stop, pause, and resume
Set a state to manage logic, with potential to create if/else structures
Rename, Duplicate, or Delete a Ruleset Select a Ruleset to reveal a small menu of buttons (top center)
Add a Rule to a Ruleset
Click the button (next to Rule name)
Drag a Rule from another Ruleset into the desired Ruleset
Store, modify, and reuse variables
Compare values
Generate random numbers
Create timers and stopwatches
Display information in the player's , popup windows, and banners
OPEN GAME RULES Game Rules tab in the Gameplay menu
CLOSE GAME RULES Click the X (top right)
MAX/MIN WINDOW (top right)
Maximise
Minimise
ZOOM IN/OUT
CTRL+ move scroll wheel
PAN GRID BOARD
Click and hold scroll wheel
UNDO/REDO
Number - Integer values (i.e. 255) and float values (i.e. 25.5)
Text - Short character strings
Time - Floating time values
True/False - Boolean values (binary)
Add a Rule (new Ruleset) Click on a Rule in the Rules list