Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Formulas in dice expressions

1428526550

Edited 1428527333
I know that I can nest dice expressions. /r [[2d6]]d6 works for example. But is there a way to nest inline rolls? [[[[2d6]]d6]], for example, does *not* work. Adding parenthesis doesn't help - [[([[2d6]])d6]] also doesn't work. Likewise, I know that [[@{class-0-level}d6]] will correctly roll however many d6 a character has of that class. But [[round(@{class-0-level)}/2)d6]] does not. Is there any way to get round() or floor() to work inside a dice expression? Not having to manually rewrite the class features that advance by 1 die on every odd class level would be nice. edit: further experimentation seems to show that [[(@{class-0-level}/2)d6]] is rounding up automatically.
1428528631
Kryx
Pro
Sheet Author
API Scripter
You cannot nest inline rolls. Round and floor are evaluated at the end of the function and cannot be used with Dice rolls. Sorry. :(
Having discovered that fractional numbers of dice are just rounded off automatically, I no longer have any real need to round or floor expressions for dice purposes anyhow.
If you want fractionals floored -0.5 ceiling +0.5
We are working on nested inline rolls, they will be available on the Dev Server very, very soon.
1428590359
vÍnce
Pro
Sheet Author
Riley D. said: We are working on nested inline rolls, they will be available on the Dev Server very, very soon. Backflip.
Riley D. said: We are working on nested inline rolls, they will be available on the Dev Server very, very soon. That has to be one of the greatest reveals I have seen to date!