Can somebody give me a good run-down on some of the things I can do with stacks/decks? I’m trying to automate some special card shuffling rules and I wanted to know what’s possible.

One task I’m working on requires the following steps:
Shuffle deck 1. Move half of deck 1 to deck 2. Place the card from deck 3 on top of deck 2, place deck 1 on top of deck 2. (Alternately, If I can simply shuffle deck 1, then insert the card from deck 3 directly into the middle of the deck that would work as well.

Another task that I’m working on requires a Global Key command that will send the card in deck 3 to deck 4, the card in deck 2 to deck 3 and one of the cards in deck 1 to deck 2. For This I was thinking send to deck commands will work for all the single card decks (2-4) but how do I send one card from deck 1 (which, unlike the others, contains multiple cards) to another deck?

Thanks for sharing any Vassal tricks/best practices regarding the use of decks/stacks.

I tried working on the first one, but I can’t figure out a way to calculate a number that equals HALF of the number of items in the deck (if you don’t know it first, or in other words, if you have to figure it out based on _numPieces) and then execute an action that number of times or to that many cards in the deck.

Maybe someone else knows how to make a routine that does this.

Actually, in the case of this game, I know how many cards are in the deck. There are 20 cards total so I need the 21st card in position 11. Do you know how to accomplish this? Also I would still be interested in the routine you were talking about if anybody can figure that one out.

Actually, in the case of this game, I know how many cards are in the deck. There are 20 cards total so I need the 21st card in position 11. Do you know how to accomplish this? Also I would still be interested in the routine you were talking about if anybody can figure that one out.

Tim, is there a way to apply a GKC to half of the deck when the total number of cards is variable (in other words, when the number of cards in the deck has to be obtained from an in-game property rather than a constant value defined pre-game)?

I’m hopeful this will get easier when the math stuff rolls out in 3.2, but I don’t know enough about it yet to even say that with certainty.

If the deck order is not important there is a way to do this by dealing the
deck out to 2 phantom decks 1 card at a time alternating the phantom decks
then move 1 phantom deck back again, therefore having half the original deck