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

Counting successes and double successes

January 21 (3 weeks ago)

I am working on a macro that rolls and X ammount of d20s, with an Y bonus to the roll and compares it to a Z difficulty

So far so good, made that without much problem, but in the system me and my friends are playing, there is a system of counting anything 10 or above a certain number counts as 2 successes instead of 1, and i cannot for the life of me figure out how to make that last part, i tried many things and read lots of forum posts/wiki posts to try and find something like this. 


this is the macro i have so far:

{?{how many tests}d20+?{bonus}}>?{difficulty}

there's also the template default, name, the roll names, i took that part out and just put the part that matters. can anyone help me out? i hope i don't need scripting for this. 

January 22 (3 weeks ago)
Gauss
Forum Champion

Hi Shiz, 

Is the bonus added to each d20? 

Example1:
2d20+5 = 1d20+5 and 1d20+5
So if you roll 10 and 12 that is 10+5 and 12+5 = 15 and 17

OR

Example2: 
2d20+5 = 2d20+5
So if you roll 10 and 12 that is 10+12+5 = 27

January 22 (3 weeks ago)

example1, added to every d20 roll, and then compared to the result

January 22 (3 weeks ago)

Edited January 22 (3 weeks ago)
Gauss
Forum Champion

What is the upper limit on the possible number of d20s rolled? 

5? 10? 100?

January 22 (3 weeks ago)

haven't really considered a limit, probably around 40 at most, its based on the number of weeks in downtime, 14 rolls a week, doubt it will go over 4 weeks

January 22 (3 weeks ago)

The difficulty here is that each roll can only be compared once, so we'll have to creative to count the double successes.

[[?{how many tests?}d20>[[?{difficulty}+10-(?{bonus})]]

this gives us the number of double successes, but not the number of normal successes, so we'll have to go a step further

[[ ((?{how many tests?}*2-[[?{how many tests?}d20>[[?{difficulty}+10-(?{bonus})]]*2]])/2)d([[{?{difficulty}+9-(?{bonus}),20}kl1]])>[[?{difficulty}-(?{bonus})]] ]]

this has us roll every dice that wasn't a double success, knowing it wasn't a double success, and comparing it to the success threshold. Next, we'll just display both results together:

$[[1.computed]] + [[ ((?{how many tests?}*2-[[?{how many tests?}d20>[[?{difficulty}+10-(?{bonus})]]*2]])/2)d([[{?{difficulty}+9-(?{bonus}),20}kl1]])>[[?{difficulty}-(?{bonus})]] ]] successes

There is a limit of each roll only being able to be iterated on once per parsing, meaning with a single use of the macro, we can't add these two numbers together (since we needed to use the number of double successes to know how many dice to roll for normal successes). But, that shouldn't be too much of a problem, since it's just two presumably small numbers.

If you don't need to track failures the failure target can be used as a simplier workaround

?{how many tests} +  {?{how many tests}d20+?{bonus|0} }>?{double success target|10}f<[[?{difficulty|1}-1]]

In this the inital sum effectively counts every roll as a success with the failures subtracting 1 to remove that default success and the higher successes adding 1 to provide the double success.

January 22 (3 weeks ago)
Gauss
Forum Champion

Yup, I figured if I got the basic information either Tuo or RainbowEncoder would come in and provide an option. :)