This page describes how to add new permissions into the game
To add a new permission into the game go to Assets/Content/Data/Traits/Identification/Permissions, right click and go Create -> Inventory -> Traits -> Permission, just name it accordingly.
To add the permission into a role, just add it to the Role Data's permission list
This permission can be checked inside of a script throught the Inventory class, by using the HasPermission function.
For example, the Security Locker currently checks for a Security permission to be both locked and unlocked. the Unlock Locker interaction checks for the permission by getting the player's inventory:
This page describes how to add a new role into the game
The first thing you need to do to create a new role is to go to Assets/Content/Data/Roles, either duplicate an existing role or right click and go Create -> Roles -> RoleData, name both the file and the "Role name" variable as the name of the role.
Role Name: the name of the role PDA Prefab: the PDA prefab that will be spawned in the player's inventory ID Card Prefab: the ID Card prefab that will be spawned inside the PDA Permissions: the list of permissions the ID Card will have. Loadout: the loadout that will populate the player's inventory at round start.
To create a new loadout go to Assets/Content/Data/Roles/Loadouts, right click and go Create -> Roles -> Loadout, there choose the items that will spawn in the player's inventory.
Check which slots will have items and then set which items will be spawned in the droplist that will show, remember that these items have to be registed in the AssetDatabase for them to appear in the droplist.
Now go to the StartingRoles asset in Assets/Content/Data/Roles and add the role to the list.
Drag the Role data into the slot and set how many players can play that role per round, setting it to zero means there is no limit.
Remember that it is possible to create ID Cards with permissions inside the game, which would effectively allow more people to play the same role that what is initially allowed, a player's role is dictated solely by their ID Card, which can be stolen or dumped.
Roles and loadouts system. How to set them up.
For design documentation on this system, use the link below.
Roles are the jobs players get at the start of a round, they decide what the player will spawn with and what permissions they will have in their ID Cards.
Permission Checking ID Cards have a set of permissions that allow you to have access to restricted areas or open locked containers.
Loadouts Loadouts set what each role spawns with, things like outfits and starting items, like a baton for a security officer.
Role Selection The system chooses players's roles the moment they join the lobby, currently a single player is chosen as Security and every other player gets the Assistant role.