I've been developing a homebrew system that utilizes 3d12 and I've been wanting to get the probabilities plotted so I could, for one, see how viable such a system would work and, two, be able to work out how skills and attributes would work. The purpose of 3d12 is purely thematic, as almost everything revolves around treating "3" as a sacred number in-game.
I'm still learning to utilize AnyDice. I had borrowed a function I found online that was designed, originally, to roll 2d6 and then a coin flip, the result of that flip being for either taking the highest or lowest result.
I tried to emulate it, but for my purposes, I'm trying to create a function that will roll 3d12, but one of the d12 is a decider die similar to the coin. Should the decider die be odd, you take the lowest of the other two d12. Evens, you take the highest.
A caveat to the problem is how I handle criticals. If the two main dice were equal (doubles), then they are totaled instead of choosing highest or lowest. And should the decider die also match (triples), this counts as a "critical" and the third die also gets added.
The following is the frankenfunction I tried to pull together from what I found online and through documentation, but I'm clearly an idiot because it used to actually resolve; I've now somehow managed to make it so this produces a syntax error:
function: well of DICE:d flip COIN:n
{
if (COIN = 1, 3, 5, 7, 9, 11)
{
result: [lowest 1 of DICE]
}
result: [highest 1 of DICE]
}
loop N over {2..5}
{
output [well of Nd12 flip d12] named "[N]d12"
}
output [well of 2d12 flip d12] named "2d12 biased"