A complex dice rolling problem

Hi all,

I’m currently designing a module in which a number of d6 are rolled (between 1 and 15 or so, depending on what is making the action), and any rolls of 4 or 5 score 1 point, and a 6 scores 2 points and roll again, the results of which are added to the previous score. Note that the dice rolled in the second round also get rolled again if you get another 6, and this can continue forever if you keep getting 6’es.

So for example, roll 6 dice, get a 2, 3, 3, 4, 6, 6 (currently 5 points) - roll again for each of the two 6’es, getting a 2 and a 6 (making the total 7 points) - roll again for the 6, getting a 4 (final total of 8 points).

So a couple of questions -

  1. is the best way to store the running total as a global property, resetting it to 0 at the start of each time the main button is pressed?
  2. how can I manage the individual dice results such that I can count the number of 6’es?
  3. how can I roll a number of dice equal to the number of 6’es rolled?
  4. can I use a trigger to keep rerolling until the value for the number of 6’es is equal to 0?

I realise that this is quite a complex process, and I’m somewhat afraid that I’ll have to hand-code it. Any help would be appreciated.


Explaining how to do that may be difficult. But I could put together a sample mod that can probably do this. Probably won’t have the time until Thursday, though.

If you could, I would be very appreciative. All the other bits of the module are pretty much done, I just can’t get my head around how to do this.
Time’s not really important, just whenever you can put something up basically.

I wasn’t able to get to this today but I’ll put something together as soon as I can.

Sorry for the delay. I’ve got a working module for what you want. I just need to write up a few notes and I’ll pass it along.

Here’s a sample mod which I believe performs the behavior you were looking for.

The zip file contains the vmod and some notes explaining what I did.

whoa, there was no way I was going to be able to get that by myself…

Much appreciated. Also, seeing how you did it with the explanation has given me some ideas for the rest of the module to make it a bit more refined. To be honest I didn’t think you could get this level of control with just the tools within vassal, and it’s good to see that such things are possible.

Thank you very much for this.

You’re welcome. Enjoy!