Show “Success” or “Failure” in roll20 macros

roll20

I'm setting up Roll20 macros to play Frostmark, a DnD 5e derivative that has a mana mechanic of sorts; Spells are powered by souls and if you fail a soul check when casting a spell, you lose the soul you were using to power the spell.

I'm trying to set up a macro for that, which is here (DC is 12+ spell level, relevant modifier is +6).

&{template:default}{{name=Soul check}}{{ [[ 1d20 + 6 > [[?{Spell level} + 12]] ]] }}

Right now, it's just showing the roll result and mousing over is showing e.g. 1d20+6>17 = (14)+6

I want it to say "Success" or "Failure" in the macro result, or at least the "0 successes" or "1 success" you get when using roll commands.

Best Answer

As I was writing this question, I managed to figure it out. The syntax requires that the roll be enclosed in {}, so the correct formula is

&{template:default}{{name=Soul check}}{{ [[ {1d20+6}>[[?{Spell level} + 12]] ]] Success }}

As far as I can tell, there is no if/else in the macros, so closest to a solution to get it to say "Success" or "Failure" that I can find would be to use Mike deBoston's conditional text method to choose the text; Set up two tables, sf0 with the item "Failure" and sf1 with the item "Success" and request a roll from a table.

I only ever got to

&{template:default}{{name=Soul check}}{{ [[1t[sf[[ {1d20+6}>[[?{Spell level}+ 12]] ]] ]] }}

Which is outputting[[ 1t[sf0. I have asked about this separately, but I suspect this is not possible.