Dealing Cards, Deck count

Hi, Y’all -

I’m new to Vassal and I am really digging it. Having a lot of fun hacking together a Dealer’s Choice poker game for my friends.

I’m having trouble with my auto-deal buttons.

I created a GKC within the main Map Window for each player side (10 total). I added an image to the button, and a unique key command for each (CTRL 1 for player 1, CTRL 2 for player 2,…up to CTRL 0 for player 10). I checked Apply to counters on this map, fixed number of pieces = 1, and matched the key command from the top of the window into the Hotkey field for good measure.

I have a prototype called CardSend with a Send to Location for each player’s region on the irregular grid that belongs to the main Map Window.
The Card definition includes that prototype, as well as the traits Does not Stack, Mask, a Send to Location (CTRL H to send to the player’s Player Hand window), Return to Deck (sends to the Discard Deck), and 2 markers: Count = 1 and Layer = Card. (I made Game Piece Layers on the main map for cards, chips, avatars and the dealer’s chip, and each of those prototypes have the respective marker-trait).

SO… when the module is running, clicking on one of the “deal” buttons in the toolbar DOES deliver a card from the Deck (which lives on the main map board) to the correct player’s reigon, but then if you click a different player’s “deal” button, it deals a new card off of the deck AND moves the first dealt card to the new location as well. Furthermore, if there are any cards in the discard pile, it deals from there, too. Which makes me think there needs to be a rule applied to limit the deals to only come from the deck, but I can’t figure this part out!

Please help!

Your GKC needs to check that the cards are actually in the Deck before issuing the Deal command.

In the GKC, there is a ‘Matching Properties’ field. You need to compare the property DeckName to the name of your Deal deck. For example, if the Deal deck is named Deal, then you would use {DeckName==“Deal”}. The GKC will only be issued to Cards that satisfy this test.

Holy cow, that worked! Thank you very much.