[messages] [Module Design] A complex dice rolling problem

caecus caecus13 at gmail.com
Tue Nov 9 16:11:37 MST 2010


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.

Thanks, 
            caecus

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=20518#p20518


More information about the messages mailing list