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 with a Macro for 2d20 system Star Trek Adventures

Hello, I was hoping I could get some help my macro. I am very close but seem to be missing one thing. /me is using the appropriate skills to beat the Target Number ?{Target Number} /r ?{D20's}d20cs<?{Focus}cf>20<?{Target Number} Currently everything works but one portion. The Focus value entered by a player should represent the Critical Success threshold for the roll. So if a player inputs "3" for focus, then they would achieve a Critical Success for a roll of 3 or lower on the any d20. A critical success should be counted as 2 successes, instead of just one. But, right now, when it calculates, it thinks a 3, in our above example is just 1 success. How can I modify this so it knows that a Critical Success counts as 2 Success, instead of just 1? Thanks for any help.
1489699097
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You can't do this with the target number syntax. There is a workaround using rollable tables, but it will require many  rollable tables as you would need a table for every possible combination of focus and target number. Assuming that both focus and target can be any number between 1 and 20, this would result in 400 tables required. Unfortunately, the best you're going to be able to do without an API script (pro perk) is to do what you have above and just use the color coding for identification of double successes.
Thanks for the info, and the roll-able table thing sounds interesting, I believe the focus number doesn't go above 5, as it is treated like a skill rank. Do you think that would be doable?
1489711536
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
How many various target numbers are there?
1489719226

Edited 1489719250
I actually wrote a macro for this a little while back: <a href="https://gist.github.com/Silvyre/1161d0b19a7b94db3c897440d25e6547#file-2d20-skill-chec" rel="nofollow">https://gist.github.com/Silvyre/1161d0b19a7b94db3c897440d25e6547#file-2d20-skill-chec</a>
1489726067
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Silvyre, you never ceases to amaze
Thanks for the post Silvyre, and I had searched and found this Macro before, but I noticed it behaved very strangely. The first 2 times I use it, works great, does exactly what I would expect it to do, but after that, and having changed nothing except to add it to the Macro Bar and let all the players use it, it breaks, and doesn't work any longer. It starts reading like this in the chat, and wont work again. Lucien (GM): rolling Rolling {{ceil((15 - d20cs&lt;15cf = {{ceil((15-(&lt;span class="basicdiceroll critsuccess "&gt;8&lt;/span&gt;)+0.01)/(15-3))+2+()}+()}"&gt;1 + Rolling {{ceil((15 - d20cs&lt;15cf = {{ceil((15-(&lt;span class="basicdiceroll critsuccess "&gt;14&lt;/span&gt;)+0.01)/(15-3))+2+()}+()}"&gt;1 - d20cs&lt;15cf 1+1-(16)+0.01 = -13.99 } rolling Rolling {{ceil((15 - d20cs&lt;15cf20 + 1e-2) / (15 - 5)), 2 + 0d0}kl1, 0d0}kh1 = {{ceil((15-(&lt;span class="basicdiceroll critsuccess "&gt;11&lt;/span&gt;)+0.01)/(15-5))+2+()}+()}"&gt;1 + Rolling {{ceil((15 - d20cs&lt;15cf20 + 1e-2) / (15 - 5)), 2 + 0d0}kl1, 0d0}kh1 = {{ceil((15-(&lt;span class="basicdiceroll critsuccess "&gt;7&lt;/span&gt;)+0.01)/(15-5))+2+()}+()}"&gt;1 - d20cs&lt;15cf20 + 1e-2) / (15 - 5)), 2 + 0d0}kl1, 0d0}kh1 ]] | 1+1-(11)+0.01 = -8.99 4d20, + 2 + 2 | 5d20, + 1 + 2 + Rolling {{ceil((15 - d20cs&lt;15cf20 + 1e-2) / (15 - 5)), 2 + 0d0}kl1, 0d0}kh1 = {{ceil((15-(&lt;span class="basicdiceroll"&gt;19&lt;/span&gt;)+0.01)/(15-5))+2+()}+()}"&gt;0 }
This macro uses HTML replacements, and if it was ever opened up, that would break it.&nbsp; To make it accessible to players, but not give them the ability to open it (and thus break your macro) here are the steps to follow (not my own, I saw someone else's solution to this issue posted on the forums, but don't remember who it was, so I can't give proper credit): 1. Create a new character (you can call it "2d20 Check" if you want, doesn't really matter) 2. Copy and paste the macro text from Silvyre's github into a character ability 3. Check "Show In Macro Bar" on the ability, 4. Give all players control of the character, 5. Then save and close the sheet, and archive it, without opening the ability. That should work for you, then the macro will be in the bar, but no one but a GM will be able to open it up. Hope this helps!