Game initialized with shuffled and dealt cards

The game I am developing has four player hands each with 5 cards. Is there an easy way to initialize the game with the cards shuffled and dealt? I am still learning the basics of Vassal development and haven’t ventured into Java yet.

I would also like to have a feature where a new card is automatically drawn and placed in the player’s hand when a card is discarded. Is there an easy way to do this or do I need to look into Java?

Finally, I like the feature of the arrow keys moving a card’s position in the player’s hand. Can a key combination be programmed to select a different card without having to use the mouse?

Thanks for the help!

This is invaluable: … rguide.pdf

…as are the individual wiki pages for each subject available via the help buttons in the editor. Use those help buttons liberally for each trait/feature.

There are different ways to handle design problems in vassal. For the pre-start auto dealing of four hands, I’d start by setting the deck to reshuffle: always (in its properties), then I’d have four module-level Startup Global Key Commands to handle the dealing to the four hands. A potential problem with having it done automatically though is that the cards will not be masked (hidden to others but visible to the owning player). You can have them all sent facedown, but then the players have to run actions to view and mask them anyway (and in that case I’d just have the players draw cards themselves at the start). You can also have them sent to four private windows (one for each player) so masking is unnecessary as the window itself limits views, but heavy restrictions in modules present their own problems.

A problem with auto-drawing after discard is if there is ever an instance when you don’t want it to happen (and one instance is one too many). It can be done though, with the simplest way being to draw a new card via a Global Key Command trait to the selected card (being right-clicked discarded), then tying the card’s Return to Deck trait (which will discard a card to a discard pile) to that GKC trait. So the player right-clicks the appropriate card and selects to discard it, which really draws a new card first to the same spot and then discards the selected the card. This would be for right-click discards only, and any manual discards to a discards deck would need additional work. Like I said though, especially done in such a way as I just outlined, it could really be a very risky feature.

I’m not sure I really understand the last question. I haven’t been able to find a way to select or deselect w/o using the mouse unfortunately, but if a piece is selected you can have it removed from a random selection of other pieces around it… if that’s what you’re asking.

Anyway, I realize these are just quick overviews, and may be confusing as written, but check out those mentioned traits via the guide or help buttons. There is work involved, especially when getting creative, but it’s fun work. Hope this helped a little.