[messages] [Module Design] Counting card value

barbanera barbanera at fantafoot.com
Mon Jul 23 04:40:24 MST 2012


It might be possible to do something of the sort in a straightforward
manner with 3.2.0 by using Calculated properties and the beanshell
stuff. 

However, sticking with 3.1.x if your cards are in a deck you can first
of all turn on performing "counting of regular expressions" on the deck,
and export properties like:

1s: CardValue=1
2s: CardValue=2
3s: CardValue=3
...

Then your total will be given by the simple expression: $<deckname>_1s$
+ $<deckname>_2s$ + $<deckname>_3s$ + ...

For testing purposes you might want to print it out that total. However,
you cannot stick the above string in a text label because it won't work.
So, define some button with a right/left click command to set up a
global property with a bunch of "increment numeric value by" commands
(the first with $<deckname>_1s$, the second with $<deckname>_2s$ etc)
and have the text label print out the value of this global property
instead.

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


More information about the messages mailing list