2
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

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.

\$\endgroup\$
0
3
\$\begingroup\$

See the full application of this in my answer to the related question.


  1. Make a Rollable Table "0" and a Rollable Table "1"
  2. Enter one or more phrases indicating Success in Table "1" and Failure in Table "2"
  3. Make a macro using the syntax [[1t[ [[(roll)>(target)]] ] ]]
  • The roll is use to parse "1t[ ... ]" into a Rollable Table Call, and the > operator provides a 1 (successful) or 0 (failure) output, meaning the appropriate Rollable Table will be called and presented instead of the normal roll output.

Your other answer isn't actually correct; {} brackets allows your +6 to be added before comparing to the rest of the roll, but putting ?{{Spell level} + 12 in it's own [[]] roller doesn't allow it to be compared to your 1d20+6> . The best solution I cold come up with is a drop-down variable to replace manually entering spell levels; this allows you to add the 12 directly in so the > is comparing to exactly one number instead of 12 (then adding spell level).

&{template:default} {{name=Soul Check}} {{ [[ {1d20+6}>?{Level?|1,13|2,14|3,15|4,16|5,17|6,18|7,19|8,20|9,21} ]] }}

I'm assuming spells don't go above level 9, as is the case with default D&D 5e. Of course you can edit the number of entries, following the progression, to expand on that.

The output of the above macro is either 1 for success or 0 for failure.

\$\endgroup\$
2
  • \$\begingroup\$ I experimented by changing the macro to {{ [[ {1d1+6}>[[?{Spell level} + 1]] ]] Success }} and it seems to work as expected (i.e. spell level 6 succeeds as the comparison is equal-or-greater, but spell level 7 fails). \$\endgroup\$
    – Haem
    Dec 28, 2021 at 21:26
  • \$\begingroup\$ @Haem That's strange bc when I tested the whole statement from your answer, I didn't get results as expected. \$\endgroup\$
    – Ifusaso
    Dec 29, 2021 at 19:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .