p4535992 / foundryvtt-better-rolltables

Module for FoundryVTT to improve rolltables
MIT License
3 stars 4 forks source link

[BUG] Story Generators broken #22

Closed cmccord-dev closed 8 months ago

cmccord-dev commented 10 months ago

Module Version: v02.0.31

Describe the bug Random NPC generator from compendium doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. Import Random NPC generator from the BRT - Story Tables rolltables
  2. Open up, switch to story RollTable
  3. Attempt a better roll (Roll+)
  4. Observe errors

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Browser: Chrome

Foundry Version: 11v315

Game System: DnD5e 2.4.1

Additional context I did some investigation. The first issue is documentCollection doesn't exist on the JournalEntry fetched from the compendium. The field seems to now be called documentName instead. However the roll tables themselves do seem to have documentCollection.
See: https://github.com/p4535992/foundryvtt-better-rolltables/blob/ad7013037570229bfb1d4bd96f63069b6b3e61f3/src/scripts/story/story-builder.js#L47C1-L47C67

After that, the StoryChatCard function is just completely broken (or the generateChatStory, I'm not sure which). It first generates a story, which makes sense, but then it passes the resulting generated html to StoryChatCard functions, which are expecting a roll table and not an html string. This does not match the comment on the function, which says it takes an html string. https://github.com/p4535992/foundryvtt-better-rolltables/blob/ad7013037570229bfb1d4bd96f63069b6b3e61f3/src/scripts/story/story-helpers.js#L13C1-L21C4 https://github.com/p4535992/foundryvtt-better-rolltables/blob/ad7013037570229bfb1d4bd96f63069b6b3e61f3/src/scripts/story/story-chat-card.js#L15C1-L47C4

p4535992 commented 9 months ago

The story table I fixed it on version 2.0.33 (I hope ?), but honestly I never use it, it was a typo from the old developer let me know if you get it right. It could be evolved into something better....