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

Reroll Failures Once against Attribute Target Number and Count Successes Macro Help

1658596133

Edited 1658596186
I'm currently attempting to create a simple wargame, and it uses a feature where if a unit is "cursed" it rerolls all the successes for a target number once (and "blessed" is the opposite). That target number is determined by an attribute on their sheet. So I know how to make a macro where the number of attacks ("Attacks_Shooting") a single model makes is multiplied by the number of models in a unit ("Model_Count"), that many d12s are rolled and those rolls are checked against a target number that is determined by an attribute on the character sheet ("Skill Shooting"). /r ((@{Attacks_Shooting}*@{Model_Count}))d12>@{Skill_Shooting}s However, I can't seem to figure out how to make this macro check for successes (at that target number, in this case "Skill_Shooting") and reroll them once and still count the number of successes (as opposed to add them up)? I feel like I'm missing something very simple here. The macro I'm trying to write for "Cursed" shooting looks like this currently: /r ((@{Attacks_Shooting}*@{Model_Count}))d12>@{Skill_Shooting}s What this produces is not very useful - it rerolls successes once and grays out the rerolled dice, but then displays failures generated in the first roll set as not "grayed out" (which makes them look like successes) and failed rolls from the first set as not "grayed-out" as well. Finally, it's producing a totaled value rather than a success count.  Can what I am attempting to achieve here be done with a macro?
1658625073

Edited 1658625170
GiGs
Pro
Sheet Author
API Scripter
I'm not sure I'm following the problem, but you can just tack on ro<target or ro>target at the end, like /r ((@{Attacks_Shooting}*@{Model_Count}))d12>@{Skill_Shooting}sro>@{Skill_Shooting} ro means reroll once. Having the s in there means the results will be sorted, so you wont see which dice were rerolled. If you remove that, it'll be harder to read the result, but you get the total successes displayed so that shouldn't matter. If you get rid of the s, the reroll is shown immediately after the dice it is rerolling. While checking, use a smaller number of dice so you can read the results more easily.
1658637304

Edited 1658637342
Ah! Your code fixed it. I see what happened: The sort suffix in my macro sorted the results ascending numerically, which for some reason added everything else up at the end to produce a sum. Your code produced this (after I removed the sort function), which is what I want: Thanks!
1658643099
GiGs
Pro
Sheet Author
API Scripter
There's a reason this didn't work: Let's take the roll /roll 15d12ro>5 The > in there is just applying to the ro. There's no checking against the target. By default, in roll20, dice are just added together, and with this roll, some of them get rerolled, but then they are all added together. To compare the dice against a target number, you need to add that in, like so: /roll 15d12>5ro>5 That version has a check for target numbers, and also a target number for the rerolls.