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

crit success and crit failure in the same macro

1585609949

Edited 1585610015
Hello, I'm trying to define as any roll below a certain number to be a crit failure, so that it's outlined in red, and any roll above to be a crit success so that it's outlined in green. There is a roll, a modifier, and a value pulled from the selected token's journal entry. My partially working macro is [[ 1d20cf<@{selected|PPDM}+?{Modifier|0}cs>@{selected|PPDM}+?{Modifier|0}} ]] This will properly outline in red, however it will only outline in green on a die roll of 20. If I switch the order, so that the crit success expression is listed first, then it will correctly outline passed rolls in green, however it will cease outlining failed rolls in red (unless the die roll is a natural 1). Could someone please help me figure out what I'm doing wrong? Apologies if this is an simple question, my group just started playing online because of the virus.
1585610609
GiGs
Pro
Sheet Author
API Scripter
When the cs or cf number is a calculation, you have to enclose it in inline brackets so roll20 knows the parts are a single number, like so [[ 1d20cf<[[@{selected|PPDM}+?{Modifier|0}]]cs>[[@{selected|PPDM}+?{Modifier}}]] ]] You can nest inline rolls like this multiple times, just be careful to close all the brackets. Also when using the same query multiple times (like Modifier above), you only need the |0 part in the first instance. It doesnt make much difference here, but its handy to know for the future.
1585610638

Edited 1585610699
Kraynic
Pro
Sheet Author
You need to make sure that each of those gets calculated and resolved to a single number before anything else is calculated.  The way to go about that is with more square brackets: [[ 1d20cf<[[@{selected|PPDM}+?{Modifier|0}]]cs>[[@{selected|PPDM}+?{Modifier|0}}]] ]] One thing about that set up though, is that you end up with critical failure and critical success overlapping on one number.  If your roll is that number, you end up with a blue outline (signifying both fail and success).  If meeting that number is a success, you might want to add a -1 in the critical failure calculation: [[ 1d20cf<[[@{selected|PPDM}-1+?{Modifier|0}]]cs>[[@{selected|PPDM}+?{Modifier|0}}]] ]] Edit: Sniped by GiGs!
GiGs said: When the cs or cf number is a calculation, you have to enclose it in inline brackets so roll20 knows the parts are a single number, like so [[ 1d20cf<[[@{selected|PPDM}+?{Modifier|0}]]cs>[[@{selected|PPDM}+?{Modifier}}]] ]] You can nest inline rolls like this multiple times, just be careful to close all the brackets. Also when using the same query multiple times (like Modifier above), you only need the |0 part in the first instance. It doesnt make much difference here, but its handy to know for the future. You're a god GiGs. Thank you very much!
1585611119

Edited 1585611197
GiGs
Pro
Sheet Author
API Scripter
Kraynic said: Edit: Sniped by GiGs! I've still got it! and you're welcome Mitchel. Good point on the overlap, Kraynic. I didnt look too closely at the calculation, but do find it weird that modifier is being applied to both cs and cf.