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 .
×

Macro: Include Modifier in Success/Failure

I have a number of macros that roll a d20 and has the possibility of a modifier as per the macro showing below. Unfortunately, the modifier, if it is not 0, is not included in calculating the success or failure of a roll. Here's the macro, it's all one line, but I did shift-return to break it into 3 for readability. It uses template:general which  is from the Advanced Dungeons & Dragons 1e character sheet: &{template:general} {{name=Turn Undead, @{selected|character_name}}} {{subtag= [Back](!turnundead)}} {{color=@{selected|color_option}}} {{Roll 10 or higher:=[[ ?{Modifier|0} + 1d20cs>10cf<9 ]]}} The screenshot below shows a macro mule macro with the exact same line as shown above (without the line breaks, of course). When running the macro, I entered 5 in the macro options modifier as you can see in the mouseover of the result. The actual d20 roll was 6 but with the +5 brought it to 11. Unfortunately, the 11 is colour coded as a red failure. It seems the success/failure criteria, 1d20cs>10cf<9, is evaluated  before  the 5 is added to the d20. Is there any way to reconfigure the the line so that the the modifier, if used, is included in the success/failure criteria? Thanks
I think this is what you want - the modifier is subtracted from the critical success and failure ranges?  &{template:general} {{name=Turn Undead, @{selected|character_name}}} {{subtag=  [Back](!turnundead)}} {{color=@{selected|color_option}}} {{Roll 10 or higher:=[[ ?{Modifier|0} + 1d20cs>[[10-?{Modifier}]]cf<[[9-?{Modifier}]] ]]}} In the case that you showed (a roll of 6 and modifier of 5), it would become:  [[ ?{Modifier|0} + 1d20cs>[[10-?{Modifier}]]cf<[[9-?{Modifier}]] ]] [[ 5 + 6cs>[[10-5]]cf<[[9-5]] ]] [[ 5 + 6cs>5cf<4 ]] The 6 is greater than 5, so the roll would be highlighted in green as a success, and the numbers would be added together to become 11 for the final result.
ok
Jarren said: I think this is what you want - the modifier is subtracted from the critical success and failure ranges?  &{template:general} {{name=Turn Undead, @{selected|character_name}}} {{subtag=  [Back](!turnundead)}} {{color=@{selected|color_option}}} {{Roll 10 or higher:=[[ ?{Modifier|0} + 1d20cs>[[10-?{Modifier}]]cf<[[9-?{Modifier}]] ]]}} In the case that you showed (a roll of 6 and modifier of 5), it would become:  [[ ?{Modifier|0} + 1d20cs>[[10-?{Modifier}]]cf<[[9-?{Modifier}]] ]] [[ 5 + 6cs>[[10-5]]cf<[[9-5]] ]] [[ 5 + 6cs>5cf<4 ]] The 6 is greater than 5, so the roll would be highlighted in green as a success, and the numbers would be added together to become 11 for the final result. Oh cool, Jarren, about to try this now. And it works! Thanks very much.