Nice. This is a pretty amazing plugin.

I haven’t had the need to use dice like this for a good many years. This plugin is so awesome I had to install it just for fun!

It’s amazing to see what kinds of things people come up with. Well done @valentine.195 !!

@Erisred, I’m using this plugin for the sessions I’m running, for prep and play.

Also, there’s a type of play option called solo play for ttrpgs (table top rpgs). Look it up. There’s two main reddits devoted to it. It’s pretty cool. I’ve actually been using the solo play tools in my games and to test my homebrew ruleset and adventures.

You might like it if you have any systems you enjoy playing, but not a gaming group.

@valentine.195 Keep up the good work. Thanks for the 2.0 update. It’s working pretty well.

1 Like

@valentine.195
Is there a way for this plugin to work on the obsidian publish site via web?

It works in obsidian desktop and mobile, but not when I publish it and view it on obsidian publish.

Thank you!

Not sure–I don’t have Obsidian publish. Do other plugins work on publish?

Hello! I just released 3.0.0, which added support for the following:

  1. Fudge/fate dice (XdF)
  2. Percentile dice (Xd%)
  3. Negative dice (Xd-Y or Xd[-Y, Z])
  4. Chainable conditions on explode and re-roll modifiers:
    • This allows you to change what is exploded or re-rolled. For example, instead of re-rolling minimum values, you can use 1d2r=2 to re-roll rolls equal to 2.
    • Supports =, != (or =!), <, >, <=, and >=

The last few features I’m currently thinking about adding are a way to add pass/fail states to both the dice-roll results and the overall total, and a side-bar dice roller or command so you don’t have to put everything in the text of a note to roll it.

Let me know if there’s any other features you’d like to see added!

2 Likes

Hi Valentine, thank you for this plugin! I’m having fun playing with it.

I think there may be a bug. I have a page with the content:

`dice: 3d4 + 3`

and rendering the page crashes with the following error:

Error: Unexpected character at index 4: 3
    at Lexer.defunct (eval at <anonymous> (app.js:1), <anonymous>:53:11)
    at Lexer.lex (eval at <anonymous> (app.js:1), <anonymous>:135:41)
    at DiceRoller.parse (eval at <anonymous> (app.js:1), <anonymous>:1628:36)
    at DiceRoller.parseDice (eval at <anonymous> (app.js:1), <anonymous>:1548:14)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:1352:53)
    at NodeList.forEach (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:1345:26)
    at Function.t.postProcess (app.js:1)
    at t.postProcess (app.js:1)
    at p (app.js:1)

A dice phrase without addition works fine, e.g. dice: 3d4

Mine is broken as well. I have addition in most of mine for custom rolls. Without addition, it works fine. :frowning: Let us know what you find. Thank you.

Update: It’s broken on mobile (android) as well.
Obsidian Publish: is not working as well.

All: Do i need to add any code to the top or bottom of a note to make it work on obsidian publish.

@valentine.195 Since you are developing plugins, perhaps Obsidian will give you a free publish account to test your plugins? It might be worth inquiring.

Thank you again. :slight_smile:

Looks like it could be an update related to 3.0.0 if it just broke. Sorry about that. I’ll try to fix it ASAP.

For now if you need it, you can downgrade to 2.0.0 manually from the GitHub releases page.

No worries. Thank you. I’ll wait for the next push. If not, I’ll pull it from github.

3.0.1 released

  • Fixed bug related to static number parsing.

Should work now. Let me know if you run into any other issues - v3.0.0 was a pretty big structural re-write to make it easier to handle chained modifiers and conditions, but I obviously missed some stuff in my testing.

1 Like

It works on win10 and android mobile. Thank you for the quick updates!

Hello everyone!

Hope the plugin has been working well for you.

I had a little bit of time today, so I sat down and integrated a feature I really wanted for my DnD games: random tables!

Update to version 4.0.0 and refer to the documentation here on how to use this new feature.

Happy rolling!

1 Like

Hi valentine.195, thank you for making this! I’ve been eagerly looking forward to table-based rolling!

Unfortuantely I get a bug when I try to use it. For this page “Untitled”:

| 1d6 | Fruit     | Color  |
| --- | --------- | ------ |
| 1   | Apple     | Red    |
| 2   | Orange    | Orange |
| 3   | Banana    | Yellow |
| 4   | Lime      | Green  |
| 5   | Blueberry | Blue   |
| 6   | Grape     | Purple |
^fruit-and-color-table

`dice: [[Untitled^fruit-and-color-table]]`

I expected to see a random row from the table. Instead I got this exception in the console:

lexer.js:4 Uncaught (in promise) Error: Unexpected character at index 0: [
    at Lexer.defunct (eval at <anonymous> (app.js:1), <anonymous>:53:11)
    at Lexer.lex (eval at <anonymous> (app.js:1), <anonymous>:135:41)
    at DiceRoller.parse (eval at <anonymous> (app.js:1), <anonymous>:1964:36)
    at DiceRoller.eval (eval at <anonymous> (app.js:1), <anonymous>:1852:45)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:31:71)
    at new Promise (<anonymous>)
    at __awaiter (eval at <anonymous> (app.js:1), <anonymous>:27:12)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:1849:53)
    at new Promise (<anonymous>)

Current syntax would be `dice: 1d[[Untitled^fruit-and-color-table]]`.

Edit: I see my documentation shows what you put in. I’m sorry about that!

Having thought about this, though, I think I will drop the requirement to have Xd at the beginning - if it’s present, I’ll return X results, otherwise just assume 1 for links.

Also, I didn’t think about returning rows. At the moment, unless you specify a header, the plugin will combine all of the columns in its options. I think I like your expected behavior more, though. I’ll update it.

Great! I got it working with the following syntax (note the ‘#’ was required too):

`dice: 1d[[Untitled#^fruit-and-color-table]]|Fruit`

`dice: 1d[[Untitled#^fruit-and-color-table]]|Color`

4.0.3 just released and fixes these issues.

  • Links are no longer required to have Xd preceding the link
  • A table with multiple headers will now return the full row unless a header is specified
  • Links no longer require the # before the block id

Additionally, something I forgot to mention (and it is not immediately obvious) - Ctrl - clicking on the result will open the block reference in a new pane.

2 Likes

Hello everyone!

I released 5.1.0 today, which, along with 5.0.0, adds some neat new features.

  1. You can now roll a note’s blocks! Using dice: [[Note]] or dice: Xd[[Note]] to return a random block (or X blocks) from that note.
  2. If you have Dataview installed, you can also roll random blocks from any note with a tag! Use dice: #tag to return random blocks from notes tagged with tag.

Here’s the tag in action:

1 Like

And now for something completely different … Using the Dice Roller plugin for Writing Prompts!

:grin:

1 Like

would it be possible to combine rolls on 5 tables into one diceroll?
or alternatively a reroll that rerolls X dicerolls in a block?

i have made 5 separate rolls on 5 separate tables to get 5 seeds for a quest. Rerolling each individual seeds is great, but being able to reroll all with one click would be cherry on top.