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

D&D 5e - Universal Cantrip Formula (Works, just not with rolls)

1422391187

Edited 1422402425
Hey all, I wanted to share with you a formula I figured out for calculating the number of dice to roll in a cantrip in 5e. You start with 1 die at level 1, then increase it to 2 at level 5, 3 at level 11, and 4 at level 17. My DM Kevin figured out one way of rolling it in a macro, but it involved rolling all 4 dice every time, and it would just multiply each die by 0 if you were under a certain level. The problem is that the roll-over text in the chat bar would be near-impossible to understand. I took his basic formula and entered it into a graphing calculator, and fiddled with it until it outputted the correct numbers for each level. Here is that formula: (round((floor((x)/5)/4)+.25))+(floor((x)/11))+(floor((x)/17))+1 Substitute X for whatever your level attribute is. This formula will work perfectly up to level 20, after that things get... wonky. Here is a graph output of the formula: The additional colored lines at the bottom show the output of each of the 3 sections of the formula (for levels 5, 11, and 17). Then you take the sum of each section, and add 1. The problem is that apparently if you use floor/ceil/round to calculate the number of dice to roll in a macro, the parser throws a fit. Hopefully they'll fix that issue in a future update.
Oh I'm an idiot! This whole time I thought it wasn't a linear function, due to the increment between level 5 and the rest of the levels. But it is a linear function, it's just offset by -1 on the y axis! So here is a muuuuch much much simpler formula: (floor((x+1)/6)+1) And if we ever increase the level cap to 30 (or higher) there's a good chance that the dice increases will be a level 23 and level 29.
1422395746
Lithl
Pro
Sheet Author
API Scripter
When calculating the number of dice to roll, round(x) is automatically applied to the formula. Therefore, you can use [[((x + 1) / 6 + 0.5)d4]] for example, to roll the appropriate number of d4s. This is consistent with your supposition for extending the level to 30, too. =)
Oh excellent, thank you!
This is a beautiful and simple macro, thanks very much for this, it will greatly simplify the DnD 5E damage macro's! Thanks!
i can hear all my past, present, and future spellcasters loving you long time.