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] Rule of 10 Redux

1416426158
Tom
Plus
Sheet Author
Hey all, I need a some help fine tuning a macro. The game system I'm working with is a pretty standard d10 dice pool system (ala L5R, 7th Sea, xWoD). It caps the player's dice pool at 10 dice and converts every 2 dice beyond that to 1 success. So if I was able to accumulate a dice pool of 14 dice for a roll, I would roll 10 dice and add 2 bonus successes to the results. I asked about this about a year ago. Thankfully, Brandon W came through with a great solution: /roll [[(@{Ability}+@{skill}+?{modifiers|0})d1kh10]]d10!sd>7 [[floor(((@{Ability}+@{skill}+?{modifiers|0})-10)/2)]] bonus successes, ignoring results < 0. While this works fine, I wonder if there is a way to zero out negative results in the second line. So that if the result of [[floor(((@{Ability}+@{skill}+?{modifiers|0})-10)/2)]] bonus successes is less than 0, it just returns a result of 0. Or even better, if less than 12 dice are rolled, the second emote, "# bonus successes..." never even comes up. Any ideas? This level of macro wizardry is beyond me. Thanks! (And thanks again, Brandon!) Tom
a Keep Highest comparison will do that for you. Example [[ { 0 , floor(((@{Ability}+@{skill}+?{modifiers|0})-10)/2) }kh1 ]] Will always give you the calculated result or a 0 , depending which is higher
1416472855
Pat S.
Forum Champion
Sheet Author
Tom said: While this works fine, I wonder if there is a way to zero out negative results in the second line. So that if the result of [[floor(((@{Ability}+@{skill}+?{modifiers|0})-10)/2)]] bonus successes is less than 0, it just returns a result of 0. Or even better, if less than 12 dice are rolled, the second emote, "# bonus successes..." never even comes up. (I bolded the part I'm responding to) That is more of an if then statement that the roller can't do. You might want to look into the API aspect (since you're a mentor) for the second emote being used or not based on the first. I would recommend you posting an inquiry in the API boards if you don't want to do it yourself.
1416489847
Tom
Plus
Sheet Author
Pat, yeah, I figured the API could do it. This is a feature I'm hoping to build into my character sheet, so I'd rather not lean on the API. So I was hoping their might be a trick, or a way to more elegantly express this macro. Right now, I'm throwing it in the mix for testing, even though my players aren't rolling even 10 dice consistently. So I'm open to ideas. As great as Brandon's and Mark's solutions have been, if someone has a way to express this more seamlessly, I'm all ears. It's not as though this is the only game that does this (hello, L5R character sheet!).
1416489938
Tom
Plus
Sheet Author
Btw, Mark, thank you! That's perfect! I thought I'd posted something to that effect last night, but I guess not. Consider it tested and added to the mix.
1416522744
Gen Kitty
Forum Champion
I have an idea, but it's kind of ugly. If you start a line in a macro with a !WORD it immediately tries to find an API in the sandbox that responds to that WORD, and if there isn't one that line of the macro will silently not-execute, but the other lines in your macro will work as normal. You can take advantage of this to do a sort of 'runtime IF' operation. /roll [[(@{Ability}+@{skill}+?{modifiers|0})d1kh10]]d10!sd>7 ?{BonusSuccesses?|!} [[floor(((@{Ability}+@{skill}+?{modifiers|0})-10)/2)]] bonus successes, ignoring results < 0. When the time comes to use the macro if you have bonus successes, you clear the ! from the query box and everything continues as normal. But this relies on you knowing when you make the roll if you have more than 12 dice, because this can NOT be automated without API. I hope this helps you!
1416575995
Gauss
Forum Champion
Just a note, using ?{query|!} calls the API but you do not need to be a Mentor to use it (putting a script in your game requires being a Mentor, calling the API does not). If you do not have an API script that matches whatever follows the "!" then it will just comment out the line as GenKitty explained.
1416589044
Tom
Plus
Sheet Author
GenKitty, Interesting solution. Gotta give props for inventiveness. But it's just not practical. At that point, its easier just to put up a Rule of 10 Macro in the macro bar for all the players to access. It wouldn't be as elegant as having it tap directly into their character traits - they would have to plug in their dice pools and mods manually – but that's easier to do in a pinch than open up the guts of a macro and change it on a case by case basis. And that seems like it will ultimately be the best place for this macro, as it seems like overkill to include it for every single roll on the character sheet. WH isn't Shadowrun, and so rolling dice pools of 10+ dice shouldn't start happening with any regularity until the group is very seasoned. By the time my group gets there, who knows what features Roll20 will have rolled out. Thanks guys!