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

Conditional Macros for Critical Success/Fail

Hello! I want to create a simple d20 roller that displays different messages for critical successes/fails. Here's what I've got so far. /me rolls [[1d20cf&lt;1cs&gt;20]] &amp;{tracker} for Initiative and adds +3 DEX to it!&nbsp; [text](<a href="https://cdn.cardsrealm.com/images/cartas/crop/c14-commander-2014/goblin-welder-177-med.jpeg" rel="nofollow">https://cdn.cardsrealm.com/images/cartas/crop/c14-commander-2014/goblin-welder-177-med.jpeg</a>) The text turns green when you roll a natural 20 and red for natural 1. I'm trying to figure out how to insert a conditional statement for each one. If I roll 20, then display message 1 If I roll 1, then display message 2. I've been looking for an answer in the forums but all I've got is: "Nope, conditionals are only supported by APIs." Has anyone ever created macro like this for their games?
1602658589
GiGs
Pro
Sheet Author
API Scripter
Unfortunately you already have the answer: "Nope, conditionals are only supported by APIs."&nbsp; Also, reporting text based on a dice roll is also not supported. Oosh has a method of modifying a rolltemplate to show only one of two entries, but both lines always get printed out - just one line is empty. So its not ideal.
1602724162

Edited 1602724254
Oosh
Sheet Author
API Scripter
How desperate are you to achieve this? You can use rolls to select images, but it's not going to work as part of an initiative roll. 1d2 example: [[ [img](<a href="https://tinyurl.com/r20example[[1d2]]#.png" rel="nofollow">https://tinyurl.com/r20example[[1d2]]#.png</a>) (roll was $[[0]]) You can call the roll with $[[0]], but you can't operate any further on it. It's also a bit of setup.
Oosh said: How desperate are you to achieve this? You can use rolls to select images, but it's not going to work as part of an initiative roll. 1d2 example: [[ [img](<a href="https://tinyurl.com/r20example[[1d2]]#.png" rel="nofollow">https://tinyurl.com/r20example[[1d2]]#.png</a>) (roll was $[[0]]) You can call the roll with $[[0]], but you can't operate any further on it. It's also a bit of setup. For the RP, kinda desperate. Thank you for this! Can you explain how $[[0]] functions?
1602739452
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here is a whole passel* of links from the&nbsp; Stupid Tricks &nbsp;thread: Re-using Rolls &nbsp;- Scott S. (More info:&nbsp; Reordering Rows &nbsp;- GiGs) Using the Turn Tracker For Storing Last Roll &nbsp;- GiGs Reusing Rolls—Two Roll Results With No Doubles &nbsp;- Persephone Reusing Rolls - Rolltemplate Helper functions &nbsp;- GiGs &nbsp;(for character sheet creation) Reusing Rolls (Advanced) &nbsp;- Gibli *Exactly one passel--I counted.