javalent / dice-roller

Inline dice rolling for Obsidian.md
269 stars 28 forks source link

Allow Non-Math Seperators #61

Open HAJ523 opened 2 years ago

HAJ523 commented 2 years ago

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]
valentine195 commented 2 years ago

Let me think about this. It would be a little bit complicated and probably require a structural change to the way the lexical parser and dice stack builder works.

HAJ523 commented 2 years ago

Just a note that there is a less that ideal workaround for this by putting your "future roll" into a table that can only return 1 result you can use the nesting feature to make multiple rolls like this at once. You are limited to 1 line however.

Janrith commented 1 year ago

Any additional thoughts on this? I'm finding scenarios where this could be really useful as well. My thoughts are something like 5d4<?> would display 1, 2 ,4 ,5, 3.

Right now, I use add "|form" to my rolls and get a result like 1+2+4+4+3=15, which is a bit clunky.

Maybe an MVP first step could be something like: d10, d8, 2d4+4, d2 and have each result be in a CSV output matching the CSV input.

Just a thought.

Janrith commented 1 year ago

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]

This seems like it could be saved as in an admonition like "Battle Axe: dice: d20+5' Damage:dice: d8+3" rather than having the die roller have to parse out the non-die related components. But I could see something likedice: d20+3, d8+3` returning 17, 5.

Janrith commented 1 year ago

MapTool calls this the "open" syntax, they use e.g. 5d10o (o=open). Their implementation includes an explode (they don't have one that doesn't), but it would be great to have just the die results w/o the explode.

Not sure if this helps or not. https://wiki.rptools.info/index.php/Dice_Expressions (1/2 way down in the General Dice Expressions list).

ladz commented 1 year ago

I don't know if that's an option: Combined with the Templater Plugin you can achieve just that.

sigrunixia commented 1 year ago

Limited implementation of this has been achieve, but evaluating if more is needed. Further may assist with #142.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

derSebastian commented 11 months ago

I'd love to see a method for games that use comparative rolls as well. At it's simplest form it could display the values rolled. An intermediate version might allow you to add modifiers to each die. And an advanced version might show the roll and interpret this. Games Like Ironsworn and Starforged use this mechanic.