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 Macro for Star Trek Adventures

1480732425

Edited 1480732450
Ok I'm playtesting Star Trek, in the system they have double target numbers.  For example 15 and 5.  If you roll a d20 and get a 4 for example you get two successes, 4 is under both 15 and 5.  If you rolled a d20 and got a 19 it's above both 15 and 5 resulting in a failure.  That leaves you with two successes.  Is there any way I can write a macro that takes into account adjustable difficulty (target numbers). I'm reasonable decent at macros but this has me stumped.
A simple way to represent multiple successes is using Roll Highlighting . e.g. [[ 1d20cs<15cf<5 ]] highlights green for one success and highlights blue for two successes
Here's a macro that does the calculation: [[ {{ceil((?{A|15} - d20cs<?{A}cf<?{B|5} + 1e-2) / (?{A} - ?{B})), 2 + 0d0}kl1, 0d0}kh1 ]]
Ok I see how you did it in there (not so much the calculation part) but what about if it's modular say the difficulty for the next roll is 12 and 1?  Can I use something there to change it like the modifier?
?{A} is the Roll Query that takes the place of the higher target number. ?{B} functions likewise for the lower target number. You can use Roll Queries to easily modify a roll. Does that answer your question?
Oh I see, I get it.  Thanks.
Not sure what going on here but it's not working correctly. (REMOVED)