View Cards in a Deck

Howdy,

Is there a way to expand a deck like a stack?

My module will have two decks that need to be shuffled as part of set up. Then the order remains fixed, and players are allowed to examine all the cards freely to know the order of the cards in both decks. One of the decks will have close to 30 cards and the other will have 12.

Solution: I am modifying the solution from Benkyo. Since I want to reveal the order of all the cards in the deck, my module will just have the Game Piece Inventory Window inventory the whole deck without moving any cards. Also, since each deck to be inventoried is the only thing on its board, I can do a Property match expression as explained below, and the sort will be by the property DeckPosition.

I don’t think that decks can ever expand like stacks. You’re limited to the deck command allowing drawing any card which does list the cards in stack order.

1 Like

I use a game piece inventory window for this combined with a command to send all the cards to a hidden map with an X offset based on deck position. Then another command sends all the cards back to the deck.

This is when you need to restrict access to the command, or the cards need to be shown as a full image.

2 Likes

@Benkyo Thanks for the suggestion. I’m wondering how much work that will be.

@marktb1961 Thanks for the suggestion. The way I’m naming the cards, players will get all the information they need from the names and the order in which they are listed. However, I’m worried about a player accidentally extracting a card and altering the order. Plus it would be nicer to splay the cards like an expanded stack. I think I will make a feature request of optionally expanding decks like stacks for V4. I prefer decks to at-start-stacks for two reasons: decks can be shuffled and its so much easier to return a card to a deck than to an at-start-stack.

I thought I saw a Vassal-defined property for cards that indicated where that card is in its deck, but I’m having trouble finding it in the reference manual. After looking at GPIW page I got some ideas: Each of these two decks is on a unique board (deckA on boardA & deckB on boardB), and there are no other pieces on those boards. So I could limit the GPIW for each deck with a property match expression {CurrentBoard == "Deck'sBoardName"} (of course I’d substitute in the name of the actual board for “Deck’sBoardName”). If Vassal does define a place in the deck property for each card, I could sort by that.

If I need to send the cards to another window like a player hand window to auto arrange the cards, maybe I could also have the module take a photo of that window to display on demand. Just brainstorming.

I know the list on this page VASSAL Reference Manual is incomplete as it does not list mat/cargo related properties.

DeckPosition or Deck_Position or something like that

2 Likes

That’s what I thought I saw, but it sure would be nice to see the documentation on it. So I could be more sure of the syntax.

It’s in the Basic Piece documentation.

DeckPosition contains the position of a piece within a Deck (top = 1) if the piece is currently stacked in one, or 0 otherwise.

2 Likes

I should probably note that the UI problem with my method is that players tend to X close the GPIW when done, then try whatever button or command sends the cards back to the deck. Since you can only toggle a GPIW window, and not specify a command to close it, this sequence results in an empty GPIW being opened.

Not a huge deal, but annoying.

Thank you @JoelCFC25 , @Benkyo and @marktb1961 .

I tried the Game Piece Inventory Window, and I think it will work just fine and easier than I thought. I would prefer to have the button that shows the GPIW in the toolbar of the window with the deck. I’ve done that to show a window that the module uses to transfer money. So I can do it here. I’ll just make sure the GPIWs are the last items in the module so their buttons are less obvious in the main window’s toolbar.

Thanks again.

I think that will be less of a problem for me. My module will do the inventory without moving the cards.

Oh, of course, you are showing the whole deck. I forgot: in my case I only wanted to move some of the deck to a hidden map.

@Benkyo , Did you consider adding DeckPosition < 4 to your property match expression so the GPIW only looks at the top three cards in the deck rather than moving the cards? I’m not sure if that will work as desired or suit your needs, but it may be a way to avoid an extra window and shuttling cards.

I did, and that’s so much cleaner it’s maybe what I should have done. It’s just that physically moving 3 cards also reveals the back of the 4th card, which can be significant, and that maps better to the physical game.