Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ FR - choose the dice rolled to get data from a table #299

Closed
tyrcho opened this issue Feb 25, 2024 · 1 comment · Fixed by #330
Closed

✨ FR - choose the dice rolled to get data from a table #299

tyrcho opened this issue Feb 25, 2024 · 1 comment · Fixed by #330

Comments

@tyrcho
Copy link

tyrcho commented Feb 25, 2024

I'd like to control the dice rolled from the calling site and not only from the declaration site.

Exemples

  • dice: 1d8+4 [](page.md^bookmark) would pull only in the last 8 items from a table of 12.
  • dice: 1d11 [](page.md^bookmark) dice: 1d11 [](page.md^bookmark) would allow the 12th element of a table to roll twice on the other elements.
@tyrcho tyrcho changed the title ✨ FR ✨ FR - choose the dice rolled to get data from a table Feb 25, 2024
@matthewturk
Copy link
Contributor

For what it's worth, I was able to make this work by executing:

const roller = getRoller("[[Page^table]]");
await roller.getResult(); // to make sure lookupTable is created
roller.lookupRoller = getRoller("1d21 + 5")

lookupRoller doesn't get created until the first call to getResult, but after that it can be overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants