Roll variable amount of dice (from global property value)

Hi - I’m relatively new to module building, although I’ve done a couple now. I did a search to try to find the answer to following, but didn’t come up with anything (mind you, both “variable” and “dice” are pretty common terms in this forum, so it is probably just buried).

I have a global property nMinions

I have a Dice button in the toolbar

I want the dice button to roll $nMinions$ number of dice when clicked. However, if I put $nMinions$ in for the # of dice in the properties window and click ‘Ok’, it reverts it back to a numerical value. Is there a way to do what I am looking for? Or an alternative way that I haven’t thought of?


This may not fully suit your need, but you could try the “loop” feature of a trigger action:

  • create a hidden piece somewhere on the main map, with:[list]
    [*]a trigger action that “repeat while condition is true”, and a loop index

  • a global hotkey that throws your dice (once)
    ]add a button with a global key command to trigger the hidden piece[/:m]
    ]hide your original dice (or not) by removing its button text and icon[/*:m][/list:u]
    You’ll get one line in the logs for each dice (instead of a single line listing all the results).
    If needed, it should be possible to get the sum of the results (and a single line report) with a few extra traits.

Thanks for the reply, I’ll give this approach a try.