javalent / initiative-tracker

TTRPG Initiative Tracker for Obsidian.md
GNU General Public License v3.0
144 stars 30 forks source link

🐞 Modifiers of custom formula not being applied #284

Open igorfranb opened 3 months ago

igorfranb commented 3 months ago

Check for existing bug reports before submitting.

Expected Behavior

I'm building an encounter from a code block, using custom formula (set as %mod1%d20kh + %mod2% in the plugin settings), and initiative should have been rolled as e.g. 3d20kh + 5 for initiative modifier set as [3, 5].

Current behaviour

However, it does not seems to be applied, at least not the second. Starting the encounter after creating the encounter and hovering the initiave value in the Initiative Tracker screen, the value is shown as "5 + 0" for exemple. Also, frequently it rolls 1, which should be rare for a 3d20 roll keeping the highest value.

I've also tried removing the "kh" from the formula (because I'm not shure if it works in this plugin) but the issue continues, rolling 1s and 20 at most. I've tried to add a creature via Initiative Tracker screen and setting the initiative the same way but the issue continues.

I'm a newbie obsidian user, so I don't know if there is a way to view error logs or something.

Reproduction

  1. Open the Obsidian Sandbox via the 'Open sandbox vault'
  2. Open Settings -> Community plugins and click in browse in the Community plugin option
  3. Search for and download Javalent's Dice Roller and Initiative Tracker plugins and enable both
  4. Return to Obsidian settings and go to Initiative Tracker settings
  5. Set the Initiative formula in the end of the settings as %mod1%d20kh + %mod2%
  6. Create a new note and paste the following codeblock
    ```encounter
    name: exemple
    creatures:
    - creature, 10, 15, [2, 5]
    ```
  7. Enter reading view and click in the sword icon in the block

Which Operating Systems are you using?

Obsidian Version Check

1.5.12

Plugin Version

13.0.11

Confirmation

Possible solution

No response