[messages] [Module Design] Counting a variable number of pieces in a defined zone

Brent Easton b.easton at exemail.com.au
Thu Jul 14 17:47:00 MST 2011


Hi,

I don't have a specific solution for you. However, there is a design principle that I follow that may help.

Sometimes, when I convert a game to a module, I don't necessarily recreate every game element in Vassal exactly as it is in the game. Things like counters that are used as some sort of scoring or bidding mechanism can be more easily implemented as Global variables with buttons to modify the values.

Have a think about whether you actually need counter pieces that have to be moved into the zone, or whether it could be done with a different mechanic.

Regards,
Brent.

*********** REPLY SEPARATOR  ***********

On 14/07/2011 at 3:36 PM Ektelioth  wrote:

>Hello,
>
>I am pretty new to Vassal, so my question may seem obvious, but the
>problem is quite tough for me. I am currently developping a module in
>which tokens have to be counted in several zones. I would like to
>display the number of these tokens, sorted by zone and owner (each token
>is owned by a player side), in a separate window. The point is that
>every solution I have found for now in this forum concerns numbers of
>tokens that can only increase (which could be done using global
>properties, I think), whereas I would like to be able to refresh this
>value even if some tokens are moved to another region (which can often
>happen). 
>
>My map is a multi-zone grid defined manually and my tokens are (for the
>moment) single pieces. Is there a way to count in a variable (maybe
>linked to the zone?) the number of single pieces containing a certain
>type? I have seen several times in different modules counters displayed
>in text labels, but I was never able to find where the variables where
>defined (for example in the Battlestar Galactica module, which is the
>one I know best - even if far from perfectly -)
>
>Thanks in advance and sorry again if that may seem obvious to more
>experienced developpers :)
>




More information about the messages mailing list