LogoLogo
GeneralAccountsPlayersOwnersCreatorsThe Sandbox Website
Creators
Creators
  • 🎆Welcome to the Creator Portal
  • 🟦Learn Creator Basics
    • 🟦Scale & LAND Use
    • 🟦Assets & Equipment
    • 🟦Avatars & Character
    • 🟦Look & Feel
    • 🟦Logic & Gameplay
    • ❓FAQs: Gameplay
    • ❓FAQs: Assets
    • 🧙‍♂️Begin Game Maker (Video Series)
  • The Sandbox Creators Forum
  • The Sandbox DAO
  • 🪙Monetisation
  • Game Maker
    • ✨Create Experiences
    • 🔰Beginners
      • Play/Test
      • Build with Blocks
      • Place Assets
      • Set Object Actions
      • Trigger Logic
      • Craft Quests
      • Set Up Mechanics
      • Build Multiplayer Games
    • Game Maker 0.11 Update
    • 0.11 Upgrade Guide
    • 📖Docs
      • Navigate Game Maker Home
      • Manage Experiences
      • Controls & Shortcuts
      • Build Menus
        • Top Bar
          • Gameplay
        • Side Bar
          • Hierarchy
          • Presets
        • Library & Quick Access Bar
        • Grid System & Snap Tool
        • Properties Panel
      • Using Blocks
      • Using Assets & Objects
        • Behaviour & Component Parameters
        • Tags
        • Messages
      • Behaviours
        • NPC - AI Pawns
          • 🔵Citizen
          • 🔵Farmer
          • 🔵Healer
          • 🔵Melee Enemy
          • 🔵Predator
          • 🔵Prey
          • 🔵Soldier
          • 🔴Friendly NPC
        • Movement
          • 🟡Door
          • 🟡Bird
          • 🔴Basic Platform
          • 🔴Advanced Platform
          • 🔴Projectile
          • 🔴Rotate
        • Basic Logic
          • 🔵Message Broadcaster
          • 🟢Combination Code
          • 🟢Asker
          • 🟢Timed Events
          • 🟡Crowd Event
          • 🔴Spawn Point & Avatar's Feature
        • Modifiers
          • 🔵Actor Property Switcher
          • 🔵Multi
          • 🔵Void
          • 🟢Asset Spawner
          • 🟢Replace Asset
        • Visual
          • 🟢Post Process Effects
          • 🟡Weather Switcher
          • 🟡Animated Decoration
      • Components
        • Actions
          • 🟢Climbable
          • 🟢Avatar Teleport
          • 🟢Collectable
          • 🟢Drop
          • 🟢Slide
          • 🟢Speaker
          • 🔴Pickable
        • Triggers
          • 🟢Plant
          • 🟢Switch
          • 🟢Button
          • 🟢Trigger Volume
        • Status
          • 🟢Toggle
          • 🟢Power Up
          • 🔴Avatar Checkpoint
          • 🔴Health
        • Gameplay
          • 🔵Defeat
          • 🔵Victory
          • 🔴Raycast
        • NFT
          • 🟢NFT Sensor
          • 🟢NFT Image Display
          • 🟢Image Display
          • 🔴NFT Details Display
        • Display
          • 🟢Indicator
          • 🟢Rarity VFX
          • 🟡Visual FX
          • 🟡Light
        • Audio
          • 🟡Play Sound
      • Objectives
      • Game Rules
        • Math
        • Time
        • Comparisons
        • Replace Variable Values
        • Game Screen
        • Triggers
        • Events
      • Build Singleplayer & Multiplayer Logic
      • Quality Guidelines
        • Optimisation
        • Testing
        • Playability
      • Templates
    • 📑Creative Guides
      • 📗Game Rules Guide
        • Point Race
        • Collect Points
        • Time Trial
        • Combo
        • Hunger
        • Poison
        • Shop
      • ⚙️Logic Guide
        • Abilities
        • Equipment Based Logic - On Equip / NFT Sensor
        • Doors & Chests
        • Collectibles
        • Text, Quests & Icons
        • Platforms
        • Victory & Defeat
        • Miscellaneous
        • NFT Inspect
        • Fighting
      • 🏞️Experience Guide
        • Tower Defense
        • Horror / Backrooms
        • Solo Platforming
        • Social Platforming
        • Resource Management
        • Cooking Simulator
        • Survival
        • Action / Adventure
        • Night Clubs & Concerts
        • Virtual Home & Architecture
        • NFT Gallery / In-Game Shop
        • Puzzle Games
        • Social Hubs
        • Simulation
      • 🎲Experience Design Techniques
        • Narrative Design
          • Worldbuilding
          • Storyboard
          • Dialogue
        • Art Design
          • Experience Art Concept
          • Asset Curation
          • Blockout Aesthetics
          • Detailing / Dressing
        • 3D Spatial Layout
          • Rough Base Map
          • Greyboxing / Blockout
        • Game Design
          • Ramp of Difficulty
          • Risk & Reward
          • Game Loops & Decisions
    • 🎬Game Production Guide
      • 🟥Concept
      • 🟧Blockout
      • 🟨Logic
      • 🟩Art
      • 🟦Quality Assurance
      • 🟪Polish
      • ⬜Marketing
    • 🧰Publish Experiences
      • Experience Manager
        • Experience Analytics
        • 🧰Experience Page
          • Content Guide
          • Marketing
          • Create an Experience Trailer
          • Player Engagement
        • Map Location
        • Asset Review
        • Access Restrictions
      • Collaborating With Third Parties
      • ❓FAQs: Experience Publishing
    • 🕘Version Notes & Changelogs
      • Game Maker 0.11
        • ❗0.11 Upgrade Guide
      • Game Maker 0.10
      • Game Maker 0.9
      • Game Maker 0.8
      • Game Maker 0.7
    • ❓FAQs: Game Maker
  • VoxEdit
    • ✨Create Assets
    • 🔰Beginners
    • 📖Docs
      • Navigate VoxEdit Home
      • Controls & Shortcuts
      • Panels & Custom Layouts
      • Block
      • Modeler
        • Use Modes & Tools Together
        • Set the Pivot Point
        • Create Frame Assets
      • Animator
        • Build a Rig
        • Create an Animated Asset
        • Use Inverse Kinematics
      • Templates
      • Quality Guidelines
        • Asset Types & Collisions
        • Asset Scale
        • Node Efficiency
        • Pivot Point & Alignment
        • Animation
        • Visual Quality
        • Asset Name & Description
        • Manage Files & Folders
    • 📑Creative Guides
      • 🧍Asset Guide
        • Structures & Landmarks
          • Basic Building: No Entry
          • Animated Building: No Entry
          • Unanimated Building: Player Entry
          • Landmark
          • Building Facade
          • Structure Component Parts
          • Modular Architecture
        • Humanoids & Animals
        • Vehicles
        • Equipment
        • Art: Statues, Paintings
          • Animated Art Screens
          • Statues
          • Kinetic Art Sculptures
          • Paintings
          • Performance Art
        • Furniture
        • Platforms
        • Doors, Gates, and Windows
          • Multi Design Door Asset
        • Chests & Other Animated Interactions
        • Plants, Trees
        • Objects, Machines
        • Signs & Text
        • Obstacles
        • Create Frame Assets
      • 🎨Art Techniques
        • Asset References
        • 3D Design
          • 🧹Need to Simplify?
          • ✂️Trim All Volumes
          • 🟢Optimize with Texture
          • 🟢Curved Edges: Blocky Style
          • 🟡Break Down Objects
          • 🟡Create Smooth Angled Lines
          • 🟡Circular Shapes: Cross Technique
        • Colour, Texture & Depth
          • 🪅Colour Choice & Strategy
          • 🧱Textures & Materials
    • 🧰Upload Assets to Workspaces
    • 🌟Mint & List Assets to Sell
    • 🕘Changelogs
    • 🔓Open Source Assets
    • ❓FAQs: VoxEdit
  • Creators Program
    • 🏗️Builders' Challenge
      • Rules & Eligibility
      • Earnings & Rewards
      • How to Succeed in the Builders' Challenge
      • ❓FAQs: Builders' Challenge
    • ℹ️Creator Contests
    • 🏆Game Jams
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Game Jams
    • 🏆VoxEdit Contests
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Voxel Art Contests
  • General
    • 📚The Sandbox Documentation
    • 🔄Play, Create & Earn
    • 🗺️Map
    • 🛒Marketplace
    • 🗣️Discord Community
    • 🔗Social Networks, News & Blogs
    • The Sandbox Linktree
    • ❓Help & Contact
Powered by GitBook
LogoLogo

INFO

  • Discord
  • Social, News & Blogs
  • Service Status

PLAY

  • Events
  • Map
  • Avatar

CREATE

  • VoxEdit
  • Game Maker
  • Contests

OWN

  • SAND
  • LAND
  • Staking

Copyright ©The Sandbox. All Rights Reserved.

On this page
  • Use Cases:
  • Compare Numbers
  • Compare True/False
  • If/Else
  • Check if number is in range

Was this helpful?

  1. Game Maker
  2. Docs
  3. Game Rules

Comparisons

PreviousTimeNextReplace Variable Values

Last updated 3 months ago

Was this helpful?

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.

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 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.

Compare True/False

Compare True/False

This rule compares the value of the true/false variable selected with another true/false variable or value.

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.

📖