Can a GKC in on one map window shuffle a deck on another?

I am using Vassal 3.2.2 and Win 7.

I am working on a game with a draw deck. The shuffle property must be set to a right-click option because I need to be able to drop in cards on top of the draw deck, yet once it is empty and the discard deck is sent back, I will have to reshuffle the new draw deck.

I wanted to set up a global key command button on the icon toolbar in a player’s hand window so he could reshuffle his deck from there.

When I created the GKC, I tried this statement on Matching Properties, but it did not work (meaning when I clicked the button, it did not force the reshuffle):
(CurrentMap==“Main Map”) && (DeckName==“CarthageDraw”)

I then made a map zone around the draw deck and tried this for “Matching Properties”:
(CurrentMap==“Main Map”) && (CurrentZone==“Carthage Draw”)

I have checked and the names of the zones and decks are correct.

My “Key Command” field is ALT CTRL T, which matches the right-click command I defined on the deck to cause a right-click reshuffle.

I unchecked the box for “Apply to counters on this map only?”

On the drop-down for “Within a Deck, apply to:” I selected “All Pieces”

Am I missing something, or am I asking for the module to attempt the impossible?

Thanks

What is the name of the player’s map? Right now you are setting the
expression to look at the Main Map with (CurrentMap = “Main Map”). It should
be CurrentMap = Player Map Name

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of airjudden
Sent: Monday, April 01, 2013 11:50 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Can a GKC in on one map window shuffle a
deck on another?

I am using Vassal 3.2.2 and Win 7.

I am working on a game with a draw deck. The shuffle property must be set
to a right-click option because I need to be able to drop in cards on top of
the draw deck, yet once it is empty and the discard deck is sent back, I
will have to reshuffle the new draw deck.

I wanted to set up a global key command button on the icon toolbar in a
player’s hand window so he could reshuffle his deck from there.

When I created the GKC, I tried this statement on Matching Properties, but
it did not work (meaning when I clicked the button, it did not force the
reshuffle):
(CurrentMap==“Main Map”) && (DeckName==“CarthageDraw”)

I then made a map zone around the draw deck and tried this for “Matching
Properties”:
(CurrentMap==“Main Map”) && (CurrentZone==“Carthage Draw”)

I have checked and the names of the zones and decks are correct.

My “Key Command” field is ALT CTRL T, which matches the right-click command
I defined on the deck to cause a right-click reshuffle.

I unchecked the box for “Apply to counters on this map only?”

On the drop-down for “Within a Deck, apply to:” I selected “All Pieces”

Am I missing something, or am I asking for the module to attempt the
impossible?

Thanks


Read this topic online here:
https://forum.vassalengine.org/t/can-a-gkc-in-on-one-map-window-shuffle-a-deck-on-another/5875/1

I did name it “Main Map” I checked to make sure that every map and deck name was correct and that I did indeed name it “Main Map” and not “MainMap”, as I knew that would cause it to fail.

That’s why I wasn’t sure I was asking it to do the impossible.

Well you aren’t asking the impossible and if it’s still not working then it must be something you are doing wrong, but besides what you have told us which seems right and not being able to see it there is little more to go on

I wanted to see if it was the deck or the map text giving me problems, so I decided to systematically check them. First, the map name:

For the cards, I created a Return To Deck property that would send it back to the draw deck. Then I created a GKC that would send them back from another map. All the cards were going to the deck “CarthageDraw”.

My Matching Property line in the GCK is:
(CurrentMap==“Main Map”) && (CurrentZone==“Carthage Discard”)

And when I click it, it works. That tells me that the “Main Map” is fine and that it has no problem with that zone.

But when I create a GKC to shuffle that draw deck (CarthageDeck), it will not work.

I have tried both of these “Matching Property” lines:

(CurrentMap==“Main Map” && DeckName==“CarthageDraw”)
(CurrentMap==“Main Map”) && (DeckName==“CarthageDraw”)

