fantasy-statblocks icon indicating copy to clipboard operation
fantasy-statblocks copied to clipboard

Can't override hp with Dice roller integrated

Open irrevenant opened this issue 2 years ago • 2 comments

I'd expect the following to give me a stat block for a Nightmare with 40 hit points, but it always gives me the average for the hit dice.

```statblock
monster: Nightmare
hp: 40
```

I assume there is something I could do in the callback to fix this myself, but I haven't been able to play around with that yet, and it does seems like a bug?

TTRPG Statblocks v2.16.2 Dice Roller v8.6.4

irrevenant avatar Aug 28 '22 16:08 irrevenant

I've also noticed that when not using an existing stat block and defining your own, the simple hp: 32 renders with a dice roll icon and brackets as if it were a roll. When clicking the dice to perform a roll with a static value - there are errors in the console. Changing to hp: 1d20 you get the same output, but a functioning roller.

It seems that the hp: field is defaulting to a roller?

Obsidian v0.15.9 TTRPG Statblocks v2.16.2 Dice Roller v8.6.4

hp: 32 usage: image

hp: 1d20 usage: image

danstreeter avatar Aug 30 '22 19:08 danstreeter

This is because of the layout. The hp property has a dice callback of hit_points. It also parses this dice property instead of hp. Because of this, no changes on hp will be reflected in the statblock (as I understand it). So if you want to change the dice, change the hit_dice property. This still tries to parse it as a dice roller though, so you can instead change the layout. Go into the settings and create a copy of the "Basic 5e Layout". Edit the "hp" property of it. Turn on advanced options and delete the text in "Dice callback" and "Link Dice to Property". After this, you can just use the layout option with the name of the layout any time you directly edit the hp field. It should render has a static hp value, instead of a dice roll.

kylomax avatar Sep 29 '22 01:09 kylomax

Closing as this appears resolved by Kylo.

sigrunixia avatar Apr 13 '23 03:04 sigrunixia