Skateside / pocket-grimoire

A mobile version of the Blood on the Clocktower grimoire
https://www.pocketgrimoire.co.uk
GNU General Public License v3.0
36 stars 18 forks source link

[BUG] Can't add custom characters to the Grimoire if it has an "underscore" in it's ID. #127

Open GrayPockets opened 1 week ago

GrayPockets commented 1 week ago

I created a custom version of the Apprentice for my script, and noticed I couldn't use it in the Pocket Grimoire. I discovered it's because of the "id" having an "underscore" in it "apprentice_dp".

The same goes for non-traveller custom characters on this script. ("ojo_dp", "mastermind_dp", etc), although slightly differently. For the traveller, nothing happens when you click (the window stays there). For the non-traveller, you can click them and the window closes, but no token appears.

Steps to Reproduce

  1. Download https://www.impeccabletiming.net/botc/Delirium%20Promenade.json
  2. Navigate to https://www.pocketgrimoire.co.uk/en_GB/
  3. Clear your cache (Click Clear Cache > Clear Cache)
  4. Select the custom edition: (Select edition > Custom Script > upload a custom script, select the "Delirium%20Promenade.json" file)
  5. Click "Add traveller" and click the apprentice

Expected Outcome The custom version of the Traveller should be added to the Grimoire Actual Outcome Nothing happens

Here is the full character:

{
    "id": "apprentice_dp",
    "name": "Apprentice",
    "image": [
        "https://botc.app/assets/apprentice-Dq5aGiYi.webp",
        "https://botc.app/assets/apprentice_g-qVS2q4bN.webp",
        "https://botc.app/assets/apprentice_e-BEpvFWvS.webp"
    ],
    "team": "traveler",
    "firstNight": 1,
    "firstNightReminder": "Show the Apprentice the 'You are' card, then a Townsfolk or Minion token. In the Grimoire, replace the Apprentice token with that character token, and put the Apprentice's 'Is the Apprentice' reminder by that character token.",
    "remindersGlobal": [
        "Is The Apprentice"
    ],
    "setup": false,
    "ability": "On your 1st night, you gain a Townsfolk ability (if good), or a Minion ability (if evil).",
    "jinxes": [
        {
            "id": "marionette_dp",
            "reason": "The Apprentice with the Marionette ability thinks they are good and have gained a Townsfolk ability."
        }
    ],
    "special": [
        {
            "type": "reveal",
            "name": "replace-character"
        }
    ]
},

image image

Skateside commented 3 days ago

Hi @GrayPockets

Is this still an issue? I can't reproduce it, but a different bugfix may have solved it.

Cheers Skateside