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

Minimum rolls

Okay, I have been looking at a few things and I know there is a way to program minimum rolls in macros, but everything I have been reading just seems to confuse me.  So, in an earlier post I was having difficulty because a calculation I had was coming up as a success on a natural -1 on a d20 and thus messing up the macro. I was given the following to fix the problem, which worked beautifully. [[1d20cs>[[{(@{target|bar2}+10)-(20-@{selected|weapon1critmin})-(@{selected|meleeattackbonus}+@{selected|weapon1enh}+@{selected|weapon1focus}),0}kh1 ]]+(@{selected|meleeattackbonus}+@{selected|weapon1enh}+@{selected|weapon1focus}),0}kh1 ]] However, I tried adding the ,0}kh1 to the damage roll and it didn't work. This is what I have. [[(floor({@{selected|weapon1damage}+{@{selected|weapon1damagestat}}})+@{selected|weapon1enh} +@{selected|weapon1specialize})]] I tried this. [[(floor({@{selected|weapon1damage}+{@{selected|weapon1damagestat}}})+@{selected|weapon1enh} +@{selected|weapon1specialize}),0}kh1]] This doesn't change the macro in any way and I still get negative totals when there is a negative modifier.  So, what am I doing wrong, and can you explain why it is wrong for future reference.
1517604904

Edited 1517605058
vÍnce
Pro
Sheet Author
Make sure to isolate what you're trying to round and make sure to encapsulate that within parenthesis ie floor(computations to be rounded down)  Also, when using kh1, kl1 make sure to adjust your left/right braces {} to include exactly what you want to compare. I believe the braces weren't properly placed in your damage macro above. try this; [[ {floor(@{selected|weapon1damage} + @{selected|weapon1damagestat} + @{selected|weapon1enh} + @{selected|weapon1specialize}),0}kh1 ]]
Doesn't seem to work. It comes up with "Cannot mix sum and M rolls in a roll group" error.
1517638046
vÍnce
Pro
Sheet Author
You're right.  ;-(  hmmm.  I added inline rolls to the inner attributes and I no longer get the error...   [[ {floor([[ @{selected|weapon1damage} ]] + [[ @{selected|weapon1damagestat} ]] + [[ @{selected|weapon1enh} ]] + [[ @{selected|weapon1specialize} ]]),0}kh1 ]]
Thanks. It works.  And thanks for the explanation.
1517673392
vÍnce
Pro
Sheet Author
Shem A. said: Thanks. It works.  And thanks for the explanation. Cool. When I troubleshoot or begin setting up macros, I often just substitute "hard" numbers for attributes to help eliminate/isolate any visual confusion so it basically looks like a simple math problem, then once I can see the math works, I substitute the attributes back in.  I also like to space things out.  Inline rolls like having space before and after each pair of square brackets.  Have fun.