Code Monkey home page Code Monkey logo

dice-roller's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar jycasalis avatar onespaceman avatar sigrunixia avatar valentine195 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dice-roller's Issues

[Feature Request] Toggle to Hide Dice Roll Pane

While I do like having the dice pane auto open in my D&D vault, it's a little less useful in my Story vault and keeps covering my graph views.

A toggle to prevent the dice roller pane from opening every time on startup would be nice.

Obsidian_LYKmnJOSnz

Feature Request: World/Chronicles of Darkness dice

In World of Darkness you roll d10s, and it has a target number. For every die that hits the target number or above, you get a success. 1s can subtract successes and 10s (or sometimes 9s or 8s) can grant an additional die to roll. These modifiers would be great features for the dice roller! :)

Saves not working as expected- rolling on tables

Hey there,

first of all thank you for this great plugin!

I tried using rolls on one column tables via dice+: [[note#^table]]. Global saves off. So far so good.

It seems on closing obsidian or the note with the roll result, the results are not permanent. Neither they are when I jump in edit mode and change something (keystroke) in the same paragraph.

Is there anything I could have done wrong or to fix that? Maybe a bug?

Many thanks in advance!

[Bug] The right dice roller pane breaks after empty click

If you click the "Roll" button without putting anything in the input box, the button will then grey out and become completely disabled, until you disable/reenable the plugin or restart Obsidian.

Also small feature request: Copy the full formula too when clicking the copy button if "Display Formula With Results" option is on? :P

dice rolls with dataview variables?

Could it be possible to add dataview numbers to the dice formulas?

Example.

I declare a value using the DataView syntax in the file.

some_nr:: 10

and then I use it in various dice formulas in the page

`dice: 2d6 + some_nr`

`dice: d20 - some_nr`

etc.

If this is implementable, I could also have a look and submit a PR

Save roll not working for table or list items

Hi,

Even with both global persistResults on (and confirmed on in Console) and dice+: I am not getting table entries saved between either Obsidian startups or re-opening of a file.

I tried table on the Drinks lookup both with and without the roll column.
However the plain dice+: 1d6 seems to save.

Am I doing something wrong here or is there a bug?
I tried traversing the code to see if I could dig out an issue but nothing I can see. I also moved the loading order of the plugin from bottom to top to see if that was the issue (as per a different issue, I thought it might trigger a bad file reload)

I have also tried to disable all plugins except dice-roller, with an Obsidian restart without luck. The issue persists. Which means it's likely not interference with another plugin.
Here is my plugin list regardless:
community-plugins.json:

[
  "obsidian-dice-roller",
  "table-editor-obsidian",
  "dataview",
  "initiative-tracker",
  "nldates-obsidian",
  "obsidian-outliner",
  "sliding-panes-obsidian",
  "templater-obsidian",
  "obsidian-leaflet-plugin",
  "obsidian-5e-statblocks",
  "obsidian-admonition",
  "fantasy-calendar",
  "obsidian-metatable"
]

Reproduce:

  • Make Tavern Generator.md and Tavern Template.md as described below
  • Ensure all links up nicely
  • Open Tavern template
  • Then open Tavern Generator
  • Re-open Tavern template.

Expected result:
Table rolls should be the same each time Tavern Template is opened

Actual result:
You should get different table rolls, but a persistent 1d6 dice roll in the bottom of Tavern template

Am I doing something wrong?

Tavern template.md

# Name
`dice+: [[Tavern generator#^verb]]` `dice: [[Tavern generator#^adjective]]` `dice: [[Tavern generator#^noun]]`

# Menu
## Snacks: 
- `dice: [[Tavern generator#^side-dish]]`
- `dice: [[Tavern generator#^side-dish]]`
- `dice: [[Tavern generator#^side-dish]]`
	
## Mains:
`dice: [[Tavern generator#^cooking-method]]` `dice: [[Tavern generator#^main-ingredient]]` with `dice: [[Tavern generator#^with]]` and `dice: [[Tavern generator#^and]]`
`dice: [[Tavern generator#^cooking-method]]` `dice: [[Tavern generator#^main-ingredient]]` with `dice: [[Tavern generator#^with]]` and `dice: [[Tavern generator#^and]]`
`dice+: [[Tavern generator#^cooking-method]]` `dice+: [[Tavern generator#^main-ingredient]]` with `dice+: [[Tavern generator#^with]]` and `dice+: [[Tavern generator#^and]]`
## Drinks: 
- `dice+: [[Tavern generator#^drinks]]`
- `dice+: [[Tavern generator#^drinks]]`
- `dice+: [[Tavern generator#^drinks]]`
- `dice+: [[Tavern generator#^drinks]]`

`dice+: 1d6`

Tavern generator.md


 Moping
 Drowning
 Hanging
 Belching
 Running
 Walking
 Hunting
 Fighting
 Swinging
 Breaking
 Working
 Fermenting
 Flowering
 Worrying
 Following
 Flowing
 Complaining
 Standing
 Joking
 Laughing
 Panting
 Boarding
 Lounging
 Cutting
 Singing
 Staring
 Goading
 Disappointing
 Faltering
 Binding
 Winding
 Sundering
 Longing
 Fumbling
 Bumbling
 Stumbling
 Pining
 Whining
 Flying
 Hoarding
 Whoring
 Warring
 Winking
 Skittering
 Slithering
 Snoring
 Snorting
 Playing
 Practicing
 Grappling
 Burning
 Flaming
 Freezing
 Poisoning
 Burying
 Throwing
 Sparking
 Steaming
 Smiting
 Chittering
 Chattering
 Mumbling
 Grating
 Plowing
 Biting
 Howling
 Roaring
 Shouting
 Pouring
 Squeaking
 Stinging
 Charging
 Bleating
 Stabbing
 Goring
 Poking
 Swallowing
 Sucking
 Drinking
 Sneaking
 Hiding
 Slashing
 Limping
 Tripping
 Shifting
 Sliding
 Blinding
 Piercing
 Bludgeoning
 Crushing
 Hopping
 Thundering
 Hushing
 Crying
 Wailing
 Mourning
 Darkening
 Piling
 Digging
 Flinging
^verb

# Adjective
 Wayward
 Quiet
 Jolly
 Good
 Crooked
 White
 Gray
 Blackened
 Harried
 Crimson
 Silver
 Golden
 Disturbed
 Filthy
 Ugly
 Bastard
 Faltering
 Glorious
 Beautiful
 Handsome
 Wrinkled
 Unhappy
 Intelligent
 Lovely
 Ignorant
 Senile
 Sour
 Sweet
 Lonely
 Green
 Blind
 Hungry
 Worried
 Educated
 Stupid
 Emboldened
 Honorary
 Stinky
 Bottomless
 Greasy
 Sloppy
 Stylish
 Distressed
 Harrowed
 Tormented
 Mortified
 Lopsided
 Broken
 Moldy
 Gooey
 Fermented
 Blighted
 Ornate
 Drowned
 Murdered
 Widowed
 Hanged
 Angry
 Lusty
 Haunted
 Strong
 Withered
 Comely
 Pious
 Penitent
 Patient
 Drunk
 Worthy
 Wealthy
 Loathsome
 Weak
 Miniscule
 Miniature
 Enormous
 Enlarged
 Engorged
 Lecherous
 Despicable
 Lewd
 Portly
 Violent
 Bumbling
 Faulty
 Pristine
 Cleanly
 Cracked
 Splintered
 Jeweled
 Superior
 Flawless
 Common
 Exquisite
 Elegant
 Fine
 Dull
 Brittle
 Fragile
 Effeminate
 Masculine
 Supine
^adjective

# Noun
 Warhorse
 Horseman
 Maiden
 Mage
 Bachelor
 King
 Magistrate
 Warchief
 Warrior
 Mare
 Wolf
 Fox
 Lion
 Lamb
 Warden
 Mule
 Assassin
 Swordsman
 Lady
 Knight
 Soldier
 Wizard
 Warlock
 Ranger
 Bard
 Druid
 Monk
 Paladin
 Sorcerer
 Rogue
 Cleric
 Bear
 Goblin
 Kobold
 Gnome
 Halfling
 Dwarf
 Fool
 Virgin
 Horde
 Squire
 Eagle
 Rooster
 Piglet
 Thief
 Priest
 Friar
 Blacksmith
 Guard
 Stag
 Hag
 Devil
 Angel
 Serpent
 Snake
 Rat
 Mouse
 Bandit
 Chieftain
 Griffon
 Dragon
 Lizard
 Pony
 Baron
 Heifer
 Bull
 Hound
 Goat
 Toad
 Stallion
 Monster
 Vermin
 Beholder
 Monkey
 Elephant
 Boar
 Beagle
 Bat
 Demon
 Imp
 Sprite
 Fey
 Spirit
 Bitch
 Starling
 Minotaur
 Barbarian
 Prophet
 Merchant
 Cobbler
 Unicorn
 Ogre
 Nymph
 Butcher
 Captain
 Angler
 Lover
 Mason
 Tinker
 Whale
 Warhorse
 Horseman
 Maiden
 Mage
 Bachelor
 King
 Magistrate
 Warchief
 Warrior
 Mare
 Wolf
 Fox
 Lion
 Lamb
 Warden
 Mule
 Assassin
 Swordsman
 Lady
 Knight
 Soldier
 Wizard
 Warlock
 Ranger
 Bard
 Druid
 Monk
 Paladin
 Sorcerer
 Rogue
 Cleric
 Bear
 Goblin
 Kobold
 Gnome
 Halfling
 Dwarf
 Fool
 Virgin
 Horde
 Squire
 Eagle
 Rooster
 Piglet
 Thief
 Priest
 Friar
 Blacksmith
 Guard
 Stag
 Hag
 Devil
 Angel
 Serpent
 Snake
 Rat
 Mouse
 Bandit
 Chieftain
 Griffon
 Dragon
 Lizard
 Pony
 Baron
 Heifer
 Bull
 Hound
 Goat
 Toad
 Stallion
 Monster
 Vermin
 Beholder
 Monkey
 Elephant
 Boar
 Beagle
 Bat
 Demon
 Imp
 Sprite
 Fey
 Spirit
 Bitch
 Starling
 Minotaur
 Barbarian
 Prophet
 Merchant
 Cobbler
 Unicorn
 Ogre
 Nymph
 Butcher
 Captain
 Angler
 Lover
 Mason
 Tinker
 Whale
^noun

# Dinner



Random Dinner at a Country Inn

### Cooking Method

 Stewed
 Roasted
 Fried
 Boiled
 Baked
 Grilled
 Seared
 Steamed
 Salted
 Pickled
 ^cooking-method
    

### Main ingredient
 Rabbit
 Chicken
 Duck
 Mutton
 Pork
 Beef
 Pheasant
 Goose
 Trout
 Clams
 Pork sausage
 Duck sausage
 ^main-ingredient

### With
 Dumplings
 Red cabbage
 White cabbage
 Shredded cabbage
 Leeks
 Lentils
 Broccoli
 Peas
 Cauliflower
 Kidney beans
 String beans
 White beans
 Turnip mash
 Sliced turnips
 Asparagus
 Sprouts
 Sweet peppers
 Red potatoes
 Golden potatoes
 Yams
 ^with

### And
 Carrots
 Apples
 Cherries
 Tomatoes
 Blueberries
 Strawberries
 Beets
 Mushrooms
 Radishes
 Squash
 Sweet onions
 Red onions
 ^and

### Side dish
 Corn bread
 Corn mash
 Fresh bread
 Crusty bread
 Sesame bread
 Oat bread
 Pumpernickel bread
 Pretzel bread
 Fried egg
 Bacon
 Sharp cheese
 Soft cheese
 ^side-dish
    

### Drinks
| Roll | Water.     |
| ---- | ---------- |
| 1    | Water      |
| 2    | Wheat ale  |
| 3    | Porter     |
| 4    | Mead       |
| 5    | White wine |
| 6    | Red wine   |
| 7    | Sweet wine |
| 8    | Milk       |
| 9    | Coffee     |
| 10   | Brandy     |
^drinks

Feature Request: Specify the Heading Level

Thanks for this marvelous and powerful plugin! I have a small FR and I don't know if it's reasonable.

When using Dice Roller to return headings, I would like to specify the heading level. For example, I use H2 to group different classes of questions, and use H3 to present questions. When I want to get some random questions, I want the returned headings to be H3 rather than H2 or H1.

[Bug] d100 Dice doesn't follow the same styling as the other dice

The d100 dice doesn't follow the same structure as the other dice resulting in the % symbol disappearing when recoloring the svgs.


The other dice are structured like so:

svg
    g "Shapes"
        path .cls-1
    g "Layer_1"

Obsidian_3LOCEfvoMv

Where as d100 is structured like:

svg
    g "Layer_1"
         circle .cls-1

Obsidian_AzADBmVFzm

keep highest / drop lowest is adding dice instead of dropping

I think this may have been broken recently, but as the title says, rolling to keep highest or drop lowest will add the rolls instead.

E.g., dice: 2d20d1 may show [18,9d] and the result is 27 instead of 18.

Similarly, 2d20k, or 2d20k1, do the exact same thing.

image

Feature Request: disable dice icon globally or on a per-dice basis.

Hello! I was messing around with the dice roller and experimented with using a zero width character between two dice to seamlessly combine them (since putting them literally next to each other causes neither of them to work) and it works, however the dice icon from the first dice gets in the way.

Example:

image
image

While disabling it globally would be good, also being able to add an option to use on a dice-by-dice basis (maybe |nodice similar to |link?)

I'm sorry for all these feature requests! I have one final one that's slightly related but I'll make a separate issue for it ^^

Multiple look-up tables in one table element renders that row unable to be rolled, and strange display error when trying to recreate

Hello! I've been experimenting with this plugin and it's been amazing! However I've run into an issue where if I have multiple look up tables within the same element, the roller will instead refuse to roll that, rolling any other values instead.

I tried to recreate it using a minimum test case, but I'm encountering a weird error?? where it outright refuses to display the lookup table and instead displaying the raw text.

If it matters I am also using the Advanced Tables plugin, but even when disabling it it doesn't seem to work.

Here's the original page I was using, and the issue being repeatable here:

Race Generator.md
| dice:1d% |              Races              |
|:--------:|:-------------------------------:|
|   1-63   |  `dice: [[Race Generator#^common]]`  |
|  64-88   | `dice: [[Race Generator#^uncommon]]` |
|  88-100  |   `dice:[[Race Generator#^rare]]`    |
^main

| dice:1d7 |                                 Common Races                                 |
|:--------:|:----------------------------------------------------------------------------:|
|    1     |                                  Plainsfolk                                  |
|    2     |                                  Rabbitfolk                                  |
|    3     |                                   Halfling                                   |
|    4     |                                    Dwarf                                     |
|    5     |                                     Orc                                      |
|    6     |                                     Elf                                      |
|    7     | Half `dice: [[Race Generator#^half-gen]]` and half `dice:[[Race Generator#^main-alt]]` |
^common

| dice:1d6 |            Uncommon Races            |
|:--------:|:------------------------------------:|
|    1     |              Dragonborn              |
|    2     |               Tiefling               |
|    3     |            Minotaur (Yak)            |
|    4     |          Loxodon (Mammoth)           |
|    5     |                Goblin                |
|    6     | `dice: [[Race Generator#^kobold]]` Kobold |
^uncommon

| dice: 1d5 |    Rare Races     |
|:---------:|:-----------------:|
|     1     |      Tabaxi       |
|     2     |      Ijsbeer      |
|     3     | Mousefolk/Ratfolk |
|     4     |       Kenku       |
|     5     |      Tortle       |
^rare

| dice: 1d4 | Very Rare Races |
|:---------:|:---------------:|
|     1     |     Dragon      |
|     2     |     Coeurl      |
|     3     |     Faerie      |
|     4     | Asamir (reroll) |
^very-rare

| dice: 1d% | Kobold Subrace |
| -------- | -------------- |
| 1-50     | Northern       |
| 51-100   | Southern       |
^kobold

| dice: 1d% | Half                              |
| --------- | --------------------------------- |
| 1-70      | Plainsfolk                        |
| 71-100    | `dice: [[Race Generator#^main-alt]]` |
^half-gen

| dice:1d% |                Races No Half                 |
|:--------:|:------------------------------------:|
|   1-63   | `dice: [[Race Generator#^common-alt]]`  |
|  64-88   | `dice: [[Race Generator#^uncommon]]` |
|  88-100  |   `dice:[[Race Generator#^rare]]`    |
^main-alt

| dice:1d6 | Common Races No Half |
|:--------:|:--------------------:|
|    1     |         Elf          |
|    2     |      Rabbitfolk      |
|    3     |       Halfling       |
|    4     |        Dwarf         |
|    5     |         Orc          |
|    6     |      Plainsfolk      |
^common-alt

`dice: [[Race Generator#^main]]`


| dice: 1d4 |                                   Test Table                                    |
|:---------:|:-------------------------------------------------------------------------------:|
|     1     |                                   Plainsfolk                                    |
|     2     | `dice: [[Race Generator#^main-alt]]` and `dice: [[Race Generator#^common-alt]]` |
|     3     | `dice: [[Race Generator#^main-alt]]` and `dice: [[Race Generator#^common-alt]]` |
|     4     |                                      Other                                      |
^test

| dice: 1d4 |                Test2 Table                |
|:---------:|:-----------------------------------------:|
|     1     |                Plainsfolk                 |
|     2     | `dice: [[Race Generator#^kobold]]` Kobold |
|     3     | `dice: [[Race Generator#^kobold]]` Kobold |
|     4     |                   Other                   |
^test2


`dice: [[Race Generator#^test]]]`


`dice: [[Race Generator#^test2]]`

And here's the test file

This File.md
| 1d3 | test table 1 |
| --- | ------------ |
| 1   | one          |
| 2   | two          |
| 3   | three        |
^test1

| 1d3 | test table 2 |
| --- | ------------ |
| 1   | one          |
| 2   | two          |
| 3   | three        |
^test2

| 1d3 | test table 3                                                               |
| --- | -------------------------------------------------------------------------- |
| 1   | one                                                                        |
| 2   | `dice: [[This File#^test1]]`                                       |
| 3   | table 1: `dice: [[This File#^test1]]` table 2: `dice: [[This File#^test2]]` |
^test3

`dice: [[This File#^test3]]`

This is what the test file displays when it rolls one of the lookup tables (related to this issue?):
image

I've tried both ITS theme and default.

Maybe my formatting is wrong? It looks correct to me

Thanks in advance!!

Allow dice numbers to be omitted

A lot of times when I and my friends play COC we usually just omit the number when only roll dices once (and our software supports that too)
For example:
1d100 would just be d100 and
d100+d10 would be equivalent to 1d100+1d10.

Another less used thing is that, sometimes we also omit the dice faces if it is an 100 faces die.
For example:
2d is equal to 2d100 and
in extreme (yet really common) cases
when we just type in d it works as 1d100.

That is currently not possible here. Um, may I ask support for that?
(Or even better, let us customize the default values?)

Request: add/concat table rolls

It would be great to be able to do "math" on table and lookup rolls:

dice: [[Dwarf Names#^DwarfMaleNames]] + [[Dwarf Names#^DwarfFamilyNames]]

would output Dragmar Silverhammer or whatever with one click rather than on two separate rolls.

EDIT: Thinking more about this it might make sense to not use math for this to not confuse between actual math and concatenation. Something like

dice: [[Dwarf Names#^DwarfMaleNames]] [[Dwarf Names#^DwarfFamilyNames]]

would work too.

Table Roller tab in addition to the Dice Roller?

Would it be possible for us to have the option to enable a secondary tab either within or in addition to the Dice Roller view, which would allow us to save our favorite table rolls for quick access? For example, it would be great to have immediate access to my NPC name, random encounter, or treasure rolls right in that side pane, no matter what particular note I might have open at the moment. It would be amazing to have those sort of rolls at my fingertips whenever my players decide to talk to a random passerby or guard, or end up looting a random house.

Otherwise I love all the work you are doing! Thank you!

render dice rolls in edit mode

Hey. Would it be possible to render the dice rolls directly in edit mode, without having to switch to preview mode and back again? I am using the

`dice-mod: 3d100 + 12`

syntax

[Feature Request] Replace the whole `dice: ` block with its result as plain text

I'm thinking of a concept like this.

Maybe a block like dice-text: that directly saves the result that replaces the block itself with plain text of the results.

I'll use 1d100 as example:

User inputs dice-text: 1d100.
When going back to preview, this could shown as something like this:

[1d100 - Click to roll!]

And when clicked, let's say I got a 58, then it becomes:

1d100 โ†’ [58] โ†’ 58

And this exact text is saved inside the markdown file, overwriting the dice-text block. (Going back to the editing mode shows the same result text too)

I'm thinking like this could be really useful if dice rolls need to be recorded. (COCTRPG gamr recordings, etc.)
Although this won't prevent the user manually modifying the dice, this way however completely eliminated the probability of losing the original dice result, and allowed results to be safely saved.

Also, thank you for this wonderful plugin!

Re-roll on line edits

Even though the global save setting is enabled (which functions correctly when navigating between notes), if any line with a dice roller insert is edited in any way, all dice are re-rolled. This causes re-rolls on todo item toggles, as well as re-rolls if a paragraph of text is edited that contains an insert.
DiceRollerIssue

Feature Request: Allow dice tags to be used in dice tables

Hello! I was making some more dice tables and noticed that dice tags don't work if they're placed in dice tables. This is my table for reference!

| dice: 1d4 | Connections                                         |
| --------- | --------------------------------------------------- |
| 1         | They are associated with `dice: #dnd/factions|link` |
| 2         | They're from `dice: #dnd/pc|link`'s past            |
| 3         | They know `dice: #dnd/pc|link`                      |
| 4         | They know `dice: #dnd/npc|link`                     |

Many many thanks in advance!!

[feature requst] post the result into a other file and read values from there

[feature requst] post the result into a other file and read values from there

stats file.md
value1 = 6
value2= 3

content.md
your value1 is 6 ... press dice
your value2 is 3 ... press dice

(reload page or other page)

content2.md
now your value1 is 2
and your value2 is 4

the idea is to use the stats file as a player profile where he can have items with value
and then write a story where he can see the item(s) and the value and where he can dice a new value to his stats file
and so load a new link or transclude a new story part

so in that way he gets a playable dynamic story saved in his stats file

some how
i hope you get the picture i dont know if it is possible but it would be awesome

thanks any way

Feature request: dice-mod for tables etc.

I was wondering why this feature is not implemented for tables and the like. This would be very handy and more reliable/futureproof than the current saving to plugin data.

Save custom formulas in sidebar

I would like to easily re-roll the same formulas again and again (for ex, an attack +3 on a d20 roll). It would be good to either

  • save them (they appear as "custom dice", under the standard dice)
  • click re-roll on results in the history

Fantasy AGE Stunt Die

Hi Jeremy,

I am using the Fantasy AGE system, which basically uses 3d6 for skill rolls. Additionally it has the concept of a "Stunt Die":
If you roll doubles, it is called a Stunt. This generates 1-6 stunt points, the amount depending on one of the three thrown dice, the "Stunt Die". The Stunt Die is a fixed one (usually marked by choosing a die with a different color).
Would it be possible to support this behaviour (detecting a Stunt and showing the number of stunt points) in Dice Roller?

Thanks,
Matthias

Allow inline switching of dice graphics

For many rolls it's useful to have the dice graphics displayed, but for some generators drawing from lists, I'd like to have it turned off. It would be great to be able to specify that argument inline. Something like this:

dice: [[note^list]]Item display: none;

Feature request: AND, OR, and NOT conditions for tag dice

I hope this is feasible! I was brainstorming about ways to use dice tables, and realized it would be fantastic if there was a way to use AND OR and NOT operators with tag dice!

I'd imagine it could work something like this:
dice: #tag1 AND #tag2 NOT #tag3|link

Which would return a link to a file that has tag 1 and 2, but not tag 3.

My specific use case was be to be able grab an npc in a specific location (dice: #dnd/npc AND #dnd/location/town)

Using parenthesis might need to be required for more complicated use cases such as dice: (#tag1 OR tag2) AND #tag3 NOT #tag4|link, but I'm not sure if anyone but me would even need something on that level ๐Ÿ˜…

Thanks again in advance!! If its not feasible I completely understand

Mobile

Hi there,

thanks for this plugin, I started to integrate it into my Fantasy AGE campaign, managed via Obsidian. For GM-ing am currently switching from my MacBook to my iPad Pro (Obsidian Mobile Beta). When trying to enable it on Obsidian Mobile I get the message that the plugin does not support Mobile. Would it be possible to enable that?

Thanks,
Matthias

Copy button only copies one line of output

I have a note containing separated lines and am using dice: 3d[[What to do today]] which correctly displays a random selection of 3 lines. Hitting the copy button only copies the first of the three lines.

I can't select the text manually either, once you let go of the mouse button the list refreshes

Allow Note to be 'Source' of Dice Roller View

Allow selecting a specific note as the Dice Roller View Source. The field references used in the dice roller could pull from that note. (Ideally this selection would be in the dice roller to allow for on the fly transition to a new note source.)

Feature Request: Display Zero-Width Character in dice tables

Hello! Slightly related to #54, but when using zero width characters in a table to combine two other dice, it shows up as raw text.

Example:
image
image
In the table itself it's displayed like in #54
image

Thanks in advance!! If this isn't feasible due to some html-parser I completely understand ๐Ÿ˜…

I promise I'll stop blowing this up with my feature requests;;

Any expression using parentheses breaks

As of 7.8.3, it looks like any dice rolls with parenthesis have stopped working.

Dice usage such as: dice: 1 + (overall_level - 3)d5 used to produce:

demonstration

...it now unfortunately doesn't render anything, and opening any note with expressions like these produce the error message:

There was an error parsing the dice string: dice: 1 + (overall_level - 3)d5

Error: Mismatched Parentheses

image

I've tried rearranging the parentheses in every-which-way, but on both my phone and computer, they return the same error message.

This might just be some sillyness on my part, but both the brackets are the same.
Sorry for the trouble haha,,

Error executing various dice rolls using Wych/Witch's random tables

There are some (not all) dice rolls that just don't seem to work. I have updated the dice roller and your files to the latest and restarted OBS. There are errors in the console. Depending on which roll didn't work. Based on the NPC Random tables of Wych/Witch.

app.js:1 Uncaught TypeError: Cannot read property 'filter' of undefined
    at updateEditorLinks (eval at <anonymous> (app.js:1), <anonymous>:661:30)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2041:21)
    at t.e.tryTrigger (app.js:1)
    at t.e.trigger (app.js:1)
    at t.trigger (app.js:1)
    at t.activeLeafEvents (app.js:1)
    at a (app.js:1)
updateEditorLinks @ linkAttributes.ts:112
eval @ main.ts:58
e.tryTrigger @ app.js:1
e.trigger @ app.js:1
t.trigger @ app.js:1
t.activeLeafEvents @ app.js:1
a @ app.js:1
setTimeout (async)
e.tryTrigger @ app.js:1
e.trigger @ app.js:1
t.trigger @ app.js:1
t.activeLeafEvents @ app.js:1
a @ app.js:1
setTimeout (async)
l @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
s @ app.js:1
Promise.then (async)
l @ app.js:1
s @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.loadFile @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.setState @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.setState @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.setViewState @ app.js:1
eval @ VM111:74
o @ VM111:23
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.openFile @ app.js:1
t.onFileClick @ app.js:1
s @ app.js:1
Show 21 more frames
2VM182:2 Uncaught (in promise) Error: Could not load file.
    at Kt.eval (eval at <anonymous> (app.js:1), <anonymous>:2:100728)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2:69931)
    at new Promise (<anonymous>)
    at t (eval at <anonymous> (app.js:1), <anonymous>:2:69676)
    at Kt.getFile (eval at <anonymous> (app.js:1), <anonymous>:2:100558)
    at new Gt (eval at <anonymous> (app.js:1), <anonymous>:2:100531)
    at new Kt (eval at <anonymous> (app.js:1), <anonymous>:2:121455)
    at Yf.getRoller (eval at <anonymous> (app.js:1), <anonymous>:2:799317)
    at Yf.eval (eval at <anonymous> (app.js:1), <anonymous>:2:795586)
eval @ VM182:2
eval @ VM182:2
t @ VM182:2
getFile @ VM182:2
Gt @ VM182:2
Kt @ VM182:2
getRoller @ VM182:2
eval @ VM182:2
eval @ VM182:2
t @ VM182:2
eval @ VM182:2
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
o @ app.js:1
t.renderMarkdown @ app.js:1
eval @ VM182:2
eval @ VM182:2
t @ VM182:2
build @ VM182:2
eval @ VM182:2
eval @ VM182:2
t @ VM182:2
render @ VM182:2
eval @ VM182:2
a @ VM182:2
Promise.then (async)
l @ VM182:2
eval @ VM182:2
t @ VM182:2
eval @ VM182:2
eval @ VM182:2
eval @ VM182:2
t @ VM182:2
roll @ VM182:2
eval @ VM182:2
checkCallback @ VM182:2
yL @ app.js:1
e.executeCommandById @ app.js:1
eval @ VM111:74
o @ VM111:23
command @ buttonTypes.ts:183
clickHandler @ button.ts:74
async function (async)
clickHandler @ button.ts:59
eval @ button.ts:47
s @ app.js:1
VM182:2 Uncaught (in promise) Error: Could not read file cache. Does the block reference exist?

Misc Dice Tables > artif18ts
    at Kt.eval (eval at <anonymous> (app.js:1), <anonymous>:2:123196)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2:69931)
    at new Promise (<anonymous>)
    at t (eval at <anonymous> (app.js:1), <anonymous>:2:69676)
    at Kt.getOptions (eval at <anonymous> (app.js:1), <anonymous>:2:123020)
    at Kt.eval (eval at <anonymous> (app.js:1), <anonymous>:2:122976)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2:69931)
    at new Promise (<anonymous>)

[Feature Request]Dice roller blocks by tag or keyword

If you want to combine dataview api with dice roller, the new feature could be stronger that because I have many notes tagged the same tag, and they are in same topic.

I think it will be nice to have a dice: 1d#tag or dice: 1d|Keyword, which will be fantastic for me.

Request: Roll lookup tables

It would be great if Table Dice could be extended to support D&D-style lookup tables.

If the Table a formula refers to has 2 columns, and the header of the first column is a formula itself, then roll that formula, find the first row that matches the result (either a range like 16-20 or comma-separated 1,8,16), and return the second cell of the row.

If the result is a dice formula as well, roll that too, which would easily allow some pretty complex random generators.

Example:

| dice:1d20   | Terrain Element          |
| ----------- | ------------------------ |
| 1โ€“3         | dice: [[Note^encounter]] |
| 4โ€“6         | feature                  |
| 7โ€“10        | hunting-ground           |
| 11,12       | resource                 |
| 13,14       | secret                   |
| 15โ€“20       | standard                 |

^terrain-element


| dice:1d% | Result  |
| -------- | ------- |
| 01โ€“50    | Nothing |
| 51โ€“60    | Hazard  |
| 61โ€“100   | Monster |

^encounter 

Rolling tables sometimes shows incorrect rows, links with trailing spaces don't work correctly

Hi,

I found two issues with rolling on tables. I have 7 tables on one page, the first table having 6 rows with inline dice rolls that roll for the 6 other tables. These inline rolls sometimes give the table separator row ( |---|---| ) as a result, sometimes the header row and sometimes even part of the block name link header thing (it shows"^very-" when the text on that line is "^very-common-plants". This can't consistently be reproduced however, it just sometimes... happens a few times.

Secondly, those 6 tables all have links to other pages in them. The result of the roll displays the link, but if there's spaces behind the linked text ("[[Other Note ]]"), the link in the roll result doesn't refer to the correct page and makes a new note. The original link being referred to, the one in the table, works fine however.

does not work in a table

does not work in a table

| Examples                                  |                                     |
| ----------------------------------------- | ----------------------------------- |
| `` `dice: 1d2` ``                         | `dice: 1d2`                         |
| `` `dice: 3d4 + 3` ``                     | `dice: 3d4 + 3`                     |
| `` `dice: 1d12 + 1d10 + 5` ``             | `dice: 1d12 + 1d10 + 5`             |
| `` `dice: 3d4+3d4-(3d4 * 1d4) - 2^1d7` `` | `dice: 3d4+3d4-(3d4 * 1d4) - 2^1d7` |

Copy all button

This was actually a bug with the copy button placement. There should be one button per block. Do you need a button to copy all of them?

Originally posted by @valentine195 in #13 (comment)

Sorry for the slow response, yes a copy-all button would be appreciated

(Hopefully small) Feature Request: command to reroll all dice on page

Hello! I'm back with a small feature request. As I'm building various generators with this plugin, I found that it would be Extremely convenient to have a command to re-roll all the dice on a page instead of clicking each individual dice or clicking off the page and back on. Then it can be combined with the buttons plugin (or even just as a hotkey!)

Thank you so much for all the work you've been doing ;u;

-1 modifier breaks click to re-roll

This formula dice: 2d6-1 only gets calculated once and it's always calculated as -1, and clicking on it doesn't re-roll.

E.g. dice: 2d6-1 gives me 2d6 -1 -> [4, 3] -1 -> -1

Formula without the -1 works.

Tested on 6.0.1

Allow Non-Math Seperators

When playing some systems you need individual values for multiple dice at the same time. (Ironsworn for example)

There you might want to have a roll like:

dice: Face Danger 1d6+3 vs 1d10, 1d10

This should result in something like:

Face Danger 7 vs 10, 8

AKA the end user would like to be able to copy the result as a unit and only click the roll button once. (This also allows for setting up single roll attacks in things like 5e.

dice: Battle Axe: 1d20+5 Damage: 1d8+3

Could return with dice details

Battle Axe: 17 [12] Damage: 8 [5]

For extra bonus it could even respect new lines & Spaces.

Battle Axe: 17 [12]
    Damage:  8 [5]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.