Multiple maps and common Discard action

There is a map A with a discard pile. When card is played, normally it goes to a discard pile. But it may happen that instead of discarding a card, player would play it to a different map where it stays till the end of the turn. When the turn ends, I’d like all the cards played go to the discard pile, irrespectively of their location (i.e. map on which they were played to). The action of sending cards to a discard pile would be triggered by the user, through a multi-action button of GKC but how on Earth do I apply the same command to multiple maps?

I would imagine you could do that with the Property Filters for the GKC. Make sure all your cards have a prototype with a marker trait that has something like CardType = Card. Then create a filter something like:

CurrentMap = (map A name) && CurrentMap = (map B name) && CurrentMap = (map C name) && CardType = Card

I seem to recall you can use the term CurrentModule = (name of module) but I might be wrong on that (I’m having trouble accessing the documentation right now). Someone else will probably expound on that.

Right, but wouldn’t this expression always yield FALSE? Doesn’t CurrentMap returns the name of the current map the player is currently ‘in’? This would imply there could be only ONE CurrentMap and the filter would always fail.

Correct, he meant ||, not &&. It would be more neatly expressed as CurrentMap =~ (map A)|(map B)|(map C) && CardType = (card)

Obviously, replace the parenthesized bits with map names and Marker trait values as needed.

CurrentMap is a property of a piece, not a player.

You’re right. It would be “or” and not “and”. Apparently I hadn’t finished my cup before I wrote that.

Wow.That explains quite a lot of things to me. Thanks.

If you are just getting started, this is one of the most valuable things squirreled away in the entire wiki: vassalengine.org/wiki/Faq_mo … ounters.3F

Yap.

I thought that being the author of two modules is enough to get a grasp of Vassal features.

I’ve never been so wrong.

So,I have a GKC on the module level that relays the command to the off-main-map piece (B) which in turn triggers a GH which in turn performs a certain action.

If the map window containing the piece B is open, then the GKC works i.e. the action, it is intended to trigger, triggers and works fine.

When the map window containing the piece B is closed, then the GKC does now work.

Why?

I would need to see the module to be able to debug this.

Sure thing.

What you want to look at is the SHUFFLE button at the bottom of the list of game components. It triggers an action defined on an invisible counter named Prepare Starting Deck in the Cards map. The action – in theory – should trigger in turn a Multi-Action Button labeled – temporarily – Well Well Well. There are two actions triggered by this button – first one shuffles the deck (called Shuffle Pile, the other one sends the shuffled deck to the Draw Pile), simple as that.

As I said, when the window containing Cards map is closed, SHUFFLE button does not work. When the window is opened – and even if the other part of the module is focused on – the button works.

The module itself can be downloaded from: grabun.pl/tmp/ukc_v2.00_fow.vmod

All right, not meaning to pester but can anyone take a look? I am taking different route now, giving up on fancy card dealing, but knowing what I did wrong would possibly benefit in the future.

I’m still trying to piece together how this all works (and what it’s intended to do). You want to reverse the order of a deck of cards after shuffling it?

  1. A main toolbar GKC sends a command to a piece on the Cards display
  2. That piece fires a Global Hotkey at a Multi-Action Button on the Cards display toolbar
  3. The first of the Multi-Actions simply invokes another Global Hotkey on an invisible piece (this is what appears to shuffle the deck sitting initially at coordinates 1,1)
  4. The second of the Multi-Actions fires a trigger on each card to send it to the DrawPile deck

First off, do you realize there are two decks named “Shuffle Deck” defined on this Cards map window, both at coordinates 1,1? One is initially empty, the other has a bunch of cards in it. Each has the same Reshuffle hot key. It might be a recipe for confusion down the line.

This seems way, way too convoluted. Wouldn’t it be simpler to just have this initial deck of cards “Shuffle Deck” be set to Reshuffle always? Then you can replace steps 2, 3, and 4 with a single piece that has a Trigger listening for the GKC passed by the SHUFFLE button on the main toolbar. All you need is for that Trigger to fire a GKC targeting the Shuffle Deck that fires the Alt-Ctrl-Shift-B on every card in it, sending them one-by-one to the DrawPile. Maybe there is a game reason why it has to be your method, I have no idea.

You’re going to drive yourself insane with all these combinations of Alt-Ctrl-Shift-whatever…believe me, I’ve been there. If you’re editing in 3.2.x, do yourself a favor and use Named Keystrokes so you can keep things straight in your head!

EDIT: My method definitely works whether the Cards window is open or not, since I just tested it both ways.

  1. Changed the Key Command on the SHUFFLE button to “StartShuffleSeq”, left everything else there the same
  2. The “Prepare Starting Deck” piece on the Cards display now has a Trigger, watching for keystroke StartShuffleSeq, then performing ToDrawPile
  3. The “Prepare Starting Deck” piece on the Cards display now has a GKC firing on ToDrawPile which sends Alt-Ctrl-Shift-B to everything matching the property {DeckName==“Shuffle Deck”}
  4. The Shuffle Deck has its Reshuffle setting changed to “Always”

Hello Joel,

this is only a quick reply to say thanks – I believe you got my intentions right; the Shuffle Deck should be shuffled before the game and sent to the Draw Pile. In the final version of the module it will be triggered by a startup hotkey – as for now I settled for a menu button.

The reason behind setting the Shuffle Deck to non-shuffle… Shuffle Pile isn’t a shuffle pile or maybe partially; basically it is a placeholder to tinker with cards. The sequence in which cards are tinkered with, it does matter – Middle War cards should lie beneath the Early War cards so that they only will be drawn if the latter is used.

I will take a deeper look at what you suggested during the weekend. Thanks once again.

OK, I looked at the UKC rules to try and understand what has to be done. It’s pretty complicated, and I see that it won’t work for the Draw Pile to be set to Reshuffle=always, but I have some ideas that should allow it to all be done in a toolbar button or menu-driven fashion. I can flesh it out more later when I have time, but all you should need is a couple “hidden” decks for temporary randomization, some Triggers and GKCs, and a bunch of Send to Location traits on your cards.

It looks like the first turn has a special procedure for this Raising of the Standard card. A Multi-Action button can do this–first you have what you call the initial “Shuffle Pile” get sent to a hidden deck set to Reshuffle always. Then a GKC takes 9 cards from it and sends them to another hidden deck (also Reshuffle=always) that’s only used for this first turn deal. The next GKC adds in the Raising of the Standard card, then a GKC fires the Send to Location (destination: Royalist player’s hand) on 5 cards, then a GKC fires the Send to Location (destination: Parliament player’s hand) on the remaining 5, finally (!) a GKC returns everything remaining in the first hidden deck to the Draw Pile. This would all be instantaneous so you wouldn’t see where these hidden decks even are.

The other funky deck constructions in sections 6.7 and 6.8 should be feasible with a similar process. A Multi-Action button in the toolbar that sequentially fires all the steps you need. Just mix in sending things to the right hidden decks and then to the Draw Pile as necessary.

Here is a modified version of your module containing a proof of concept for the initial deal of cards as specified in 4.1 on page 6 of the UKC rules. Just hit the toolbar button on the Cards window that says First Turn Deal, then check both player hands.

dl.dropboxusercontent.com/u/189 … gTest.vmod

Thanks, I will take a look. Do you have an idea on how to deal with Late War Deck? First card from this deck – which is added when players run out of Middle War Cards – should go to Parliament player irrespectively of who got the last dealt card. If it was Parliament player, the card he has been dealt should go to Royalist and first card from LWD should be dealt to Parliament.