How to Split a Deck

Hi: I need to realize a command to perform the following tasks

  1. split a deck in two
  2. add one (fixed) card to one half deck
  3. rebuild the deck
    My idea is
  • send half deck to a temporary deck including the card to be added
  • add the remaining half deck on top to the temporary deck
  • move the cards back in the original deck

For step 1), I’ve tried to add to the Source deck a Deck Send Key Command with a Stop Condition, using the Stop Sending Expression {Target_numPieces>=Source_numPieces} but it looks like the _numPieces property is always null.

Simlarly, if I check the “limit total number of cards” and use the expression {Source_numPieces / 2} the action simply moves all the cards.

Any suggestions on how to proceed ? I know that such a task can be accomplished but my knowledge with Vassal is still quite limited.

Thanks in advance
Regards
Gottardo

Couple of questions for you:

1: How are you going to start this sequence? Will it be a button on the board, automatically done in response to something else happening, etc?

2: Does the final order of the cards in the rebuilt deck matter, or do you want them to be random/unknown to players in regards to order?

  1. triggered on the player request:it could be a menu option or a button.
  2. the final order is not relevant, as long as the inserted card stays in the bottom half

Thanks in advance

If you’re only splitting the deck to insert the additional card, then I’d just add the card onto the bottom of the original deck. Then you just have the card shift itself up however many slots. I think the DOWN key moves the card to the bottom, and the RIGHT key moves it up by 1.

Trigger Action… Peform: add, bottom, shift
Return to Deck… Key Command: add
Trigger Action… Key Command: bottom; Perform: DOWN key
Trigger Action… Key Command: shift; Perform: RIGHT key, with loop for however many spaces up (including a random number if need be)

Apologies if I got it wrong or am remembering wrong.