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

1480772495

Edited 1480774176
Not sure how but I broke the other thread, its not allowing posts or edits.  So below is the code figured out by  Silvyre unfortunately it doesn't work.  Not to sure how to get it to work.  When I roll a d20 ( which I changed it a bit I've added a ? to the d20 since it's suppose to default to two d20s along with the ability to purchase more d20s via game rules).   Regardless the results appear that it doesn't correctly count the successes.   For instance 2d20, result 4 and 14, should result in 3 successes.  If the target number is the default of 15 and 5.  4<15 and 4<5 = 2 successes.  14<15 but 14<5 does not work leaving 1 success.  It appears to be counting the result of one die (sometimes, I'm not even sure how it's sometimes) and not others. What am I doing wrong here? I'm just looking for something simple (or not....) to use for Star Trek Adventures using the 2d20 system that will allow me to run the game more smoothly.  If someone has experience in the 2d20 system I could really use the help here. [[ {{ceil((?{A|15} - d20cs<?{A}cf<?{B|5} + 1e-2) / (?{A} - ?{B})), 2 + 0d0}kl1, 0d0}kh1 ]] My code changes look like: [[ {{ceil((?{Skill Check|0} - ?{Number of d20s|2}d20cs<?{Skill Check}cf<?{Difficulty|0} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]]
1480784908

Edited 1480785035
Silvyre
Forum Champion
Volomon said: I changed it a bit I've added a ? to the d20 since it's suppose to default to two d20s along with the ability to purchase more d20s via game rules It's unfortunately not that simple to adapt this macro. You'll need to use an  Advanced Roll Query to handle multiple dice: /r [[ {{ceil((?{Skill Check|0} - d20cs<?{Skill Check}cf<?{Difficulty|0} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] ?{Dice Pool| 2d20, | 3d20, + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] | 4d20, + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] | 5d20, + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] + [[ {{ceil((?{Skill Check} - d20cs<?{Skill Check}cf<?{Difficulty} + 1e-2) / (?{Skill Check} - ?{Difficulty})), 2 + 0d0}kl1, 0d0}kh1 ]] }
Thanks alot exactly what I needed!
1480874993
Silvyre
Forum Champion
Great! Happy rolling!