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

Macro: choose "keep high" or "keep low" in roll

Hello, I am running a system that uses a pool of d6, compared to a target number, to determine degrees of success. It also uses Bonus and Penalty dice, which add dice to the pool and then remove the lowest or highest dice (respectively) after rolling. Rolling in the text chat is fairly straightforward. For example, 2d6 with 1 bonus die and a target of 4+ looks like this: /r 3d6kh2>4 Or 3d6 with 2 penalty dice and a target of 2+: /r 5d6kl3>2 I have figured out how to make a macro for a roll that includes Bonus dice: /r (?{dice}+?{Bonus})d6kh?{dice}>?{Target} But I would need a separate macro for rolls with Penalty dice. I am looking for a way to have 1 macro that can cover all available dice configurations. Ideally the user would enter the number of base d6, the number of bonus/penalty dice (negative for penalty, 0 for a flat roll) and the target number, but I would be happy with selecting bonus/penalty from a dropdown menu. My experiments with nested macros and putting the above macro in a roll query have not been successful. Any advice?
1716163135

Edited 1716163176
GiGs
Pro
Sheet Author
API Scripter
Yoi can change this part kh to include a query like k?{High or low?|High,h|Low,l} That way you don't have to worry about nesting.
I did not know it was possible to evaluate text like that. Thank you!