How To Use Equipment To Create Great Games, Part 5: Create Class-Based Systems

The Sandbox
6 min readAug 16, 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 create class-based systems, allowing players to unlock unique skills or roles through the equipment they wear.

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 Create Class-Based Systems

In role-playing games, players can create or choose a class they would like to play for the duration of the game. Players might opt for a stealth class so they can sneak up on enemies undetected, or perhaps they choose to be a brute who gets more points using a broadsword but can’t surprise foes.

With On-Equip, you can create a similar class system using equipment. For instance, equipping a set of magical items might transform a player into a mage, granting them spellcasting abilities. Alternatively, a player could become a medic by equipping medical gear and unlocking healing abilities to support their team. This mechanic allows for a dynamic and customizable gameplay experience, where players can choose their roles based on the equipment they find or acquire.

How This Could Appear in Your Game or Experience

Imagine a player in a medieval-themed RPG. You come across a set of ancient mage robes, a staff, and a mystical amulet. Upon equipping these items, a pop-up appears explaining that you have unlocked the Mage class, with new abilities like casting fireballs or summoning protective barriers. You can now use these skills to overcome challenges or enemies that would have been otherwise difficult to face. The game might even allow you to switch between classes so that they may face different challenges as the game progresses.

With On-Equip, you can make this possible in any game you create!

How to Implement

Using equipment to create class-based systems requires careful planning. In this example, we will require a collectible item to be equipped to unlock what a pickable item can do.

First, place the equipment, such as mage robes or an amulet, with a Collectable component that will send an On Equip message.

Next, place another item for the player to pick up, such as the Burning Victory Staff. It does not need to be equipment, but an equipment asset usually fits class scenarios well. The item needs to be set up as pickable, and we also need to create a logic asset with Asset Spawner behavior and set it up as its child object. Place the spawner behavior at the front of the staff where you want the fireball to fire from. Open the hierarchy on the left side panel. Find the staff and logic asset, then drag and drop the logic asset on top of the staff to set the logic asset as a child of the staff. If done correctly, when you move the staff, the logic asset with the spawner behavior should also move with it.

Create a fireball asset or any asset you want and put a projectile behavior on. Set it up to destroy on collision and fire at the start of the experience. No message setup is needed. You can also send a message on collision with an object, such as a health message with a negative value to damage the enemy.

Add a speaker to the fireball asset, ensuring it is set to detect an entity. Change the detection range to its maximum and enable the “face entity” toggle. Change the detection to a specific tag and use a memorable tag for the enemy. Save this as a preset and give it a name. Go back to the spawner and toggle the Use Preset option, selecting the fireball as the asset to fire. Change the spawn message to something memorable. Toggle Only Once and adjust the seconds between spawns as needed. Then, set up a variable in the rule system to track if the mage outfit has been equipped. Name this variable as desired. Add a Math rule that will add “1” to the variable if the On-Equip message is received, indicating the item has been equipped.

Set up a compare value to check if the correct number of items is equipped. Assign a message like “check fire” to trigger this rule. If the variable equals “1,” send the message that triggers the spawner to fire. Add the Key Input rule and set it to your preferred setting. Change the message to the “check fire” message that the compare value needs. This setup will check when the player presses the fire key to ensure they have the equipment. If they do, it fires the fireball; if not, nothing will happen.

Activating Equipment for Advanced Gameplay

In some games, you might want to add an extra layer of complexity by requiring players to activate their equipment before it becomes fully functional. This could involve recharging the magic Burning Victory Staff, repairing damaged armor, or upgrading a tool to make it more effective.

For example, a player might need to gather materials to recharge a staff’s magical power or use a workbench to repair a broken sword. Once the activation process is complete, the player can equip the item and use its enhanced abilities.

Potential Uses for Class-Based Systems

There are many ways to implement class-based systems using On-Equip. In a sci-fi game, players could equip different types of gear to take on roles like engineer, mage, or soldier, each with unique abilities and tasks. In a survival game, players might find gear that allows them to specialize in tasks like foraging, building, or combat.

You could create a multiplayer game that includes a horde mode game where endless waves of enemies keep coming at you. You can equip the mage outfit and pick up your staff. Using key presses, you can fire a fireball, shoot lightning, and hit an area with ice. Your friends can take on roles such as healers, damage dealers, and tanks. Together, you must survive wave after wave of enemies and see how long you can last.

In a social game, you take on the role of doctor. Your job is to go around healing people and reviving them whenever possible. Your friends have taken on other roles, like a police officer or delivery driver. Together, you need to earn money and collectively pay your rent; otherwise, the landlord will kick you out, causing you to lose the game.

These are just a few of the options for using on-equip to create a class-based system. What will you create?

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 dynamic class system, 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 VI: Using Equipment to Create Dynamic Player Experiences.

--

--