Number of "successes" on a dice roll

Hi all

I am creating a module where I require a number of “successes” on a dice roll.

A “success” is a die result of 5 or higher. So if a player rolls 7 dice, and 2 dice result in a 5 or higher, then a ‘2’ is returned. Is this possible?


I figured out a way I could do this, but it depends on vassal having a certain capability

I need the value for each die rolled so I can set them as a Dynamic Property in a GKC.
For instance, rolling 2 dice (named “2d”), $2d_result$ gives the total of both dice

Is there a property for the value of each die result? $2d_result1$ and $2d_result2$ do not work

Edit: I should add that I am using symbolic dice

As long as your Report Format lists each individual die, you can use Java String functions (such as .split()) to extract the individual dice from 2d_result.

For example, if your Report Format is $result1$,$result2$, you can use the formula {2d_result.split(',')[0]} to return the first die result; increment the 0 for each later die.

1 Like

That works - thank you very much for that!

1 Like