I'm working on a custom ttrpg system and I've noticed a lot of answers to questions in here regarding AnyDice. You would roll two die (such as a d6 and a d8) against a third die of any size up to a d12. The third die determines difficulty. Having at least 1 die meet or exceed the difficulty is a minor success, while both meeting or exceeding is a major success. Any help on how to set this up would be appreciated.
-
\$\begingroup\$ Welcome to RPG.SE! Take the tour if you haven't already and see the help center or ask us here in the comments (use @ to ping someone) if you need more guidance. Good Luck and Happy Gaming! \$\endgroup\$– Someone_Evil ♦Jul 19 at 8:04
1 Answer
The main trick you need here is to make two comparisons to a single row. The way to do this is to cast it to a function. Then we just get to treat our variables as an outcome of a roll, not dice.
We then just compare the result each of the two dice with the result of the target die. Resulting the sum means 1 means a minor success and 2 a major.
function: roll A:n B:n against T:n {
result: (A>=T)+(B>=T)
}
output [roll 1d8 1d6 against d12]
-
\$\begingroup\$ It might be worth noting that the
A:n B:n
part of the definition causes each of the first two rolls to be summed into a single number even if there's more than one die in each rolled pool. If you defined the function usingA:s B:s
, the rolls would be converted into sequences instead, which would let you do e.g.[roll 2d8 3d6 against d12]
and get a count ranging from zero to 2 + 3 = 5 of all the dice in 2d8 and 3d6 meeting or exceeding the random d12 target. \$\endgroup\$ Jul 19 at 21:42