New Plugin: Dice Roller - inline dice rolling

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.

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!

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.

1 Like

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.

Potentially a simple question, but hopefully someone can help me: Is there a way to “freeze” list rolls so that whatever is selected persists forever, or until I choose to re-roll the value? For instance, I’ve built a template to generate an NPC based on a series of attribute tables, but the attributes re-roll whenever I re-open Obsidian. Ideally I’d love to be able to convert those rolls to static values somehow, but so far haven’t figured out how to do so.

Ahhh, I see “dice-mod” or “save results” is probably the answer here. I was encountering issues with those options but I think it was my syntax. Good reminder to RTFM. :slight_smile:

Greetings, I love the functionality of this dice roller. I am making it work with Shadowrun 5e. I have one hurdle at the moment.

Shadowrun uses only D6 dice and counts hits (5 and 6 on d6s) and counts misses (1s on d6s). The misses only matter if more than half of your dice pool come up 1.(e.g. 5d6 rolls 1,1,1,4,6)

I can make it count hits (5,6) or make it count misses (1) but it would be nice to count both at the same time. Currently I count hits and just read the individual dice results to count 1s.

It may be that I am just missing the method. Regardless this will be a big help.

Thank you

Wow! This is really an amazing plugin! Thank you for creating this.

Is there a command to replace all dice rolls (or rolls on a table) in a note by their results? I know you can enter the dice-mod: ... code. But what I am looking for is a way to keep rolling on the table, until I’m happy with the result, and then replace the dice code with the result (such that it stays there forever).

I would use this “replace all dice rolls” command in a button (from the ‘buttons’ plugin).

This could be cool in TTRPGs e.g. to make a template for a random NPC or random inn; keep rolling on the random tables for the name, quirks, stats, etc; until you’re happy, and then ‘lock in’ the results.

Just loaded the dice roller up on a new device and it won’t load for me.
I’ve re/uninstalled and deleted the plug in folder as well.
Thoughts? I love this thing and I’ve used since you first put it up. :frowning:
Thank you.

Hi @valentine.195 and thanks a lot for this awesome plugin. I am currently prepareing my vault for use with ttrpg, random tables and such and am currently stuck with the following i try to achieve:
i have a table with embedded pictures (*.png) and when the plugin rolls on this table, it gives me a link to the PNG…is there a way to have the picture shown as a result (like it is in the source table)? Even doing a reroll when i click it?
Is there a way to randomly select a file from a folder? (I have all PNG in question in on folder…)
Thanks again for your great work!

Thank you for the plugin!

I want to display a random quote which I store in daily notes with the corresponding tag, say #quote. When I query ‘dice: #quote’, I get random blocks from the notes with the tag (as expected, actually).

Is it possible to return only the blocks containing the tag?

Same. I write something as blocks in my daily notes, now i am searching how to show random blocks with specific tags.

I noticed that in the end of the gif you click and open the markdown file in a new tab, how do you do that? I tried but it rolled another result.