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

How to do a d6 advantage/disadvantage dice rolling macro?

September 09 (3 years ago)

So the system is this: players roll a positive and a negative d6. Whatever result comes up modifies their Ability score.

Example: A thief with DEX 15 has to pick a routine lock. The player rolls and gets +6 and -2, so the result is 15+6-2=an effective DEX of 19.

I already have a macro that does routine rolls like this. But neither I nor my players could figure out how to handle rolling with Advantage/Disadvantage. In these situations, the players roll extra dice (how many depends on how good or bad the situation is.) HOWEVER, only the best (or worst) pair are used in the final calculation.

Example: Same thief is trying to climb a rope in the rain while guards shoot at them. The GM declares that they have "Three Levels of Disadvantage," meaning they have to roll three extra dice, still taking the worst pairing. They roll and get +4, -1, -3, -5. The worst pairing would be +4 and -5.

In a perfect Roll20 Macro, the players would also be able to assign the extra dice however they wished. For example, in an Advantage situation, players would likely want to roll extra positive AND negative dice to get the best odds.

Example: Same player is trying to sneak through a warehouse with a "borrowed" guard's uniform. The GM grants "Two Levels of Advantage." The player chooses one extra positive and one extra negative. They roll: +3, +6, -2, -1. The best possible result here is +6, -1 so the player (or ideally Roll20) chooses that to add to their DEX.

Final wrinkle: On a +6, -1 the player has scored a Critical Success. The positive d6 explodes (add and reroll), but still must subtract the -1 from whatever comes up on the exploding die. Explosions continue on each 6 rolled (and end on anything +1 through +5.)

For Critical Failures (a roll of +1, -6) they get -5 to their Attribute, or half normal Attribute (whichever is worse.) 

September 09 (3 years ago)

Here's the Macro we use:

/r {?{What's your Attribute, React, or Damage Score?}} + {?{Skill}} + 1d6 - 1d6

September 09 (3 years ago)

Edited September 10 (3 years ago)

This should work for you

/r ?{Skill}+[[?{Positive Dice|1}d6cs>6!![[5+abs([[0-?{Negative Dice|1}d6cs1cf6k?{Roll Type|Advantage/Normal,l1]])]]k|Disadvantage,1]])]]kl}1]]+$[[0]]+?{What's your Attribute, React, or Damage Score?}+{({abs($[[0]]),0}=6*{$[[2]],0}=1*[[0-{5,ceil(?{What's your Attribute, React, or Damage Score?}/2)}kh1]])}


The (dis)advantage is handled by the appropriate keep high/low modifier

Dice number are by query

Critical success handled by the compound explode operator using a number that can only be reached when the negative dice is -1

Critical fail handled by checking the individual roles and overriding the attribute value if required

Edit: Fixed an error with critical fails when attribute is 4 or less

September 10 (3 years ago)

Edited September 10 (3 years ago)
timmaugh
Forum Champion
API Scripter

Was working on this for a while, came back to find Rainbow' solution.

Just as an alternative, here's what I came up with. This requires the metascripts ZeroFrame and  APILogic:

!{&template:default}{&define ([BaseValue][[?{What's your Attribute, React, or Damage Score?|15} + ?{Skill|5}]]) ([BaseAdv][[?{Advantage Dice?|1}d6kh1]]) ([BaseDisad][[?{Disadvantage Dice?|1}d6kh1]]) ([ExtendedAdv] [[6+1d6!!]]) ([CriticalDisad] [[{floor(?{What's your Attribute, React, or Damage Score?}/2),5}kh1]])}{{name=Roll Result}}{{Base=BaseValue}} {{Advantage Dice=?{Advantage Dice?} at BaseAdv}}{{Disadvantage Dice=?{Disadvantage Dice?} at BaseDisad}}{\&if BaseAdv.value = 6 && BaseDisad.value = 1}{{Critical Success=ExtendedAdv}}{\&elseif BaseAdv.value = 1 && BaseDisad.value = 6}{{Critical Failure=CriticalDisad}}{\&end}{{Final Roll={\&if BaseAdv.value = 1 && BaseDisad.value = 6}[\][\]BaseValue.value + BaseAdv.value - BaseDisad.value - CriticalDisad.value\]\]{\&elseif BaseAdv.value = 6 && BaseDisad.value = 1}[\][\]BaseValue.value + ExtendedAdv.value - BaseDisad.value\]\]{\&else}[\][\]BaseValue.value + BaseAdv.value - BaseDisad.value\]\]{\&end} }}{&simple}

Queries for Attribute, Skill, Advantage Dice, and Disadvantage Dice. After that it compares via similar "keep high" logic to what Rainbow put together to find the proper combination. If a Success or Failure is detected, you'll get the extra line of output for the critical, reporting either the extended roll or the appropriate demerit. Finally, depending on whether there was a Success, Failure, or Normal roll, the last line reports the total of the roll. It looks like this:

First is a 6-1 critical success showing the extended advantage roll of 11. Then there's a 1-6 Failure, showing the adjusted modifier to the roll. Finally, the last result is a "normal" output (no critical line).

One thing I assumed is that when you got a 1-6 Failure, you subtracted both the initial Disadvantage Dice as well as the adjusted mod of the greater of 5 or half of the attribute. I assumed that because otherwise a roll of 6 on the Disad die could turn into a -5 (a lesser mod, in effect), and I didn't figure that's what you wanted. If it *is* what you wanted (that is, you should only subtract the adjusted modifier, not the disad die AS WELL), that's easily remedied by removing that portion of the roll equation in the last line of the template.

September 16 (3 years ago)

Wow, thanks all! (I haven't been checking my mail lately.) Will give these a spin and see how they work.