ROOM CONSUMABLES
Room Consumables gives creators the ability to sell things that can be purchased multiple times. They are “consumed” when a player uses it—whether that’s jumping higher for 10 seconds in that fun parkour map or being able to see in the dark during that one scary level. Anything that can be done in CV2 can be triggered by using a consumable.
HOW TO USE THEM
Creating a Consumable
Go to your watch > This Room > Settings > and find the Consumables tab. You can add, edit, and delete your consumables here. To create a consumable, press “ADD CONSUMABLE” and add the Name, Description, Cost and Photo of your consumable.
The price for your consumable can be set in Rec Room Tokens or in a Room Currency. Consumables can also be free.
Only RR+ members can set a Token price that’s not zero
Hooking Up the Circuitry
Now that you’ve created a consumable, let’s hook up the circuits! For this example, we’re going to create a consumable that gives a player a higher jump for 10 seconds.
Spawn in a CV1 Role Chip and rename it to the name of your Consumable (ex: JumpBoost). Go to This Room > Settings > Game Roles and configure to your desired settings. Next, we’ll wire up the CV2 circuitry that will interact with the new role. You’ll need the CV2 chips listed below.
CV2 Chips:
Event Receiver
Constant (Consumable)
Equals
If
Variable (string)
Get Local Player
Player Add Role
Activate Consumable
Delay
Player Remove Role
Deactivate Consumable
Steps:
Configure the Event Receiver to Consumable Used and wire the yellow Consumable port to the Equals chip
Configure the Constant (Consumable) chip to your Consumable (e.g., Jump Boost) and wire it to the Equals chip
From the Equals chip, wire Equals to the Condition of the If chip
Connect the orange exec on the Event Receiver to the If chip
Configure the value on Variable (string)—pictured as RoleName—to the role name (e.g., JumpBoost)
From the If chip, wire the output Then to the input on the Variable (string)
Wire the exec output on Variable (string) to the exec input on Player Add Role
Connect Get Local Player to Target on Player Add Role
Wire the exec output on Player Add Role to the exec input on Activate Consumable
Connect the exec output of Activate Consumable to the Run input on Delay
On the Delay chip, set the Delay (s) and wire After Delay to the input on Deactivate Consumable
Wire the Constant (Consumable) chip to Consumable on both the Activate Consumable chip and Deactivate Consumable chip
On Deactivate Consumable, connect the exec output to the exec input on Player Remove Role
Wire Variable (string) to Value on Player Remove Role
Hook up Get Local Player to Target on Player Remove Role
Press the consumable button to try it out!
When a consumable is used by a player the Event Receiver will kick off our circuit. Using If and Equals chips, we compare the output of the Event Receiver to check which consumable was used. This consumable will then add a role to the local player and then call the Activate Consumable chip to confirm the role was added. This stays active for 10 seconds after which time we remove the player role and call Deactivate Consumable.
Making the Consumable Buyable
Now that we’ve created a consumable and hooked up the circuitry, players need to be able to buy it. You can find a new Prop in your Maker Pen palette called Consumable Store Button. This button allows players to purchase the consumable for the price you set when you created it.
To find the store button, select Open Palette on your Maker Pen menu, then select the Props tab and filter by Dynamic. After you spawn it in, use the Configure tool on your Maker Pen to select which consumable you want to sell. If you still haven’t created a consumable yet, select “Create New Consumable” and fill in the info.
Using the Consumable
Room owners can always purchase their consumables for free. Purchased consumables show up in your backpack under the This Room tab. From here, we can view and use the consumables in our inventory. Clicking Use will send the consumable into an activating state before confirming that it’s Active..
EXAMPLE ROOMS
TIPS
Use one Event Receiver chip if you have multiple consumables. Even if you have a correctly wired Consumable event, if there’s another Event Receiver for consumables that is not hooked up it can give an error. You can use one single event with a sequence of If chips.
Allow players to try the consumable for a small duration of time before purchasing.
Room Currency can be awarded for using Room Consumables! This can be useful for incentivizing players to use consumables (i.e, they gain XP by using them) or just for the fun of it.
Get Connected
Stay informed! Find more info on Community Commerce events and programs by joining the Creator Hub Discord. Find more info under the Community Commerce channels section.