Equipment Based Logic - On Equip / NFT Sensor
Explore creative possibilities to trigger logic with equipment using the Collectable component's On Equip feature or NFT Sensor.
Last updated
Explore creative possibilities to trigger logic with equipment using the Collectable component's On Equip feature or NFT Sensor.
Last updated
Copyright © 2012- 2023 The Sandbox. All Rights Reserved.
EQUIPMENT: ASSETS vs NFTs
Equipment provided in game must be collected and worn to send an On Equip message.
To trigger logic in this guide with NFTs a player owns (which offers exclusive gameplay):
Trigger with NFT Sensor component's Success message instead of On Equip
Modify the narrative to be about owning rather than equipping items found in game
HOW IT WORKS
Creators: 1. Apply a Collectable component to equipment to see On Equip options. 2. Set a Message On Equip (what to send). 3. Set Equipment Broadcast Type (where to send it). 4. Set the On Equip message as the Message Required in logic you want to trigger.
Players:
1. Collect the equipment item.
2. Press I
to open your Inventory.
3. Select the equipment and press E
to equip, or simply double click it.
4. Enjoy triggered outcomes!
NO UNEQUIP MESSAGE Currently there is no "On Unequip" message option. Design your Experience logic to avoid broken immersion if the player removes equipment, which WILL NOT send a message.
Beginning equipment (must be collected, not applied to avatars at start via Spawn Point)
Receive from an NPC (e.g., for a quest)
Discover via hints and exploration
Buy/trade/craft with resources
Item Drop when an enemy dies
One equipment item required
Communicates one time with other logic (e.g., launch a quest)
One or multiple equipment
Communicates many times check if item(s) were ever equipped (e.g., new skill unlocked)
Simple or Complex Trigger
Simple or Complex Trigger
Enhance Player with Equipment Attributes (Power, Speed, Defense)
Trigger Power Ups (Speed, Attack Power, Damage Resistance, Health, Oxygen)
Once, Repeated (for a time), Forever, Key Input with Cooldown
Wear equipment to make NPCs recognise player identity, unlocking dialogue and gameplay.
Use cases: Reveal player identity in narrative, access gameplay under disguise, etc.
Start: Initially, NPCs refuse to talk to the player or hint at needed equipment.
Gameplay Steps
Get Equipment: Discover via hints/exploration or receive from an NPC for a quest
Hint: Learn what the equipment is/does and how to equip it
Equip Item(s): Open Inventory and equip required assets (one or multiple items)
Hint: Return to the NPC and talk again
Outcome: Trigger unlocked dialogue. This could be set up to grant access to a restricted area, open a door, offer a new quest, etc.
Wear equipment to unlock information that will trigger a quest to begin.
Use cases: Puzzles, mysteries, translation, etc.
Start: When the player interacts with something interesting, they learn that they are unable to read/understand it without certain equipment.
Gameplay Steps
Get Equipment: Discover via hints/exploration or buy/trade/craft
Hint: Learn what the item is/does and how to equip it
Equip Item(s): Open Inventory and equip the asset
Hint: Return to try interacting with the original item
Outcome: The equipment allowed the player to complete or read some text, narrative, small puzzle, or map, so a quest is unlocked. This may lead the player to a hidden location or unlock other gameplay.
Wear equipment to unlock new ways to interact with items or engage with the game world.
Use cases: Use tools for specified actions, carry heavy or special items, etc.
In multiplayer Experiences, each player can have a unique gameplay experience based on the equipment they find and use.
Start: When the player interacts with an object, they learn that they need certain equipment to interact with the item to complete a task.
Gameplay Steps
Get Equipment: Discover via hints/exploration, buy/trade/craft, or receive from an NPC
Hint: Learn what the item is/does and how to equip it
Equip: Open Inventory and equip the asset
Hint: Learn that the equipment has unlocked what needs to be done using it
Outcome: The player may now complete a task using the equipment. This may a one time action, a repeated task, or a series of tasks as part of a process (e.g., manufacturing a product).
It may also lead to buying equipment that is more powerful/faster to complete the task/process, which is common in a Resource Management game.
Wear equipment to prevent detection by enemies or a state where significant harm/death would occur.
Use cases: Avoid damage from environmental dangers (gas trap, radioactive area, deadly rainstorm, pass through fire, etc), sneak, wear a disguise, etc.
Start: The player sees or learns of a dangerous hazard or obstacle to overcome and gets visual clues to figure out what equipment is needed. Seeing health drained or being spotted by a low level monster players can survive against are natural ways to explain the situation.
Gameplay Steps
Get Equipment: Beginning equipment (collectable, not via Spawn Point), discover via hints/exploration, given by an NPC, or buy/trade/craft
Hint: Learn that the item prevents harm/death or detection and how to equip it.
Equip: Open Inventory and equip the asset
Hint: Learn that the player is now protected and can proceed safely.
Outcome: The player can safely overcome the hazard and continue their quest or adventure. This could lead to access to new areas to escape to a safe place.
Wear equipment to swap between two different states.
Use cases: Change view, world state, gameplay state, etc. to access new puzzles, find clues, trigger new quests, access hidden areas, etc.
Start: The player has no way of progressing on a quest, in the game world, etc. and are hinted that they need specific equipment to switch between different states.
Gameplay Steps
Get Equipment: Discover via hints/exploration, given by an NPC, or buy/trade/craft
Hint: Learn that the equipment toggles between states and how to equip it
Equip: Open Inventory and equip the asset
Hint: A pop-up message or NPC explains which keys/mouse buttons trigger the different states (view, world, gameplay, etc.)
Outcome: The player can now explore previously inaccessible gameplay to complete new quests, hunt enemies, reveal clues/items, find new areas, open doors, trigger platforms, etc.
Wear unique equipment that is designed to modify the player's base stats to increase performance.
Use cases: Power to deal more attack damage, Defense to reduce damage when attacked, Speed to increase movement rate, or any combination.
BUY OR CREATE EQUIPMENT You can buy and test equipment NFTs from the Marketplace or create custom assets with VoxEdit for use in your own Experience without minting.
Start: The player discovers equipment which has certain Attributes. This may not be known until it is equipped.
Gameplay Notes
Equipment with Attributes can be integrated into logic the same way as common assets.
Be sure to emphasize the strengths of the equipment to the player.
Gradually provide new equipment with stronger attributes to signify player growth.
Consider how to balance gameplay so the game can be completed with default equipment or so the player will definitely be able to use stronger equipment if difficulty increases.
Wear equipment to dynamically cause a negative effect on the player, prompting real time reaction.
Risk & Reward: helpful items have a negative effect, items have only positive or negative effect, etc.
Use cases: infection/poison, lost vision, hallucinations, confusion, intense hunger, blocked skill, etc.
CUES & COHESIVENESS
Match the tone of your world well with the outcomes players may experience and provide visual cues (e.g., curse: glowing VFX, infection: rusty blade). This makes players feel safe to explore when risk is low or make choices strategically when risk is high.
Start: The player comes across equipment that they can collect, pick up, etc. without negative effect. However, there may be some indication that it could be dangerous to wear. If the player never equips the item, the negative effect remains a mystery.
Gameplay Steps
Hint: Visual cues (e.g., VFX) or NPC dialogue hint that equipment is harmful, but powerful. Equipment with no cues or benefit only suit difficult games with similarly beneficial items. Note: If there's no way to remove the effect, communicate it clearly and make the equipment's benefit more powerful as a worthy trade-off. Examples: - Drains health, but has a very high Power Attribute for attacks - Reduces vision, but heightens player senses to detect enemies sooner - Injures the player once, but allows them to heal teammates for a limited time
Get Equipment: Collect, buy, etc. if choosing to risk a negative effect
Equip: At any time, the player may open the Inventory and equip the item
Alert: The player notices a change via the HUD (health, poison, etc), spawned enemy, dialogue indicating the change, Post Process Effects (camera), etc.
Hint (if it can be removed): Note: Unequipping can not send a message to trigger this) Examples: - Kill spawned enemy - Find a potion - Equip a holy item - Wear a full set of cursed equipment to cancel it out
Outcome: The player may solve the issue and continue playing normally, or the effect may continue throughout the rest of the game. The game logic could also be designed so the player can re-equip the item (in this case, a timer should be used to cancel the effects).
Wear equipment to trigger buffs and debuffs on the player once, infinitely, or when triggered by a key or mouse input.
Use cases:
Health or Oxygen meters: restore to maximum or reduce
Speed (movement), Attack Power, or Damage Resistance: increase/decrease for a short time
Set up logic to trigger buffs/debuffs on a timer for extended use needs
See Power Up documentation for detailed use cases. Anything can send Power Up special messages. Use a negative number in the message argument to set a debuff.
Start: The player may struggle to complete a task quickly enough or fully due to health hazards, not enough oxygen, not enough speed to finish in time or jump far enough, or enemies that have a large amount of health or very high attack power. They may even be hinted that equipping a certain item will activate a skill to use on command (with cooldown).
Gameplay Steps
Get Equipment: Discover via hints/exploration, given by an NPC, item drop from killing an enemy, or buy/trade/craft Make the cost of the equipment higher to balance out longer term benefits (earn from a hard quest, spend more to buy/trade/craft it, kill a stronger enemy to drop it, etc)
Hint: Learn the benefit of equipping the item (which may be temporary or long term) and how to equip it, and use different Visual FX to signal how useful or valuable it is
Equip: Open Inventory and equip the asset
Hint: The effects of triggering Power Ups are built into Game Maker with updated health/oxygen meters or visual effects for speed, attack power, and damage resistance, but the player will benefit from a hint of what key to press and how long the cooldown period is if it has long term use with player input
Outcome: The player proceeds with the benefit of the Power Up, but speed, attack power, and damage resistance may have varied durations and triggers.
Wear equipment to trigger a Crowd Event for social interaction or cooperative play.
Use cases: Dance party/flash mob, complete a puzzle, etc.
Start: In a multiplayer game, the player learns (through a quest, hint, etc.) that a special item (e.g., dancing shoes) will let them start a dance or complete an action requiring emotes.
Gameplay Steps
Get Equipment: Complete a challenge (e.g., parkour) or quest before other players to unlock NPC dialogue to get the item, discover it in a hidden place, etc.
Hint: Learn what the equipment can trigger and how to equip it
Equipment: Open Inventory and equip the item
(Optional): The player learns another item is needed to trigger the Crowd Event and completes the necessary steps to get it
Outcome: Players follow the flow of the Crowd Event to complete it.
Wear equipment (optional: also pick up a related item) to enable unique interactions or unlock related skills (singleplayer or multiplayer).
Use cases: Soft class system (e.g., mage, medic, scientist), special team role (e.g., leader, goalie), technological era reached (e.g., iron age, medieval ages, industrial age), social game roles, etc.
Start: Players are informed to wear a full set of equipment to unlock a unique role and skills.
Gameplay Steps
Get Equipment: At game start or between levels, players find items in storage, a shop, etc.
Hint: Learn player roles depending on which each equipment set is worn and how to wear it
Equip: Open Inventory and equip the set of items
Hint: Learn how to use skills related to the role accepted (which may include key inputs) and learn how to get a pickable item that may be needed (e.g., to shoot projectiles)
(Optional): The player picks up an needed item (e.g., blaze staff) to unlock full skills
Outcome: The player can now use skills unique to their role. Other equipment may later be available to grow the player's skills. They could even change to a different role during the game.
Complete minor events to activate an equipment item's usefulness.
Use cases: Recharge, repair, upgrade, restore magical power, etc.
Start: The player learns they must complete multiple events to activate and use equipment.
Gameplay Steps
Get Equipment: Discover via hints/exploration, given by an NPC, or buy/trade/craft, dropped from killing an enemy, etc.
Hint: Learn the equipment's use and what events must be completed to activate it
Event(s): Carry out all required actions to activate the equipment, which may include setting it down, gathering materials, using a workbench, etc.
Equip: Collect the equipment again if necessary, then open Inventory and equip the item
Hint: Learn how to use the equipment and what to do if the equipment's use eventually ends (e.g., battery needs charging)
(Optional): If the player must repeat the events to re-activate the equipment later, trigger a notification when the equipment's effects expire with simplified instructions to restore it
Outcome: The player may use the equipment's benefit for the rest of the game, or they may use it for short periods and then re-activate it in cycles.
Set up a unique one-time trigger per event:
ℹ️ An event can be any object or Rules logic (e.g., equipped items, consumed items, quick steps in a process, etc.). ⚠️Currently, Quests can not be counted.
Each event needs to trigger its own Message Broadcaster with a unique message. Every Message Broadcaster will send the message Event.Triggered
to Rules (Broadcast Only Once toggle set to True).
Add a rule. Set its Required Message by creating the message Events.SetGoal
with arguments (click "Edit Argument," choose Number(Integer) as the type, and label it "Total Required"). This lets you set the goal anytime during play and reuse.
Add a rule that requires the message Event.Triggered
. Set it to add 1 to the Event Counter variable and save the result as that variable. Send a message out Events.Check
. This tests to see if the goal is met each time an event is added.
Add a rule that requires the Events.Check
message sent from the Math rule. Set it to compare the Event Counter variable to the Event Goal variable, with the condition set to be equal (compare once). Set the Message to Send (Out) as Events.Done
. When the counter equals the goal, the message will be sent.
Add a rule that requires the Events.CounterReset
message. Set it to modify the Event Counter variable to be a fixed value of 0.
Asker behaviour - hint that the player must wear the right item(s) to prove their identity or be ready for something.
Toggle OFF with Events.Done
(multiple items) or On Equip message (one item).
Asker behaviour - informs player to proceed since they are wearing correct items.
Toggle ON with Events.Done
(multiple items) or On Equip message (one item). Initial state False.
Collectable component - On Equip message (one item), Collect message.
Hint: Collect message triggers an Asker or telling the player to equip the item(s) and how.
Hint: On Equip message (one item) or Events.Done
(multiple items) triggers Asker or that reminds the player to return to the NPC (for unlocked dialogue).
Asker behaviour - hint that the player must equip certain items to read/understand something for a quest.
Toggle OFF with Events.Done
(multiple items) or On Equip message (one item).
Asker behaviour - informs player the equipped item contains the information they needed, makes it possible to understand what they were trying to read, etc.
Toggle ON with Events.Done
(multiple items) or On Equip message (one item). Initial state False.
Collectable component - On Equip message (one item), Collect message.
Trigger Volume in front of the object the player is attempting to read/understand sends Events.Check
to Rules or All to test if equipment has been worn.
Hint: Collect message triggers an Asker or telling the player to equip the item(s) and how.
Hint: On Equip message (one item) or Events.Done
(multiple items) triggers Asker or that reminds the player to return to the item that couldn't be read.
Object: Upon avatar detection or interaction, a Speaker component sends a message to a that informs the player what equipment is needed to interact with the object and where/how to get it.
Equipment: Collectable component - On Equip message (one item), Collect message. Use [Event Count & Check] logic to be able to trigger new interactions repeatedly.
Hint: Collect message triggers a informing player how to equip the item and what to do with it.
Spawn Items Upon Interaction (e.g., fruit): Asset Spawner behaviour with Toggle ON from On Equip message, triggered to spawn with Interact
message.
Polish (options): Instead of Asset Spawner, use Replace Asset triggered by the On Equip message. Replace with an identical asset with a Drop component to drop a preset of objects upon interaction:
Collect objects, count resources: Collectable component with Collect message, number (integer) variable for item count, rule to display variable, rule adds 1 to the variable when Collect message is received.
Spawn Items to Use: Replace Asset behaviour triggered by On Equip message that replaces with a preset:
Carry/Detect: Pickable with tag.
Shoot Projectile: Pickable with child Asset Spawner triggered by On Equip, which spawns Projectile triggered by a .
Set Spawned Items to Trigger Logic When Destroyed: Use Asset Spawner to spawn an object with a Health component, set up a way to destroy it, and trigger other logic with its Message on Death.
Collectable component - On Equip message (one item), Collect message.
Hint: Use Asker or to hint what the equipment does and how to put it on once the player has collected it (trigger with the Collect message).
Place a logic asset with 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).
Barrier: Block access with an invisible asset and trigger a hint. Set collisions to change using Actor Property Switcher with On Equip message (or Events.Done
if using [Event Count & Check] logic).
Checkpoint: Detect the player, trigger a hint, and activate Avatar Checkpoint.
Hint: Asker or hint for needed equipment and how to get it.
For each enemy, applyReplace Asset behaviour triggered by the Enter message. Set to replace with a preset of the same asset that has Melee Enemy behaviour. Either add many enemies or enemies with a very high amount of Health so the player must use equipment to survive.
Check if Equipped:
Create a logic asset with Message Broadcaster behaviour to send Events.Check
to Rules forever with a Delay Between Broadcasts of 1 second. Set it to Wait Before Broadcast with the Enter message required. Add a Toggle component that turns OFF with the message Events.Done
and an Initial Behaviour State set as True. If the player enters the Trigger Volume, the broadcaster checks the Rules to see if required items have been equipped.
Reduce Player Health if Not Equipped:
Add a rule triggered by the message Events.Check
. Set it to compare the Event Counter variable to be less than the Event Goal. Set the Message to Send as Health
with a large negative argument value. If the player hasn't equipped the required items yet, this rule will reduce player health when triggered by the message broadcaster every 1 second.
Hint: Use Asker or to hint at what the equipment does, and how to put it on once collected it.
Add a or rule for each state you wish to trigger. Set each rule's message Out as the Events.Check
message needed. Set up your outcome logic to receive the Events.Done
message needed.
Change time/weather/world lighting: Weather Switcher, / Visual FX, etc
Reveal secrets/change player view: Post Process Effects, Visual FX, Light, etc.
Spawn/kill assets: Asset Spawner (spawn presets), Plant (to destroy), etc.
Change asset visibility/collisions (keeps logic): Actor Property Switcher
Toggle any behavior on/off: Toggle
Switch between two logic states (sends a message per state): Switch
Collectable component - On Equip message (one item), Collect message.
Hint: Use Asker or to hint what risks and benefits the equipment has and how to put it on once the player has collected it (trigger with the Collect message).
Confusion Use the On Equip message to trigger various logic to indicate the player's perception of reality is inaccurate, such as Post Process Effects, Visual FX, making previously stationary assets move with Basic Platform behaviour, etc.
Set up a Message Broadcaster that sends the message Health
with a negative argument value, a Broadcast Duration set to Forever and a Delay Between Broadcasts set to 1 second.
Add a Togglecomponent with Initial Behaviour State toggle set to False with the On Equip message to turn it ON and a message of your choice to turn it OFF (the solution).
In Game Rules, create a time variable. Add a rule to count down from 60 seconds. Add a (any amount needed) to check the timer variable against a fixed value, such as 50 seconds, and send a message Out. Add subtle visual cues like changed vision with Post Process Effects and Visual FX.
Use Post Process Effects behaviour to modify the player camera and later restore player vision back to normal.
Collectable component - On Equip message (one item), Collect message.
Hint: Use Asker or to hint at what buff the equipment offers, how long it lasts, and how to put it on once collected it (trigger with the Collect message).
Trigger Once (simple):
In the rule system, add a rule. Set On Equip as the Required Message (or Events.Done
if using [Event Count & Check] logic). Send a Power Up message Out. Set the message argument to customise the effect (use a negative number to apply a debuff).
Set up logic for a one time trigger. Create a time variable. Add a rule to a desired loop time. Set the Power Up message you chose as the Required Message and send the On Equip message Out (or Events.Done
if using [Event Count & Check] logic) to trigger a loop.
Modify the Key Input rule to use a key of your choice or replace with a .
Cancel: Add a rule to subtract 1 from the Event Counter variable used in the [Event Count & Check] setup (trigger with any message).
Collectable component - On Equip message (one item), Collect message.
Hint: Use Asker or to hint at what buff the equipment offers, how long it lasts, and how to put it on once collected it (trigger with the Collect message).
Anywhere: Toggle ON a Crowd Event with On Equip message.
Specific location: Send the On Equip message to spawn a Trigger Volume that will trigger the Crowd Event with a message sent when the player enters the volume.
Create a Pickable asset with custom logic. Set a Message on Picked.
Set a logic asset as the child of the Pickable asset and apply Crowd Event behaviour and set a Crowd Event Message Required.
Spawn pickable preset: Set an Asset Spawner to spawn the preset with Required Message as Events.Done
.
Add a rule with Required Message as Message on Picked.
Add a rule with Required Message Events.Done
. Set it to compare the True/False variable to be equal to True. Set message Out as Crowd Event message.
Create a or rule to send a Events.Check
message to check that the event counting for equipment is done.
Pickable Check: Find the rule that tracks equipped item count and change its message Out to the Events.Check
message that checks the Pickable event status.
Hint: Use Asker or to hint at what the equipment can do and how to equip it (trigger with an equipment item's Collect message).
Message on Equip (GM 0.9)
A message can be sent to All logic, the player (Self), or the Rules system when the player equips a collectable equipment asset.
Choose Self to send the message to the player who collected and equipped the item.