diff --git a/README.md b/README.md index 758c3ca..9ca19e6 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,51 @@ It is supposed to aid storytellers and allow them to quickly set up and capture ### Features - Public Town Square and Storyteller Grimoire (toggle with **shortcut \[G\]**) -- Supports custom script JSON generated by the [Script Tool](https://bloodontheclocktower.com/script) +- Supports custom script JSON generated by the [Script Tool](https://bloodontheclocktower.com/script) - Live Session for Storyteller / Players including live voting! - Includes all 3 base editions and travelers - Night sheet and reminder text for each character ability to help storytellers - Many other customization options! +### Custom Characters + +In order to add custom characters to your local Grimoire, you need to create a JSON definition for them, +similar to what is provided in the `roles.json` for the 3 base editions. Here's an example of how such a character +might be described: + +```json + { + "id": "acrobat", + "image": "https://github.com/bra1n/townsquare/blob/master/src/assets/icons/acrobat.png?raw=true", + "edition": "custom", + "firstNight": 0, + "firstNightReminder": "", + "otherNight": 49, + "otherNightReminder": "If either good living neighbor is drunk or poisoned, the Acrobat dies.", + "reminders": ["Die"], + "setup": false, + "name": "Acrobat", + "team": "outsider", + "ability": "Each night*, if either good living neighbor is drunk or poisoned, you die." + } +``` + +**Required properties:** `id`, `name`, `team`, `ability` + +- **id**: the internal ID for this character, without spaces or special characters +- **image**: a URL to a PNG of the character token icon (should have a transparent background!) +- **edition**: the ID of the edition for this character. can be left blank or "custom" +- **firstNight** / **otherNight**: the position that this character acts on the first / other nights, compared to all + other characters +- **firstNightReminder** / **otherNightReminder**: reminder text for first / other nights +- **reminders**: reminder tokens, should be an empty array `[]` if none +- **setup**: whether this token affects setup (orange leaf), like the Drunk or Baron +- **name**: the displayed name of this character +- **team**: the team of the character, has to be one of `townsfolk`, `outsider`, `minion`, `demon` or `traveler` +- **ability**: the displayed ability text of the character + +_Note:_ custom characters are currently not supported in live sessions and will not be synchronised to other players. + ## [Code of Conduct](CODE_OF_CONDUCT.md) ## [Contributing](CONTRIBUTING.md) diff --git a/src/components/Token.vue b/src/components/Token.vue index cb6a663..7d19cc0 100644 --- a/src/components/Token.vue +++ b/src/components/Token.vue @@ -4,9 +4,8 @@ class="icon" v-if="role.id" v-bind:style="{ - backgroundImage: `url(${require('../assets/icons/' + - role.id + - '.png')})` + backgroundImage: `url(${role.image || + require('../assets/icons/' + role.id + '.png')})` }" > diff --git a/src/components/modals/EditionModal.vue b/src/components/modals/EditionModal.vue index 7246a4d..d06e43a 100644 --- a/src/components/modals/EditionModal.vue +++ b/src/components/modals/EditionModal.vue @@ -17,12 +17,12 @@ {{ edition.name }}
  • - Custom Script + Custom Script / Characters
  • -

    Upload a custom script

    +

    Load custom script / characters

    To play with a custom script, you need to select the characters you want to play with in the official and then upload the generated "custom-list.json" either directly here or provide a URL to such a hosted JSON file.
    +
    + To play with custom characters, please read +
    the documentation + on how to write a custom character definition file.

    Some popular custom scripts: