Global Key Command Help

The situation:

I have a Deck which resides in a Private Window. However, the Discard Pile for this deck resides on the main map (i.e., the Deck window’s parent). All the cards in the deck are set with a Return to Deck property, and a Marker ‘card = true’.

On the toolbar of the Private Window Deck, I have defined a Global Key Command which is supposed to send the keystrokes to actuate the Return to Deck property of the cards in the Discard Pile. I have set this key command to test for the properties: CurrentMap = Board && CurrentZone = Discard Pile && card = true

The button, however, does nothing. What have I missed? Is that a Global Command cannot function at a level of hierarchy outside where it is defined? Have missed out something else. I’ve checked and rechecked my spellings of properties, so I am fairly certain the error is not in the data.

Thanks!

From your description, I’m not quite sure where you’re attempting to take the card from and where you’re sending the card to. From your properties line, it appears you are trying to take a card from the Discard pile and send it somewhere. In other words, you’re directing the command to trigger a card in the discard pile. Is that what you want to do?

It doesn’t matter where you place a button in relation to what you want activated as long as you’ve correctly routed the command to the target and the target can accept the command.

I thought I had been quite clear. Capitalized terms are to be taken as VASSAL terms:

In a Private Window resides a Deck (which we’ll call “draw”)
On the Main Map resides another Deck (“discard”) with a Zone (also called “discard”) defined for it.

So the cards are drawn from the Private Window Deck “draw”, and when played they are put in the Main Map Deck “discard”

What I want is a Global Key Command in the toolbar of the Private Window (not Main Map) which actuates the Return to Deck (“draw”) Property embedded in each of the cards involved.

Funnily enough, when I define my Global Key on the Main Map, it functions as expected, so I have certainly routed the command properly to the pieces to be affected (at least from that level) and the pieces are properly set to accept that command. The exact same Global Key defined in the toolbar of the Private Window (where I would rather it be for security reasons) does not function (in order to ensure no data entry error, I copy/pasted the data from the functioning, but wrongly located button, to the non-functioning but properly located one).

In the attached image, the Global Command Key which is highlighted is the one I want (it’s properties window is shown just to the right - note the Tool Tip text).

Check your variables! Did you really call the Map “Board”?
Might also want to add in CurrentBoard = xxxx if you have more than 1 board defined under that map

From: miyazakigrognard messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Sunday, December 21, 2008 4:46:39 PM
Subject: [Module Design]Global Key Command Help

The situation:

I have a Deck which resides in a Private Window. However, the Discard Pile for this deck resides on the main map (i.e., the Deck window’s parent). All the cards in the deck are set with a Return to Deck property, and a Marker ‘card = true’.

On the toolbar of the Private Window Deck, I have defined a Global Key Command which is supposed to send the keystrokes to actuate the Return to Deck property of the cards in the Discard Pile. I have set this key command to test for the properties: CurrentMap = Board && CurrentZone = Discard Pile && card = true

The button, however, does nothing. What have I missed? Is that a Global Command cannot function at a level of hierarchy outside where it is defined? Have missed out something else. I’ve checked and rechecked my spellings of properties, so I am fairly certain the error is not in the data.

Thanks!


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

Tim, as I stated, the one button at the level of Main Map functions, but the other - the one where I want it - does not. Both are defined exactly the same. Yes, the Main Map is simply called “Board”. It’s all there in the attached image (which maybe you did not see since I was having difficulty with the upload - it’s there now).

Ok I see it now, like I said for fun n grins try it by also adding in the pme CurrentBoard = whatever, as well. I’ve occasionally run into some oddities of button gkc’s not acting across maps properly even when I am certain syntax is correct and it works in other places. Usually I’ve found it is a problem of the saved module state (read: buildfile) - I’ll go in remove it completely, save the module, close and restart then add back in then all of a sudden it works as intended.

Still got problems send it over and I’ll take a crack real quick

Tim

From: miyazakigrognard messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Sunday, December 21, 2008 6:18:16 PM
Subject: [Module Design]Re: Global Key Command Help

Tim, as I stated, the one button at the level of Main Map functions, but the other - the one where I want it - does not. Both are defined exactly the same. Yes, the Main Map is simply called “Board”. It’s all there in the attached image (which maybe you did not see since I was having difficulty with the upload - it’s there now).


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

From your description, I can think of two things:

If you are moving a card from the Private Window to a Discard deck, then your command should be directed at the Deck in the Private Window and that command would activate a Return to Deck trait which would send it to the Discard deck. It appears that you’re directing the command at the Discard deck which would only affect cards already in the Discard deck.

Then again, you’re attaching a Global Key Command to an At-Start Stack which is something I’ve never done before so this may be beyond my personal experience. If I were going to do something like this, I would probably add a Game Piece to the At-Start Stack, define it as an Action Button and have the button trigger a Global Key Command.

Someone else who has had more experiences directly applying a Global Key Command to an At-Start Stack my be able to shed more light on this.

I tried adding CurrentBoard, but still no joy. The one button - the undesired one - works (with or without that addition of CurrentBoard). So, I guess we’re at what surmise – weird anomalous bugaboo. Just before trying to create the Global, I had attempted to use the “Edit All Contained Pieces” command on the deck in there with the result that nothing occurred, and I ended up having to edit each card individually. I wonder if that command is (or sometimes can be) the culprit. I seem to recall that you intimated something along those lines to me in a previous e-mail.

Well, back to wrasslin’ with vassal. Thanks for the input, and I’ll let you know one way or the other.

Mac

The command is properly targeted, as it is intended to return the cards which eventually accumulate in the discard pile back to their draw pile.

It’s not attached to the at-start stack, but shares the same parent (the Private Window - look at the hierarchy).

The one button defined on the Main Map level functions correctly, and is identical in all respects to the non-functioning one.

I think that Tim must be right (which unfortunately means I have to rebuild some things from scratch).

Well, I tried rebuilding just the private window and all its contents from scratch, and still it’s a no-go. I’ll send the file to Tim (good ol’ Tim!).

Fixed - sending back

From: miyazakigrognard messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Sunday, December 21, 2008 7:37:41 PM
Subject: [Module Design]Re: Global Key Command Help

miyazakigrognard wrote:

Well, I tried rebuilding just the private window and all its contents from scratch, and still it’s a no-go. I’ll send the file to Tim (good ol’ Tim!).


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

A Global Key Command added to a Map only sends commands to units in that Map, so the behaviour is as expected.

You have to either

a) Attach the GKC to the Map where the Discard Deck is

or

a) Attach it at the Module Level, where it will issue the commands to all counters on all Maps.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

That’s what I had suspected. Thanks for verifying that, Brent. (Seems counter to the definition of the term “global” but I am admittedly fastidious in my literalism :slight_smile: )

I have opened an RFE to add an additional option to the Map Global Key Command to

‘Limit to counters on this Map only’

which will default to Yes (to maintain compatibility).

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)