# Deck Global Key Command sending to multiple locations

**URL:** <https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130>\
**Category:** Module Design\
**Created:** [May 12, 2026, 4:08pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130 "2026-05-12T16:08:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 4:08pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/1 "2026-05-12T16:08:19Z")

</div>

Set up for multiple locations but if I check Affects with 1 only 1 card is sent to 1 location. If I select Affects with All, the whole deck is sent to 1 location. I have STLs for 6 locations and the cards are being sent to only the first location in both situations.

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [May 12, 2026, 7:35pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/2 "2026-05-12T19:35:00Z")

</div>

To make sure I understand what it is you are trying to accomplish:

Do you want to issue a single command to a stack or a card in a stack, and then have _N_ copies of the card be sent to _N_ locations, or do you want to draw _N_ distinct cards and send each card to a separate location?

In the first case, you probably need to make _N-1_ (_N_ if you want the card to stay in the deck) clones of the card, and then send those copies to the distinct locations. Since the [Clone](https://vassalengine.org/doc/latest/ReferenceManual/Clone.html#top) trait does not allow you to send a key-command to the copies, a better way may be to use the [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) trait, as this will allow you to both set a dynamic property in the clone _and_ send a key-command.

The key command to create the _N-1_ (or _N_) could be a [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top) trait that loops _N-1_ times, and on each iteration calls the [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) trait. The _Set Dynamic Property_ could set some internal property to the loop parameter so that the clone knows which copy it is, and the key-command could be another [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top) trait that switches on the internal property and calls a [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top), based on that internal property, to go to right location.

Note, the marker to place with [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) trait cannot be specified via a BeanShell expression, so each card would need its own [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) trait (it can not be put in a prototype).

Let us take the case where you want to leave the card in the deck. Then you could have

- Card `A`
  - [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top)
    - Select: `A`
    - key: `placeClone`
    - Set dynamic property: Name=`CopyNo`, value=`{CopyIter}`
    - Send key command: `sendToDestination`

  - [Dynamic Property](https://vassalengine.org/doc/latest/ReferenceManual/DynamicProperty.html#top)
    - Name: `CopyNo`
    - Is numeric: `true`
    - Initial value: `-1`

  - [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
    - Name: `sendToDestination`
    - Property: `{CopyNo==1}`
    - Action Keys: [`sendToDestination1`]

  - …
  - [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
    - Name: `sendToDestination`
    - Property: `{CopyNo==N}`
    - Action Keys: [`sendToDestinationN`]

  - [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top)
    - key: `sendToDestination1`
    - …

  - …
  - [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top)
    - key: `sendToDestinationN`
    - …

  - [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
    - Name: `Destribute`
    - Loop: `true`
    - Count: `N`
    - Loop index: `CopyIter`
    - Action keys: [`placeClone`]

A [Deck Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommands.html#deck) _should_, if you set number of cards to `{N}` send to _N_ cards. But there’s no way for the cards to know which number it is, so you’d have to do some more complicated book-keeping via some global property or properties. For example, each command send to the cards may call a [Set Global Property](https://vassalengine.org/doc/latest/ReferenceManual/SetGlobalProperty.html#top) trait to increment a counter, and then use a switch like above to send to the appropriate destination. However, the first time it is sent, it should somehow recognise that and reset the counter to 0 or such. This is not trivial.

Perhaps you want a fully fledged [Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommands.html#top) that only addresses cards in a specific deck (fast select), and which could be triggered by a user facing [Multi-Action Button](https://vassalengine.org/doc/latest/ReferenceManual/MultiActionButton.html#top) so that the counter can be reset before the commands are sent.

The real difference between a [Deck Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommands.html#deck) and a [Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommands.html#top) is that only cards in the deck can be addressed in the latter case. A similar effect can be achieved by appropriate filters in a [Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommands.html#top).

Perhaps, if you outline in a bit more detail what is you want to do, then we may be able to narrow it down a bit more.

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:38pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/3 "2026-05-12T19:38:04Z")

</div>

![Screenshot 2026-05-12 091303](https://forum.vassalengine.org/uploads/default/original/2X/f/f772e2c4daabfcc387e83e0908f1342498cb089b.jpeg)

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:38pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/4 "2026-05-12T19:38:29Z")

</div>

first, set up GKC

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:39pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/5 "2026-05-12T19:39:15Z")

</div>

![Screenshot 2026-05-12 091403](https://forum.vassalengine.org/uploads/default/original/2X/4/49dd0462767c726be71bf8bf744029044cf8e9c1.jpeg)

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:39pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/6 "2026-05-12T19:39:37Z")

</div>

second, set up STLs

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:40pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/7 "2026-05-12T19:40:07Z")

</div>

![Screenshot 2026-05-12 091456](https://forum.vassalengine.org/uploads/default/original/2X/2/2d4ad6ebde722e9161b304570198cb50f588d679.jpeg)

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:41pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/8 "2026-05-12T19:41:05Z")

</div>

![Screenshot 2026-05-12 091524](https://forum.vassalengine.org/uploads/default/original/2X/d/dabaa2b075d2573ae95a34aabc0c7450fa1a2714.jpeg)

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:41pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/9 "2026-05-12T19:41:33Z")

</div>

Third, set up triggers

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:42pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/10 "2026-05-12T19:42:10Z")

</div>

![Screenshot 2026-05-12 093955](https://forum.vassalengine.org/uploads/default/original/2X/1/1dad757cf621844a3ea992497261469aee483b74.jpeg)

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:44pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/11 "2026-05-12T19:44:13Z")

</div>

results, if I choose all on Affects The Deck sends the whole deck to 1 Location. If I choose 1 on Affects The Deck sends the 1 card to 1 Location.

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 7:45pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/12 "2026-05-12T19:45:45Z")

</div>

I’m trying to right click on deck then click DEAL and make it send 1 card to the 6 Locations I made using STL. Thx for any help

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 8:18pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/13 "2026-05-12T20:18:32Z")

</div>

I can do them on a StartUp GKC but each card sent has to have it’s own GKC. Maybe this is not possible to do on a Deck GKC. Maybe you can only send a certain amount of cards to a location or all the cards to a location. Can’t send 1 card each to several locations. IDK

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [May 12, 2026, 8:31pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/14 "2026-05-12T20:31:31Z")

</div>

All your cards will receive `DealAdventures`, which in turn then executes _all_ `SendToHandOne` through `SendToHandSix`, and then `SendToExpeditionFive` and `SendToExpeditionSix`

 ![](https://forum.vassalengine.org/uploads/default/original/2X/d/dabaa2b075d2573ae95a34aabc0c7450fa1a2714.jpeg)

Thus, all the cards will end up wherever `SendToExpeditionSix` send them. If you want the cards to end up in different locations, then you have to somehow propagate some sort of index to the cards so that they will only execute the [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top) trait where it should go. That’s what I outlined above.

Am I correct in assuming that what you really want to do, is

- User presses a button or select a command from the deck.
  - The cards in the deck are possibly shuffled
  - The cards are then, one by one, dealt to 8 different locations, effective as if a dealer was dealing cards to 8 players - one card at a time.

(It was this kind of narrative I was looking for when I asked you to specify what it is you are trying to accomplish).

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 9:01pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/15 "2026-05-12T21:01:34Z")

</div>

yes you are correct.

---

<div class="post-metadata">

**Author:** ![bhfredjenni](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/bhfredjenni/32/7601_2.png) [@bhfredjenni](https://forum.vassalengine.org/u/bhfredjenni)\
**Post date:** [May 12, 2026, 9:14pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/16 "2026-05-12T21:14:54Z")

</div>

I ended up using the drop down menu for the deck in my furnace module and just having to send a card to each location. There was only 7 locations so not too much but I guess it would have been just as fast to drag & drop them. I did use a draw card button in my Star Wars Unlimited Module but trying to figure out a faster way to deal a deck with 1 click seems like more of a headache. I really enjoy making the modules especially with no Java Scripting knowledge and I know sometimes I’m going to run into situation like the one above. But you guys have always helped out and showed me ways to work it out and you don’t really see that too often anymore in other places. So thanks for the reply and looking forward to another adventure soon! Thx Freddie Christian

---

<div class="post-metadata">

**Author:** ![il-Roberto](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@il-Roberto](https://forum.vassalengine.org/u/il-Roberto)\
**Post date:** [October 20, 2026, 9:37am UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/17 "2026-10-20T09:37:45Z")

</div>

Hi, I need to draw _N_ distinct cards and send each card to a separate location.  
I’m trying to figure out how to go about it, starting from your suggestion.

In my module I need to send 1 random resource to 6 different locations.  
I’ve created a global property `southL` 1-6 wrap  
Each prototype resource has these traits:

- Trigger
  - Key command: `replenishS`
  - perform this key: `updateSouthL`

- Set Global Property
  - Global Property name: `southL`
  - key command `updateSouthL` increment 1

- Trigger N (one for each location)
  - key command: `replenishS`
  - property match: `{southL==N}`
  - perform this key: `sendToLocationN`

- Send To Location N (one for each location)
  - key command: `sendToLocationN`

Then I have a GKC `replenishS` and within a deck apply to 6.  
Is this the right way?

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [October 20, 2026, 4:55pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/18 "2026-10-20T16:55:56Z")

</div>

> [@il-Roberto](#):
>
> Then I have a GKC `replenishS` and within a deck apply to 6.  
> Is this the right way?

Take a look at the [post above](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/2). For this, you will also need a way to reset `southL` to `0`. You can accomplish that via a [Multi-Action Button](https://vassalengine.org/doc/latest/ReferenceManual/MultiActionButton.html#top) that calls a `Change Property` on the Global Property `southL` _before_ the `replenishS` command is sent to the deck.

Another way, assuming you will _always_ deal `M` cards, is to have in your `Trigger` traits

- Trigger N (one for each location)
  - key command: `replenishS`
  - property match: `{(southL % M)==N}`
  - perform this key: `sendToLocationN`

The expression

```auto
x % M 

```

calculates the integer remainder of divding `x` with `M` - it is called _modulo_. For example

```auto
0 % 3 = 0 - because 0/3 = 0
1 % 3 = 1 - because 1/3 = 1/3
2 % 3 = 2 - because 2/3 = 2/3
3 % 3 = 0 - because 3/3 = 1 - whoops made a mistake here, corrected
4 % 3 = 1 - because 4/3 = 1 + 1/3 
5 % 3 = 2 - because 5/3 = 1 + 2/3
6 % 3 = 0 - because 6/3 = 2 
7 % 3 = 1 ...

```

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![il-Roberto](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@il-Roberto](https://forum.vassalengine.org/u/il-Roberto)\
**Post date:** [October 21, 2026, 9:00am UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/19 "2026-10-21T09:00:45Z")

</div>

> For this, you will also need a way to reset `southL` to `0`

**Set Global Property**

- Global Property name: `southL`
- key command `updateSouthL` increment 1
- `wrap around` checked ☝
- Min value 1, max value 6, is numeric checked

No need to reset with `wrap around` checked

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [October 22, 2026, 10:47pm UTC](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130/20 "2026-10-22T22:47:51Z")

</div>

> [@il-Roberto](#):
>
> - `wrap around` checked ☝
> - Min value 1, max value 6, is numeric checked

Just to be clear, this assumes you _always_ deal 6 cards.

[Next page](https://forum.vassalengine.org/t/deck-global-key-command-sending-to-multiple-locations/90130.md?page=2)
