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

Help! How to display a different nested macro depending on wheather a certain DC was reached in the main macro.

I'm making a Short Campaign where the players have some "bound" NPCs that can get infected by a plague that's rampaging through the city (yes, it's pathologic inspired). I want to make a macro where,  every evening each NPC will have a chance to either advance in their infection to the next stage or resist it for the night. For this, I set up 2 macros, one which says the plague was resisted for now along  with a flavour image and another which says it advances with another flavour image. Now I'm struggling to make the main macro. I want it to have a quary which asks for "resistance" and adds it to a d10 rolled. If they roll an 8 or above, they  resist for the night, if they roll below, the infection continues. So, for that, I want to set the DC to 8, and depending on wheather the DC was reached, display one of the other two macros. I tried to look online how to do this, but I simply can't find anything. Will appriciate any and alll help!
1696945617
timmaugh
Forum Champion
API Scripter
Hey, Peter... Adding a die roll to a number isn't too complicated. From a query: [[ ?{Resistance|0} + 1d10]] From an attribute: [[ @{Character Name|resistance_attribute} + 1d10]] But running a result conditionally (running this macro if a test passes, running another if it fails) can't happen without having access to mod scripts. If scripts are available, you could do this with either ScriptCards or the MetaScriptToolbox. I wrote the MetaScriptToolbox, so if scripts are available I can demonstrate how it could rapidly iterate over your NPCs and roll for each of them.
I am using the plus subscription so I believe APIs are, in fact possible!  I don't want to create something too complex. Just a simple button where we can put in the resistance manually and it displays a different result of flavour text and image depending on if the check was passed or not. I'd gratly appriciate any help you can give me with this.
The game creator needs a Pro subscription in order to use Mod (API) scripts.
1696967611
GiGs
Pro
Sheet Author
API Scripter
Peter said: I am using the plus subscription so I believe APIs are, in fact possible! You need Pro not Plus for APIs. Also its the subscription of the game's creator that matters, not individual players.