Displaying deck counts on seperate maps?

I’m building a module that has player hands with multiple decks on them. The player hands are not visible to other players because of other aspects, but I’d like to make the counts for certain decks visible to all players for easy and verifiable comparison. In pursuit of this, I’ve created a new map where I’d like to display those counts for all players.
The method I’ve used for counting the cards in the player hands seems pretty standard (using an at-start stack with a $DeckName_numPiece$ expression for eack deck), which obviously doesn’t scale out for use on other maps.
I found a thread from '08 that has a solution for this ( Counting cards in a player hand and displaying it - #6 by Brent_Easton ), but I was wondering if there is a better/easier way to do this with the current version?

The Game Piece Inventory Window (GPIW) is probably the easiest way to do this. If you want an example, all the recent versions (as in, last few years) of Terraforming Mars have 2 GPIWs, one to count the cards in the players’ primary hands, and one to count the cards in their “research” hands.

Thank you. I will see what I can do with that. Making one simple game gave me a false sense of the scale of the Vassal learning curve. It can get pretty steep, apparently. :smile:

Just re-read your initial post, and realized you want to display counts of how many cards are in decks, not just on a Player Hand window. I’m really not certain if a GPIW can do that, or not.

Check. I’ll try it out anyway. You never know.

This is pretty easy to do with the improved Sum and Count functions, specifically CountMap in the form: CountMap(map,expr).

You can put these functions directly into the contents of a Text Label to be able to “reach into” maps you’d normally not have access to and report out information. I built a quick module with 3 player sides: Red, Green, Blue. Each gets a deck named Draw in its private player hand (named according to the player side) containing different numbers of items. I put a static piece on the main map with only a Text Label and the following expression:

{"Red: " + CountMap("Red","{DeckName==\"Draw\"}") + " Green: " + CountMap("Green","{DeckName==\"Draw\"}") + " Blue: " + CountMap("Blue","{DeckName==\"Draw\"}")}

This yields the following:

For quick demo purposes only the Green player hand was open, and no HTML or fancy formatting has been applied to the text string, but you could.

3 Likes

That’s exactly what I’m looking for and I appreciate the help.

Of course, being new to Vassal, it took me a few tries to work out the kinks on my end, but this does the trick.

The solution above worked perfectly for what I needed, but after some play testing, I thought of something else that should help players use the info accessed more easily, but after 4-6 hours of fiddling with it myself, I’m no closer to figuring out how to do what I’d like to do.
So, on the map mentioned above, I have 15 different at-start stacks, each containing a single piece that has 5 different text labels and 5 different calculated properties. Each text label displays one of the calculated properties (drawn from the various player hands, but calculated within the piece, as above). In essence, each at-start stack “belongs” to the player with the highest calculated total in that stack at any given time. At the end of each round, players receive 1 card for each stack they own.
What I’d like to do is automatically display a color in or around each stack matching the player side it belongs to since it would be much easier to visually parse 15 different spots of color than 75 different, but similar text labels.
I tried doing this from within the individual pieces using a border color trait (it took me a while to figure out I needed to add an actual image for this, rather than just have text labels :crazy_face: ). However, my limited knowledge is hitting a wall in trying to figure that system out. I also tried to set map zones to display a color border, but hit the same knowledge wall. I’m guessing my issue is with which property I’m trying to set or how I’m trying to use it, but I don’t know that for sure. Everything I’ve come up with so far has been fairly convoluted and hasn’t worked.
I’m going to keep fiddling around with it on my own, as I don’t want to pester others with constant questions, but any advice would be very much appreciated.

Addendum: I’ve worked out something close to what I want using trigger actions and dynamic properties, but I still have to manually perform the key command to make it work. Is there any way to automatically make a trigger occur when a trigger property is matched without manually doing it yourself? I’m guessing there is and I’m just too thick to figure it out on my own.