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

Extremely frustrating error when trying to set a maximum value to a roll with a modifier

I'm trying to make a macro that rolls a character ability which does the following: Roll the character's base damage (a number of d6 (in this case, 3) with a modifier (in this case, +8)) and that number cannot be higher than half of the same character's Defense score (which is 23, halved to 11.5). In other words, roll 3d6+8 with a maximum of Defense/2. But this section of the macro is giving me issues: {{Damage=[[{(3d6+8)/2, 11.5}kl1]]}} It throws me this error: Cannot mix M and sum rolls in a roll group Changing 11.5 to @{Defense}/2 like I would prefer spits out the same error but the M and sum are reversed. I have absolutely no idea what to do about this. It is very annoying because nearly everything in the game I'm running works like this: Roll with a modifier and have a maximum cap on the result. Can I get some help? Perhaps a workaround?
1756609961

Edited 1756610144
Gauss
Forum Champion
Hi Lucifina,  The problem is you have a roll and a non-roll in the kl1 calculation.  There are two solutions.  1) Eliminate the roll, you can do this by enclosing it inside double inline brackets like this:  {{Damage=[[{(  [[ 3d6 ]]  +8)/2, 11.5}kl1]]}} 2) Add a roll, you can do this like this:  {{Damage=[[{(3d6+8)/2, 1d0+ 11.5}kl1]]}} I have bolded the changes in both versions. 
The problem is you have a roll and a non-roll in the kl1 calculation.  There are two solutions.  1) Eliminate the roll, you can do this by enclosing it inside double inline brackets like this:  {{Damage=[[{(  [[ 3d6 ]]  +8)/2, 11.5}kl1]]}} 2) Add a roll, you can do this like this:  {{Damage=[[{(3d6+8)/2, 1d0+ 11.5}kl1]]}} Thank you, I chose to go with method 1. Had no idea that would work or why it does.
1756612856

Edited 1756612880
Gauss
Forum Champion
Here is why it works {X,Y}k1 X and Y must both be a roll, or neither be a roll.  In the case of {1d6,15}k1 you have a roll and a non-roll. It won't work.  If you wrap 1d6 in inline brackets that rolls it before resolving the rest.  That gives us: {[[1d6]],15}k1 Because of [[ ]] the 1d6 is rolled before resolving the rest of the calculation. Lets assume it is a 3. That becomes {3,15}k1 Now neither are rolls and the {X,Y}k1 can work properly.