Hello, and thank you for looking. I’m still learning my way around Vassal, and haven’t been able to figure this out.
I’m creating a module that features two different draw decks. I’d like to implement some feature that allows any player to see how many cards are left in a draw deck.
Ideally, I’d like to include this as a right-click command. But I would also be willing to have an actual number on the draw deck indicating the number of remaining cards.
Any advice? I think the answer lies in the “Expressions to count” feature of the draw deck. Unfortunately, I’ve read, re-read, and re-re-read about this feature in the Reference Manual, and it’s still not making sense.
The manual reads: “The number of cards in the deck is exposed as a Map-level Property with the name _numPieces.” Can someone please expain what this means? Where exactly is the number exposed, and how do I expose it?
How to show the number of specific cards in a deck?
For example, the deck has 48 cards. 12 cards are a special feature, and I want the number of this cards -12- appears next to the deck with the total number of cards -48-. How do it?
Thanks for advance
I’m just guessing here as I haven’t fooled with displaying the number of cards in a deck but if the Blackbeard module displays the number of cards in a deck, then I would imagine you could also display the number of special cards in a deck by giving those special cards a Marker of some kind.
…am I right? …or does this process that counts the cards unable look for a Marker property?
$deck_numPieces$ (think thats the property been a while) which counts all the cards in a deck does not rely on a marker nor need one.
But, to display specific number of cards in a deck though you are correct that the significant pieces would need a special marker and the you would have to use the “perform counting of property expressions” in the Deck dialog and refer to that instead
From: Michael Kiefte mkiefte@dal.ca To: VASSAL Engine Forums Mailing List messages@forums.vassalengine.org Sent: Wednesday, January 21, 2009 9:25:52 AM Subject: Re: [Module Design]Re: How to show the number of cards remaining in a deck?
Blackbeard Module has an At the Start Stack (Action cards count) with a single piece. This piece has the trait Text Label. This trait (Text:$Action cards_numPieces$) and the Expression to count “action:card=action”, shows the number of cards (“card” is a Game Piece Prototype Definition)
I tried the same procedure to show a specific number of cards into the deck, but unsuccessfully.
Tim: What’s the expression I write in the Perform counting of property expression?
Problem solved!
A Marker to each special card, an expression to refer these cards, and $nameDeck_expression$.
You can see it in this module that I’m creating (two counts for two groups of special cards and a count for the total number of cards)
Thanks to all! amarocimarra.googlepages.com/NE