Summing marker values to a text label & conditionals...

I am looking through the forums etc to see if it is possible to sum the value of markers on pieces on a board into a text label and display it, and whether the expressions can include conditionals (like if CardType=Spades for example). I read that mathematical expressions are coming in 3.2 (which I guess covers this exercise), but had wondered if someone is already doing this?

Markers are not variables in the since that you can manipulate them easily. They are more just a way of identifying a piece as being unique or part of a ground with common markers.

If pieces have values you want to manipulate, you should use Dynamic Properties for the values. Then you would use a Global Property to hold the sum value.

For example: Create a GP called SpadeCount. Place something with a Text Label trait to display $SpadeCount$. Then have something send a command to all pieces with CardType = Spades. Each of those cards would have a trigger that increments GP SpadeCount by their Dynamic Property value. This should give you a sum total.

As far as Vassal 3.2 …I’d highly recommend switching over to 3.2 (current build is svn8015). I’ve been using it exclusively since the test builds began coming out and I’m surprised at how fast my rebuild of To Be King is coming along. I’ve been using plenty of mathematical expressions in it …although it did take me a while to get a handle on the syntax used …and being able to use keywords or key commands instead of limiting yourself to just key commands has been fantastic. Modules edited in 3.1.x are compatible for editing in 3.2.

Hello DrNostromo,
can you tell me, step by step, how I do the increment for a GP like SpadeCount in the example above?
In my module I don’t have to manipulate the values in the single pieces (cards for my module).
Have created a GP called “TotalA”
In a card have put a Dynamic Property called “modTotalA” with value = 7 and no button (don’t need to modify the value).
Have created a Global Key Command (SHIFT A) that include piece matching {CurrentZone==“Player1zone”}, no pieces from deck included and report this “Player1 Total Attack = $TotalA$”
How can I sum ModTotalA to TotalA when I do SHIFT A?

Thanks

Problem solved, finally have figured it out how to use Global Properties and Dynamic Properties :mrgreen: