How do you use costumes to affect what people can do in a Rec Room custom room?
Solution 1:
To affect what people can pickup, you can use roles. Create a role in the room by placing down a new "Role" chip. Hit configure on that chip, give it a good name, and then edit the role. You'll be presented with a variety of options. You can allow this role to fly, adjust voice roll-off, change walk speed or teleport distance, etc. For affecting what weapons they can pickup, you should use the pickup restrictions. Simply add the object tag of the weapon you'd like them to pickup, and configure the weapon to also have that tag, then set it to "Allow Tags". Once you do that, players with that role will only be able to pickup objects with that tag. It might be worth configuring the "Everyone" role to a "Restrict All" pickup restriction. This will make it so that nobody without that role will be able to pickup the weapon.
Once you've setup your roles, you'll need a way to add and remove them. Costumes have a red pin on them that is visible when circuits are visible. The red pin outputs a -1 when there are no players wearing it. If someone is wearing the costume, then the red pin outputs the Player ID of the one wearing it. You can use that pin to do what you're describing. There are two ways that you can achieve this depending on what constraints you're able to meet.
Multiple players may have the role at the same time
When multiple players can have the role at the same time, you need to have a system that remembers the previous wearer and removes the role directly from them. The following circuit is the minimal way to do that with the fewest chips.
In the photo, the role-mapper chip on top is set to add a role, and the role-mapper chip on the bottom is set to remove that role. Putting on the costume will give the wearer the role and when the take off the costume it will remove that role.
The role is unique and only one player can have it at a time.
If only one player in the whole room can have a certain role at a given time, then the circuit can be reduced further. The following diagram shows one way to achieve this:
In this circuit, the role-mapper chip at the top is configured to add a role and the role-mapper chip at the bottom is configured to remove that role.
If you're struggling for ink in your room and wish to pack a lot of these into a circuit board, you may desire a circuit with fewer than 3 connections to the costume. The following circuit needs only one connection to the costume but takes 2 ticks to fully reach the desired outcome.
As with the other circuits, the role-mapper chip at the top is set to add a role and the role-mapper chip at the bottom is set to remove that role. The selector chip is configured as follows: