Help getting global key command to draw a card

I’ve made a prototype for cards in a deck called “Creature Deck” that contains a ‘Send to location’ trait with the keyboard command ‘CTRL W’ to send the card to the ‘Region Name’ called ‘Draw’ on the ‘Main Map’. This command works just fine. However, I want to send a card from the deck. The deck is located on a different map called “Decks”. So I made a Global Key Command for the ‘Decks’ map with the Key Command CTRL W. Matching properties is {(CurrentMap==“Decks”)&& (DeckName==“Creature Deck”)}. It’s set to take a fixed number of pieces (1) and makes a button called Draw Creature. But nothing happens when I click it. I know it’s almost right, but I’ve tried everything I can think of (it’s my first module). Is something wrong with the matching properties?

You have “apply to counters on this map only”. So depending on where your button is that’s issuing the GKC, it will only issue to things on that map (I couldn’t tell from your description if your button was on the same map where your cards originate from).

I would also change the hotkey field from “Draw Creature” to maybe Draw Creature (no quotes), though I’m not sure that will matter.

The next set of things I would recommend for troubleshooting is to first remove your filters and see if you can just get the thing drawing ANY card (even if from the wrong deck or whatever), and then introduce the filters back in one at a time and you can figure out which one is the problem (e.g. is the deck name mismatching, etc)

Thank you, I tried all three of your suggestions and made some progress. Removing the entry in the matching properties made the draw button function, but still not how I intend. The button sends the cards to the desired location on the map only if I manually draw a card from the deck first. It cannot remove a card from inside the deck. Does the deck need to have a specific setting to allow it?

I also noticed I can add a Deck Global Key Command. So I added one to the ‘Creature Deck’ and included the same CTRL W key command but it didn’t change anything.

A regular Global Key Command can access a card/piece that’s in a deck, as long as the matching function finds it – in this case it is also restricted by the “within a deck, apply to:” number of pieces choice. I use regular GKC’s to set up my scenarios in For the People and it moves Forts and Cards right out of my Decks w/ no problem.

A DECK Global Key command (DGKC, I guess) lets you put a right+click menu option on your deck, so e.g. you could have a right+click function to “Draw a card” or “Draw 7 cards” or something like that.

Where does the button send the cards if you haven’t manually drawn a card yet? (Or does it not send anything anywhere?) I notice you have “apply to counters on this map only” checked – is the deck you want drawn from on the same map as this GKC originates from? Otherwise this checkbox will prevent it from finding things (and if you then drew a card manually from the deck and put it on the map that the GKC comes from, then it would do it, so I could see this could match the symptom you are reporting).

Let me know how it goes. If you get really stuck, you could upload your module and I could take a look.

I figured out the issue. I guess the engine doesn’t like having names with spaces in them. I removed the spaces from the deck name and the corresponding GKC and also from the card prototype definition and the corresponding trait on the cards. One or both of those seems to have done the trick. It was definitely the cause of the problem because the only change I made was deleting the space - so there couldn’t have been mismatched spellings/typos. But it seems odd that spaces aren’t allowed, especially since we put the name in quotations. BTW another thing I learned is that the “send to location” trait must appear below any mask trait in a prototype otherwise it will not work.

I see, the DGKC sounds useful. And to answer your question, the button and the decks are located on one map while the draw location is located on another map. I unchecked “apply to counters on this map only” after your first message and the button could send cards there from any map so long as they were not located in the deck.

Anyways, thanks so much for the help and offering to check the module. I’ll take you up on it if I ever run into a bigger impasse :smiley:

Ah, yes, spaces in names can sometimes cause problems, particularly in expressions. You can sometimes force your way around it by using e.g. GetProperty(“Name With Spaces”). But other times there may be no way around, so yeah watch out for naming things with spaces. I still catch myself doing it.

If your Send-To-Location is ABOVE the mask, I believe it will only respond when the piece is not masked from you at the time you run it, and maybe only if the piece is OWNED by you. So yeah, below is likely to be what you want for this.