Use a proper error message for players being forbidden to send replies in the macro lambda. |
||
|---|---|---|
| assets | ||
| lang | ||
| packs/macros | ||
| scripts | ||
| styles | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| module.json | ||
| README.md | ||
The Mill's Messages - v0.4.1
This little FoundryVTT module gives the GMs a way to send messages to PCs with a bit more flair than the chat, and more spontaneity than journals !
Compatibility
This is only compatible with Foundry v12 currently.
Installation
Currently, this can only be installed via manifest file, using the following URL :
https://git.tfk-astrodome.net/trotFunky/TheMillsMessages/raw/branch/release/module.json
Behaviour
For GMs, a new entry on the left toolbar will appear with a new tool (a chat bubble) bringing up the dialog window to send messages.
GMs can choose what name will appear as the sender and have access to the full ProseMirror editor to send messages to as many players as they want at once.
Messages can be chained together – though they will be locked to all share the same recipients –
and will be displayed one after the other, when a player closes a message.
In a chain, senders can be different from message to message.
By default, each player has a journal that will serve as a history of the messages they receive,
each page containing the messages from one specific recipient.
Both the journals and pages will be created automatically.
Players only have observer permissions on their own journal, which will take the name of their
character, or their own if they don't control one yet.
The GM can send a message to an offline player, which will add it to its history if it is enabled, but won't show up as a pop-up when they next log in.
If the setting is enabled, players can also send messages if a GM is connected.
However, they can only send messages to NPCs (i.e. the GM) who have already contacted them.
The dialog is much simpler, allowing only to choose one NPC, the message and the ability to chain.
Connected GMs will have the messages displayed with both the sending player
and recipient NPC shown in the title.
This also allows the players to respond to NPC messages when they receive one, although only to the last one of a chain.
The player's messages are displayed with a background of their Foundry user color, to differentiate them from the NPC's.
Templates
Two elements of the GM sending dialog have some form of templating or autocompletion :
- The sender names
- If only player history is enabled, will be compiled from all players' histories
- If only Templates are enabled, will be compiled from the Template Journal pages
- If both are enabled, Templates are fetched first and will fall back to player histories if empty or invalid
- The message text
- If Templates are enabled and the current sender has some, they will be displayed in a list
- Selecting one will entirely replace the current message text (even if empty)
The sender names are taken from the Template Journal pages names.
The templates themselves are taken from the content of the pages and are marked via the new
ProseMirror editor button (a chat bubble).
It will create a special Title header with a different formating, replacing any existing selection.
The text in this header will define the template title, and all page content
until the next page header (or the end of the page) will define the content of the message that will be set.
Note : currently the header cannot be toggled via the button, but can be reset by removing the title formatting as for other headers.
Compendium
The module also provides a small compendium of macros which reproduce the functionality
of the toolbar buttons.
Both GM and player macros are available, but the functions called are only registered if
the user has the right permissions, so players cannot access GM capabilities.
Settings
A few behaviours can be changed through the settings :
- Title of the popup window showing the player the messages
- A header to the message, by default showing who they received a message from
- The name of the history journal
- If history needs to be saved at all (disabling will not store anything)
- If templates should be used, which will automatically create a Folder and Journal on load
- However, the GM can pass the UUID for one or both of them, which will be used instead
- A notification sound to be played for players when they receive a message (blank by default)
- If players are allowed to send messages to NPC from their history
- This setting depends on history being enabled, otherwise it will be disabled
Dependencies
The module depends on socketlib only at this time, to send the messages from the GM to the players.
License
The code present in this repository is licensed under the Mozilla Public License 2.0.