I know Main Map is fine because it worked above. So I figured it was “CarthageDraw”. I went back to my draw deck item. Opened it up, copied the name “Carthage Draw” and pasted it into that Matching Property line, so that I knew the lines matched.

My command to that deck is ALT CTRL T.

On the Deck object, under “Re-Shuffle Hot Key” (right-click to shuffle) it says ALT CTRL T

I have triple & quadruple checked to make sure these match. I even created screen shots of the objects to see for yourself:

boardgamegeek.com/image/1624182/ … e=original

Are you SURE that what I am asking is possible? I can’t think of a single reason why this wouldn’t reshuffle unless the deck command couldn’t be sent through the GCK.

Thanks

boardgamegeek.com/image/1624182/ … e=original

Ahh now I see it. You need to modify the GKC slightly

In the hotkey field on the GKC trait also match the hotkey from the deck so it
all links


From: airjudden airjudden@hotmail.com
To: messages@vassalengine.org
Sent: Wed, April 3, 2013 12:31:38 PM
Subject: Re: [messages] [Module Design] Can a GKC in on one map window shuffle a
deck on another?

I wanted to see if it was the deck or the map text giving me problems,
so I decided to systematically check them. First, the map name:

For the cards, I created a Return To Deck property that would send it
back to the draw deck. Then I created a GKC that would send them back
from another map. All the cards were going to the deck “CarthageDraw”.

My Matching Property line in the GCK is:
(CurrentMap==“Main Map”) && (CurrentZone==“Carthage Discard”)

And when I click it, it works. That tells me that the “Main Map” is
fine and that it has no problem with that zone.

But when I create a GKC to shuffle that draw deck (CarthageDeck), it
will not work.

I have tried both of these “Matching Property” lines:

(CurrentMap==“Main Map” && DeckName==“CarthageDraw”)
(CurrentMap==“Main Map”) && (DeckName==“CarthageDraw”)

I know Main Map is fine because it worked above. So I figured it was
“CarthageDraw”. I went back to my draw deck item. Opened it up, copied
the name “Carthage Draw” and pasted it into that Matching Property line,
so that I knew the lines matched.

My command to that deck is ALT CTRL T.

On the Deck object, under “Re-Shuffle Hot Key” (right-click to shuffle)
it says ALT CTRL T

I have triple & quadruple checked to make sure these match. I even
created screen shots of the objects to see for yourself:

boardgamegeek.com/image/1624182/ … e=original[1]

Are you SURE that what I am asking is possible? I can’t think of a
single reason why this wouldn’t reshuffle unless the deck command
couldn’t be sent through the GCK.

Thanks

boardgamegeek.com/image/1624182/ … e=original[2]

[1] boardgamegeek.com/image/1624182/ … e=original
[2] boardgamegeek.com/image/1624182/ … e=original


Read this topic online here:
https://forum.vassalengine.org/t/can-a-gkc-in-on-one-map-window-shuffle-a-deck-on-another/5875/5

I though “Key Command” links it to the command you want to execute?

Anyway, I tried it and it didn’t work.

I had also created a GKC that would send the discard pile back to the draw deck. I had left the hot key blank on it and filled in the key command with the same command as the “Return to deck” hotkey. It works just fine.

That is why I tried it on the shuffle draw deck GKC and it didn’t work. I tried to add the draw deck hot key into the GKC hot key and I tried various iterations between the hot key and key command and none of them worked.

Here is a picture of my attempts along with the other GKC that did work:
boardgamegeek.com/image/1624328/ … e=original

And if you need to see the draw deck data again, here is its picture:
boardgamegeek.com/image/1624182/ … e=original

Okay, see attached demo inside zip. Checked and works both returning cards to deck and shuffling. Needed a hidden hotkey relay from GKC to Deck.
Very simple to follow, everything is under main map

[attachment=0]GKC Deck Relay.zip[/attachment]

WOW!!! :astonished:

Dude, you rule! I would have never figured that out in a hundred years!

Thank you so much!!!

