Capped Rolls?

Hi,

Trying to build a custom sheet and want to do capped rolls. I have found the max function which will do it.

What I’m wanting to do is create a function where if a checkbox is ticked the roll is capped. I’ve been trying variations of “!(1d20 + {Test ? max5 : 0})” or “!(1d20 + {Test ? 1 : 0}max5)” or similar, but to no avail. I’ve put the ‘max5’ in pretty much every place I can think of.

What am I missing?

Hi @BlitSnax and welcome to the forums.

You might want to try this: !(1d20{Test ? "max5" : "min1"})

Use the min1 so you don’t end up rolling a d200 :wink:

Hi all,

I am also using something similar, but have run into another issue!
I am trying to limit a roll after adding all the bonuses. So the roll would be something like:
Roll 1d20, add any bonuses to the roll, then if it is above 15, reduce it to 15.

The individual parts I can get to work, using IF and rolls, but I can’t get them to combine.
Using this poor example, it makes the roll then adds the bonus on after, taking it over the value.

Poor example: !(1d20{Limit ? “max15” : “min1”}+{bonus} )

Is this possible? Any help would be much appreciated :slight_smile:

Thanks!

Hi @Oli_B and welcome to the forums.

We just had a discussion in the Discord server about this and came up with a few options. You might want to drop in there and have a look.

1 Like

Thanks for the welcome. I think I’ve found a workaround for now.

It’s always one of those things I find with coding. I know WHAT I want the code to do, I can often even work out HOW to get it to do it, I just struggle with getting my syntax in the right order.

I’m sure I’ll be back with more silly questions later.