Global Key Command – Within a deck apply to all pieces not w

Global Key Command – Within a deck apply to all pieces not working

I may be doing something wrong, but there appears to be a bug in the “Within a deck apply to” trait in the Global Key Command.

On a map I set it to “All pieces” but it does not affect pieces in the deck with the appropriate properties. The same pieces are correctly affected by the GKC when not in the deck.

I have also tried setting it to affect a number of pieces within a deck and that does not work either.

Vassal 3.2.16
Java version 8 update 101
Aspire E1-771
OS Windows 10

The module is still being designed you can download it together with a short log file demonstarting the problem from the following mediafire link. Note the module is rather large and takes a few seconds to start up.

I downloaded it and I’ll take a look at it but I’m guessing there’s a typo somewhere. I’ll let you know.

There’s a lot of GKC’s in here. Could you tell me which one is not working and what decks you want it to affect?

The GKCs under the Alignment Menus should affect the decks in the Minor Force Pool for the corresponding Nation. For example if the Argentina force pool deck contained a piece that had a Nation Marker = Argentina and the GKC for Alignment Argentina to CW was hit in the menu then all pieces with that Nation Marker should have their Alignment set to CW. It works on all pieces that are not in a deck, but does not work on units in any decks.

I have not gone far enough in the design yet to have the pieces all set up but if you play the short log file it should demo the problem.

Basically none of the GKCs under the sub menu Alignment A-I or J-Z work on pieces that are in any decks – I have tried creating test decks all over the place and the GKCs will not affect pieces in the decks, just pieces not in decks. The same GKC also sets a flag in the relevant force pool.

I think I should explain that the units that are already in the decks at start up are not expected to be affected by the GKCs (they are just there as placeholders - a piece has to have a Nation marker set for the GKCs to work on it. The demo log uses a piece that has a Nation marker of Argentina and shows that when the GKC changing the Aligment for Argentina is activated it works on the piece when not in a deck, but does not work if it is in a deck. This is true no matter which deck it is in.

I think the issue is where the Global Key Command is used. I’m not too familiar with using GKC in the toolbar so someone may correct me. But I think that if you use it in the menu toolbar, it will only affect items on the map. If you want it to affect items in a deck, then you have to use a Deck Global Key Command. That’s why it says, “Within a Deck, apply to”. Since you GKC is not within a deck…

For stuff like this, I tend to use At Start Stack buttons as you can give it any traits you give to any game piece allowing you the control to do whatever you want. In the module I’m using for my games, anything that has been injured heals 1 Hit Point at the beginning of a new round. Within the button for going to the next round, there’s a Trigger Action that fires off a multitude of commands for several GKC’s within the button piece. One fires at a GKC that gives a Hit Point to anything that can heal and that is wounded. The property for that is simply “Heal = Yes” and that will work with all pieces in the module that has that marker.

You could also create invisible At Start stacks using a 10x10 blank graphic, for example. Give it a Does Not Stack trait where it can’t be selected or moved and no one will know they are there nor can the be moved. Then have your toolbar GKC’s fire a command at that and use that to send out whatever commands you like. I have found this trick to come in handy on a couple occasions.

Thanks for taking the time to look at this and thanks for the tips. Unfortunately I cannot use at start stacks as I need to be able to draw the pieces from the decks face down and I also need to be able to draw specific and multiple pieces from the deck. It is a complicated production system that I am trying to replicate.

With reference to your comments on GKCs if what you say is correct then I do not understand why there is a “Within a deck apply to” property in a GKC if in order to affect a Deck you have to use a Deck Global Key Command.

I tried messing about with Deck Global Key commands but all it does is give you a menu option on the deck to trigger a Deck Global Key Command that only affect units in a deck.

Also the Help documentation states:

“Within a Deck, apply to: Select how this command applies to pieces that are contained within a Deck. No pieces means that pieces in a Deck ignore the command. All pieces means that the command applies to the entire Deck. Fixed number of pieces allows you to specify the number of pieces (drawn from the top) that the command will apply to.”

So I still think that the “Within a Deck apply to” property is broken as it does not seem to work at all.

I have been doing some exerimentation by creating a new simple module and GKCs work correctly affecting pieces within decks with a simple GKC that just does the one thing. So something I have done within this module is preventing it from affecting pieces within decks, but I do not know what yet. I will try and narrow it down.

I suspect that it might have something to do with the additional triggers that are fired by the GKC which cause pieces in a specific zone to have them replaced with another piece. (the Flags showing Alignment)

Maybe a GKC is applied in a particular order and affects units in maps then in zones and then in decks and for some reason the command in the zone which triggers an action i.e. a replace with other piece is then preventing the GKC affecting pieces in decks. Just guessing here.

You may be right in your assumptions as it does seem logical. However, I was taking another look at your module and from what you described, the “Arg to CW” GKC is supposed to affect the pieces in the “Argentina Pool [Deck]” in the “Minors Force Pool [Map Window]” within the “Minors/Partisans [Panel]”. Is that correct?

If so, the pieces within that deck don’t have a marker for Nation=Argentina or FlagNation=Argentina. Am I missing something?

The pieces in the deck at the moment are just placeholders. When I test it I put a piece in the deck that does have the marker Nation=Argentina (as per the demo log). In fact the GKC should affect any piece with the marker Nation=Argentina no matter where it is even if in any of the other decks.

The NationFlag=Argentina is a different property assigned to a zone that contains a piece which the GKC affects by triggering an action within the piece to replace it with another piece. This in effect changes the flag just above the deck in the Status zone.

The GKC seems to action correctly on pieces on all maps, except for pieces in Decks and it also actions correctly on the pieces in the Zone with the matiching FlagNation property.

My guess is that it actions the Key command on the pieces on the maps not in decks with matching marler Nation=Argentina first, then it actions the pieces in the Zone with matching property NationFlag=Argentina which triggers an action of replacing the piece in that Zone with another piece, then maybe it fails to action against pieces in decks with the property Nation=Argentina possibly because of the trigger in the Zone which causes another keystroke.

OK I think I am narrowing it down. I put a report action in the piece to report when and where its Alignment property is changed by the GKC. It seems that the pieces in the deck are being changed (according to the report action) but when I pull them from the deck they are being reset to the Alignment property they had when they were put in the deck.

Does not make sense but that seems to be what is happening.

Solved it.

It was the trait order within the piece would you believe?

By moving the Mask trait above the other traits all works well, except that the Mask option on the menu is not exactly where I would like it to be i.e. it is now at the bottom instead of at the top, but I can live with that.

There is absolutely no rhyme nor reason for it as far as I can see but that was what the problem was.

So GKC works fine with regard to Decks, its the trait order of pieces that seems to be buggy, causing unexpected and undocumented behaviour, or so it appears.

Thanks for your time and effort DrNostromo, much appreciated.