Any clue about how to modify the example module given so that it is possible to shuffle a deck in a different map? My trial and error turns to be fruitless :frowning:

Check out Tim’s .ZIP file. It really works.

  1. On the map with your deck, create an object. I call it “HiddenCounter”. Use Tim’s example and be sure to give it the “Does not Stack” property and then give it a Global HotKey Command. The “Keyboard Command” in that field is the combo needed to trigger this object (let’s say “CTRL 1”) and the “Global Hotkey” field should be the key combo required to force the reshuffle (as defined in the deck properties).

  2. From any window and with any object you can force the reshuffle. If you use a Global Key Command on another window, set the “Key Command” field to be the same as listed above (CTRL 1) and on “Matching Properties”, use BasicName==“HiddenCounter” (in the example above).

When you click the Global Key Command, it sends CTRL 1 to Hidden Counter, which sees it and converts it to the command to reshuffle the deck.

You can also have various objects execute the reshuffle. For instance, you could right-click on a counter. That item would need to have the “Global Key Command” property and then the “Global Key Command” property would be the one you pass (CTRL 1 in the example I gave) and “Matching Properties” would again need to be: BasicName==“HiddenCounter”
You would need to give it the appropriate Keyboard Command also.

Thank you for the quick response!

Sadly I could not make it work. Actually, it only works if the hidden counter and the GKC are in the same map; if not, there is no shuffling. Just to be sure, I have modified Tim’s module, and moved the deck and the hidden counter to a new map. It stops working there.

May be the GKC is not “seeing” the counter when it is in a different map?

Tell ya what: if you are a “learn by example” guy like I am, go out and grab the new Blue vs. Gray module (I updated it).

Go to the “ControlMap” [Map Window]
Near the bottom of the items under it – 3rd from the bottom is “HiddenCounterSetUp” [Single Piece].
Check out the “Global Hotkey - Shuffle Everything” property.

4 items from the bottom is “Non-Historical Setup Button” [At Start Stack]
Underneath it is “ButtonNo” [Single Piece]
Examine the “Global Key Command - Shuffle” property.

These are on the same map, but it doesn’t matter. It would work if this button were on a different map.

For additional reference, go up a few more spots on that map - above “Non-Historical Setup Button” and locate “NorthStore” [Deck] and there you can see the reshuffle command.

So when you click the Non-Historical Setup Button", that triggers ALT F1.
ALT F1, in turn, triggers CTRL F1 to be sent to “HiddenCounterSetUp” (in “Global Key Command - Shuffle”: note that “HiddenCounterSetup” is in the “Matching Properties” field)
When you open HiddenCounterSetUp", you see that it takes CTRL F1, and sends out ALT F10 (in “Global Hotkey: Shuffle Everything”)
That sends out ALT F10 to everything on the map where “HiddenCounterSetUp”, which in this case, is the decks.
The decks see ALT F10, and that triggers them to shuffle.

Note “DeckName” was never called out anywhere in that sequence.

The key is you “HiddenCounter” (or whatever you choose to call it – the item that has the Global Hotkey in it) MUST be in the same map window as the decks that need shuffled. Then when you wish to access it, your “Matching Properties” field must call out that item specifically. The Global Hotkey just acts like a relay.

Yes, I’m a “learn by example” girl :wink:

Thanks again for your patient explanation. Nonetheless, what you tell me here is something I have already achieved. Sorry if I didn’t make myself clear.

I can use this technique to make a button that shuffles a deck, if the button (using a GKC) is in the same map that the hidden piece with the Global Hotkey. The example you’ve given me performs this precisely. But as soon as I move the button to another map (both hidden piece and deck to be shuffled remain in the same map), it no longer does the shuffling. This has happened in both my module and the one given by Tim :frowning:

[attachment=0]GKC MultiMap Deck Relay.zip[/attachment]

see the attached mod. Multi map deck relay shuffle demo
This does what you want

Thank you, TIM!

That totally solved it. The point is that the GKC and the hidden piece with the Global Hotkey must be in the same map!