Skip to content

🐞 Dice Roller activated although no formula given #488

@namtrah

Description

@namtrah

Check for existing bug reports before submitting.

  • I searched for existing Bug Reports and found no similar reports.

Expected Behavior

I am creating a new layout in FS. In my system, abilities do not have scores, only the modifiers. So the stats[] array looks like stats[1,0,-2,3,1,0]. When I create a property to display the first stat, I am using a callback to look into the array. The code looks like this:

{
  "type": "property",
  "id": "6a68eab8abaa",
  "properties": [
    ""
  ],
  "fallback": "-",
  "display": "S",
  "callback": "console.log(\"Stats[0]\" + monster.stats[0])\nreturn monster.stats[0];",
  "diceCallback": ""
},

The output shows only the console.log, but the stat errors with two dice roller messages 1) "Invalid syntax at line 1" and 2) "Could not parse".

A workaround is to turn off the dice roller entirely with dice: false But this seems weird as I have no "dice" formulas with just a single number, do I? Since I do use dice roller for the Actions (to Hit and Damage), it is weird that these do not follow my callback properly. Do you expect a formula (+3 meaning 1d20+3) by default?

This seems to be a bug.

Current behaviour

Image

Reproduction

Create a property with a callback for an element of the stats[] array.
Create a statblock with stats similar to stats[0,0,0,1,1,1]
Visualise it with and without the dice roller enabled.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version Check

1.8.10

Plugin Version

FS 4.9.0, DR 11.4.2

Confirmation

  • I have disabled all other plugins and the issue still persists.

Possible solution

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions