ddb-importer icon indicating copy to clipboard operation
ddb-importer copied to clipboard

Certain formulas seem to be incorrectly set up during character import

Open Visparu opened this issue 8 months ago • 1 comments

Describe the bug Since upgrading to Foundry V12, When importing a character, the following warning(s) appear when reloading Foundry, as well as when trying to use certain features or spells:

Unable to simplify formula for Eldritch Blast (ddbEldritBlast1I) on Humphrey "Lexi" Garagal (C7u7693NV7zN1Rdq) SyntaxError: Expected "$", "(", "{", [+\-], [0-9], [^ (){}[\]$,+\-*%/], [a-z$_], [dD], or whitespace but end of input found.

I have observed this behavior for the following features and spells:

  • Wild Shape (Not sure where the error comes from here, honestly)
  • Spiritual Weapon (Damage formula, the d in d8: floor(@item.level / 2)d8 + @mod)
  • Eldritch Blast (Damage formula, the trailing +: 1d10[force] +)

I didn't check for every spell in the book, these just happened to be attached to the characters I currently have in my world. This also happens in an entirely fresh world after munching spells, items and monsters, then creating an actor and importing the character.

To Reproduce Steps to reproduce the behavior:

  1. Create a new actor
  2. Import a character from DnDBeyond that has one of the affected features or spells
  3. Try to use the feature or spell, e.g. the "Damage" roll for Eldritch Blast
  4. See error (It pops up as a Foundry alert as well as in the developer console)

Expected behavior The imported formulas for said features and spells would be imported correctly.

Screenshots Pop-up error message: image

Console error message: image

Environment:

  • Browser: Firefox
  • Foundry Version: 12.327
  • 5e System Version: 3.2.0
  • Module Version: 5.2.5
  • Does this behaviour occur with other modules disabled: Yes (All other modules)

Additional context Add any other context about the problem here.

  • Character URL (seems to happen with any character, but anyway): https://www.dndbeyond.com/characters/44289151
  • Details of any errors in the browser console: As seen above.

All of that said, thank you for this module, it is truly a treat and has saved me a ton of time setting up and running my games.

Visparu avatar Jun 07 '24 22:06 Visparu