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

DnD 5E Cantrip Macro

While this is specific to DnD 5E, the problem is more generalized. For most damaging cantrips in 5e you get 1dX of damage from 1st to 4th level, then 5-10th you get 2dX, 11-16th you get 3dX, and 17-20 you get 4dX. So I tried to create the following macro where level is pulled from the autocalculated level as defined on the sheet: [[(1+{floor((@{level})/5),1}kl1+{floor((@{level})/11),1}kl1+{floor((@{level})/17),1}kl1)d8]] Now this part "(1+{floor((@{level})/5),1}kl1+{floor((@{level})/11),1}kl1+{floor((@{level})/17),1}kl1)" works absolutely as I would expect, giving me the exact number of dice I need based on character level. When put that in front of a d8 it completely ignores the d8 portion of the roll, not generating an error, it simple gives me number of dice as the result. I can make this work, but the output is significantly more complex making it hard to see what was actually rolled (due to the huge amount of output from autocalculated formulas): [[1d8+{floor((@{level})/5),1}kl1*1d8+{floor((@{level})/11),1}kl1*1d8+{floor((@{level})/17),1}kl1*1d8]] Is there a reason while the first example just doesn't factor in the "dX"?
Unfortunately there's some quirks with calculated dice rolls that prevent certain calculations from working correctly. What you could do is move the "d8" outside of the inline roll, though it results in the 3d dice instead of inline results. /r [[(1+{floor((@{level})/5),1}kl1+{floor((@{level})/11),1}kl1+{floor((@{level})/17),1}kl1)]]d8 I haven't found a way to get around this, for a while, now.
Mark, thanks very much! I noticed that this would work as well, I am trying to integrate the roll into power cards, so this really isn't a great option.
1422388367

Edited 1422388621
I know this works as well. I set this up for a wizard and Firebolt. It will scale with his given level, roll the additional dice, etc. The downside is that it will always roll every single dice that can be rolled (4d10), but it will ignore the ones that have not reached the given level thresh hold. I have this integrated into the Character Sheet to trigger a PowerCard, so I know it works. [[1d10 + {floor(@{level}/5),1}kl1*1d10 + {floor(@{level}/11),1}kl1*1d10 + {floor(@{level}/17),1}kl1*1d10]] You can add [Tags] inside your roll to help identify what is what: [[1d10 + {floor(@{level}/5),1}kl1*1d10 [Level 5 increase] + {floor(@{level}/11),1}kl1*1d10 [Level 11 increase] + {floor(@{level}/17),1}kl1*1d10 [Level 17 increase] ]] edit: I realize this is almost identical to what you had earlier, and my apologies for that. This is, however, about the only way to automatically increase based upon level increase. If you think this is bad, you should see what I had to come up with to deal with a barbarian's rage damage increase....
No worries, once you mentioned power cards I'm sure a bunch of folks will be jumping in shortly to lend a hand. I've next to no experience with the API, myself. If you're working on power cards, you might have a better response posting in the API forums though.
1422398536
Gen Kitty
Forum Champion
Sadly... my answer is to hardcode the powercard and just remember to review your cards every level. It's what I do. It also makes the tooltip cleaner when hovering over the inline dice result.
Actually, one of my players (Andrew) and Brian managed to come up with a simply beautiful formula for this that will greatly simplify things: [[((@{level} + 1) / 6 + 0.5)d8]] This works perfectly from levels 1-20 and looks to continue linearly. This will use the level to perfectly set the cantrip damage die, so big thank you to Andrew and Brian for hashing out the details, as it greatly will simplify the macros and tidy up the output.
1422401635

Edited 1422401642
I'll have to implement that one myself for my guys. I'm still trying to figure out a more simple method for calculating rage bonus damage for my brother's barbarian. The formula works, but I'll be damned if WotC didn't come up with the most bizarre way to determine when to increase. Throwing this out there for those who may have a barbarian and want this included in their damage macros. Granted, there is nothing else rolled, but it still works nicely so he doesn't have to apply two separate macros -- one for raged, one for not. [[@{meleedmg1}+@{meleedmgbonus1}+{floor((?{Raged? (1 if yes)|0})/1),1}kl1*({floor((@{barbarian_level})/9)+{floor((@{barbarian_level})/16)}}-{floor((@{barbarian_level})/18)}+2)]]