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

[Macro Help] Minimum Roll Threshold

I'm playing a game of sw5e that my friend is running over roll20. In sw5e, it adds a mechanic called "minimum roll threshold" that can be gained a number of ways, but essentially boils down to if you roll below this number on a roll, it becomes this number, with it changing based on the die (2 for d4, 2 for d6, 3 for d8, 4 for d10, 5 for d12, and 8 for d20). I get this for damage rolls on all my Dark Powers, and since I can't include it in the roll itself, I was thinking I make a Macro for it on one of my attacks. How would I go about including that clause to the damage roll in say, my Force Lightning, which does 8d6?

January 07 (2 years ago)
Gauss
Forum Champion

Could you provide a detailed example? 
For example, are you saying that if you roll 8d6 any 1s become 2s? 

Yes, that is what I'm saying. If I were to roll a d20 with Minimum Roll Threshold, anything below 8 would become 8.
With damage, any number below the Threshold becomes the Threshold.

January 07 (2 years ago)
Gauss
Forum Champion

For single dice this is easy: {[[1d20]],8}kh1

For 8d6 it becomes difficult if not impossible.
The simple but bleh method would be {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1..... until you have all 8d6. 
Where that gets complicated is if you had a variable number of dice...then it would involve a query acting as a switch, etc. And it would just be ugly. 

Perhaps someone like RainbowEncoder has some genius level method to do multiple dice (that does not involve an API script or the method above).

Well thankfully, it's not variable. As a "spell" the damage is gonna be the same unless I upcast it, at which point I just roll manually. Thanks for helping!

So I tried it out, and it's still able to roll 1s, even though I pasted it like you put it...

Here's what I put, if that helps:
&{template:default} {{name= Pinpoint Lightning}} {{attack= [[1d20 + @{power_attack_bonus}]]}} {{damage= {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1}} {{range= 100ft}}

January 07 (2 years ago)

Edited January 07 (2 years ago)
Gauss
Forum Champion

Here you go:
&{template:default} {{name= Pinpoint Lightning}} {{attack= [[1d20 + @{power_attack_bonus}]]}} {{damage=[[{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1]]}} {{range= 100ft}}

Regarding rolling 1s...what you saw was this: .....{1,2}kh1....
Without it being part of a roll command, or enclosed by [[ ]] (the fix above) it won't resolve properly. {1,2}kh1 will resolve to 2. 

If you do not like it showing {1,2}kh1 or {1+2} in the tooltip then wrap each kh1 with brackets like this: [[{1d6,2}kh1]].

As Gauss indicated there isn't really a 'clean' method for this kind of macro. However there is slightly tidier method.

For 8d6 minimum of 2

[[{8d6 +{ {2} } +{ {2} } +{ {2} } +{ {2} } +{ {2} } +{ {2} } +{ {2} } +{ {2} } }k8]]

The rolled 1's will appear greyed out in the tooltip but a 2 will get counted in it's place. The amount and spacing of the curly braces is required for correct functioning. Whilst this doesn't allow a truly variable number of dice you can lower the amount by changing both 8's without causing problems. So an upcast-able version can be creating relatively easily by starting with the higher dice version then reducing the dice and keep amounts with a simple query.

Properly variable versions do exist but with significant caveats and/or limitations.

January 07 (2 years ago)
GiGs
Pro
Sheet Author
API Scripter

An alternative that is much simpler to use would be to create a rollable table for each die with a minimum.


You can treat rollable tables as dice so it's easy to roll several at once

January 07 (2 years ago)

Edited January 07 (2 years ago)
GiGs
Pro
Sheet Author
API Scripter

I was on mobile without my glasses for my earlier post so I couldnt read RainbowEncoder's method. That's a clever way to handle it, and it is expandable to different kinds of dice pretty easily (if laboriously).


For the Rollable Table method, you'd create a separate table for each of d4, d6, d8, d10, and d12. The minimum roll value would have an increased weight. d4 would be 2: weight 2, 3: weight 1, 4: weight 1. Basicaly the weight is the number of times you can roll that number on each die.

Then you roll it like a die with slightly different syntax.

3d6 would be /r 3d6

3 of the special d6 would be /r 3t[d6]

just use t[table-name] whereever you would normally use d6 or d8 or whatever.


Your original macro was this:

&{template:default} {{name= Pinpoint Lightning}} {{attack= [[1d20 + 
@{power_attack_bonus}]]}} {{damage= {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + 
{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + 
{[[1d6]],2}kh1 + {[[1d6]],2}kh1}} {{range= 100ft}}

That would become:

&{template:default} {{name= Pinpoint Lightning}} {{attack= [[1d20 + 
@{power_attack_bonus}]]}} {{damage= [[8t[d6] ]]}} {{range= 100ft}}


And how that macro might look:

and yes, you can use d4, d6, d8, etc., as table names.


It takes a little time to set up the rollable tables you need, but once done, they are easy to use, and you can even mix them with non-table rolls, like 3d6 + 3t[d6].

January 07 (2 years ago)
Gauss
Forum Champion

Very nice GiGs