How to Use Equipment to Create Great Games, Part 6: Avoid Environmental Hazards

The Sandbox
5 min readSep 20, 2024

--

We’re breaking down some of the many uses of the On-Equip feature in this 11-part series.

Welcome back to our series chronicling the many uses of The Sandbox Game Maker’s “On-Equip” feature.

If you’re joining us for the first time, On-Equip is a versatile tool built into the Collectable Component that enables creators to enhance player experiences through interactive gameplay mechanics. On-Equip allows items, when equipped by players, to trigger specific actions or effects within the game world. By strategically incorporating On-Equip mechanics, creators can introduce new layers of interactivity and engagement.

Today, we’re examining how On-Equip can be used to avoid environmental hazards.

Ready to learn more? Update to the latest version of Game Maker and prepare to see what’s possible with On-Equip!

This article is part four of an 11-part series about using On-Equip, to read more, click one of the links below:

  1. Part 1: NPC Interactions
  2. Part 2: Toggling Between States
  3. Part 3: Hex or Impede Players
  4. Part 4: Trigger Unique Interactions
  5. Part 5: Create Class-Based Systems

Using Equipment to Avoid Environmental Hazards

In many game genres, equipping the right gear is essential to avoiding harm or detection in dangerous environments.

In the popular Fallout games, for instance, players must often use unique suits that can withstand radiation when walking through certain areas or entering a body of water. In some shooter games, a mask must be worn to avoid damage from poison gas. These are just a few examples of how equipment can be used to avoid environmental hazards.

How This Could Appear in Your Game or Experience

Picture a player exploring a dungeon when they suddenly begin to lose health from an invisible gas trap. There are visual clues, such as a flickering health bar, to indicate that they’re in danger. They quickly discover that they need a gas mask to pass through safely. Perhaps you will use the ​​Origin Dragon Crest Helm for this purpose since it already has a defense rating of 98 attribute points. You place the item in the game.

The player can then find the helm through hints or exploration, receive it from an NPC, or buy it from a shop, depending on what you decide. Once the mask is acquired, the game provides instructions on how to equip it, either through an NPC or a pop-up message. The player can now safely overcome the hazard and continue their quest or adventure.

How to Implement

To build this type of feature, you will first need to place the equipment the player needs to collect. Set an On Equip message in the Collectable component as “Event.Triggered.”

Next, you’ll set up rules to count equipped items and trigger player safety. Create a number variable named Event Counter with a value of 0. Add a Math rule that requires the message “Event.Triggered.” Set it to add 1 to the Event Counter variable and save the results over that variable. Set the message out as “Events.Check.” Add a Compare Numbers rule that requires the message “Events.Check” to compare the Event Counter variable with the fixed value 1 and send a message “Events.Done.” Each time equipment is worn, the compare rule will be triggered to test if the required total number of equipment (the fixed value) is met to trigger safe conditions for the player when true. This method can work with a variety of setups and be modified to require multiple equipment to make the player safe.

To make it clear to the player that the equipment will help them, you can use an Asker prompt or Popup Window to hint at what the equipment does and how to put it on once the player has collected it. This can be triggered by the Collect message sent by the equipment.

Set up a player detection area by placing a logic asset with a Trigger Volume component. Set the detection area and Enter message. Add a Toggle component that turns OFF with On-Equip as Message to Destroy (or Events.Done if using Event Count & Check logic).

Now, you’ll need to set up a hint of danger so the player is aware when they are approaching an environmental hazard. Set up a barrier to block access with an invisible asset and trigger a hint. Set collisions to change using Actor Property Switcher with the On-Equip message. If you prefer not to use a barrier so gameplay will flow more naturally, allow the player to experience death from the hazard and respawn at the entry of that area to make a different choice. In this case, set up an Avatar Checkpoint to activate when the player enters the danger zone and set the respawn location outside the entry of it.

Potential Uses for Avoiding Environmental Hazards

There are many options for implementing this feature in the games you are building. One example might include sneaking around giants or another large enemy you want to avoid fighting. Say you are lost in a world with enemies that have an appetite for humans. You must sneak around, hide, and find equipment to get out alive. You can search for and equip items to better hide, blend in, and sneak around undetected. You must try and find an escape route before the time runs out and you are trapped in the enemy’s den forever.

Or, perhaps you have created a post-apocalyptic world where radiation leaks are all around the area, and you have the unfortunate task of trying to clean up the waste. Equip your suit and explore the world to clean up as much as you can before your suit runs out of protection and leaves you open to dangerous radiation poisoning. Gather waste and other junk to sell and buy better-upgraded suits to last longer and take on more extreme versions of the wasteland world you find yourself in.

These are just a few of the many options available to you as you implement On-Equip to avoid environmental hazards.

Unleash Your Creativity with On-Equip

By strategically utilizing On-Equip mechanics, game designers can introduce new layers of interactivity and immersion into their creations. Whether enhancing the realism of a role-playing game, adding cooperative components to a social experience, or creating a believable world, On-Equip mechanics enrich the gameplay experience and deepen player involvement.

Get started today and discover the transformative potential of the On-Equip feature in shaping your gaming experiences in The Sandbox. Stay tuned for Part VII: Using Equipment to Trigger Emotes and Crowd Events.

--

--