Shared Dice
Shared Dice is a Foundry VTT module that allows Game Masters to give players various types of 'Shared Dice'. These dice act as expendable resources that players can use or share with each other. Each action involving a shared die can trigger a customizable chat message, featuring keywords that are automatically replaced with relevant information.
Features
- Multiple Dice Types: Define several distinct types of shared dice, each with its own name, image, usage limit, and chat message templates.
- Management: Users with editing permissions can easily add or remove dice directly through the player list interface.
- Usage: Players can expend their own dice or gift dice from their own pool to other players.
- Customizable Chat Messages: Tailor the chat messages for actions like adding, removing, using, or gifting dice. Messages are configured per dice type and per action.
- Dynamic UI: Intelligently handles large number of different dice types by collapsing additional dice types beyond the configured display count into an expandable overflow section in the player list. The sort order and the number of displayed dice can be configured via settings.
Installation
This module can be installed from the Foundry VTT module browser or via manifest url from the latest release: https://github.com/belodri/shareddice/releases/latest/download/module.json
Configuration
The primary configuration for this module involves defining the different Dice Types you want to use in your game. This is done through the module's settings menu, accessible only to GMs. Within this menu, you can create new dice types, as well as configure or delete existing ones. To save your changes, click the 'Save' button at the bottom of the menu. If you have deleted any dice types, a confirmation prompt will appear before these deletions are saved.
Dice Type Configuration
For each Dice Type, you can configure the following properties:
- Name: The display name for this type of die (e.g., "Inspiration" or "Hero Point"). This is used in UI elements and chat messages via the
[$dieName]
placeholder. - Image: An icon to represent the die in the UI.
- Enabled: A checkbox to control if this dice type is currently active. Disabled dice are hidden and not usable but their data is preserved and they can be reenabled at any time. This allows you to temporarily remove a dice type without losing player counts or its specific configurations.
- Limit: The maximum number of this dice type a user can hold. Can be set to 0 to allow unlimited dice.
- Gift Toggle: Controls if users are allowed to gift their own uses of this dice type to others.
- Sort Priority: Determines the order in which dice are displayed on the player list. Dice with a higher priority are displayed closer to the user names.
- Message Templates: For each action (
add
,remove
,use
,gift
), you can define a chat message template. If a template is left blank, no chat message will be sent for that specific action and dice type. - Add/Remove Permissions: Allows GMs to adjust the permissions required to add or remove dice of this dice type for the other user roles (player, trusted player, and assistant gamemaster) using the following options:
- None: These users cannot add or remove this dice type.
- Self Only: These users can add or remove this dice type for themselves but not for other users.
- All Users: Allows adding and removing of this dice type for themselves and for other users.
Chat Message Placeholders
When configuring message templates for a given dice type, you can use the following placeholders. They will be automatically replaced with the relevant information when a message is generated:
[$sourceUser]
- Replaced with the name of the user who initiated the action.[$targetUser]
- Replaced with the name of the user who is the target of the action.[$dieName]
- Replaced with the configured name of the die involved in the action.[$amount]
- Replaced with the quantity of the die involved in the action.
Example Gift Message Template: [$sourceUser] generously gifts [$amount] [$dieName] to [$targetUser]!
Usage & Interface
Dice Icons
Clicking on the dice icons has the following effects:
- Use (click own die): Uses one of that die if the user has any uses remaining.
- Gift (click others' die): Gifts one of the die to another player, up to the defined limit for that die type, provided the giving player has at least one use remaining and the dice type is configured to allow gifting.
Additionally, if a user has add/remove permissions for a given dice type, they can also use the following:
- Add (ctrl + click): Adds one of that die type to the player, up to the defined limit for that die.
- Remove (ctrl/cmd + right-click): Removes one of that die type from the player, down to zero.
Overflow Toggle
The maximum number of icons displayed on the player list can be configured via the settings (default 3). If additional dice types are enabled, they can be viewed by toggling the overflow button.
- Toggle Single Overflow (click): Expands or collapses the view of additional dice types for that user.
- Toggle All Overflows (right-click): Expands or collapses the view of additional dice types for all users.
If the Fine Dice Controls client setting is enabled, these clicks instead open a dialog window, allowing you to use, gift, add, or remove multiple uses of a die at once.
API & Hooks
Developers can find details for the module's API and its hooks in the repository's README.