If have a deck with the “Send hotkey when empty” set, that hotkey is sent ONLY in the window containing the deck is open.
If you have some other way to draw cards (like a button in the player hand that sends a command to the card), the hotkey is not invoked when the window is closed, but works normally if the window is open in the background.
Thus spake luizborges:
If have a deck with the “Send hotkey when empty” set, that hotkey is
sent ONLY in the window containing the deck is open.
If you have some other way to draw cards (like a button in the player
hand that sends a command to the card), the hotkey is not invoked when
the window is closed, but works normally if the window is open in the
Isn’t that the expected behavior for a hotkey?
I don’t think so. If the Deck empties it should send the hotkey as described.
For comparison, I can cause a piece to call a HotKey even with the window closed, sending a command to it from another window. Actually this is what I’ve done to simulate the “empty deck” behaviour.
The cards are dealt via a Trigger that calls a Send to Location. In that same Trigger I call another Trigger that checks if the card is the last in the deck (condition _numPieces==1), if so sends the hotkey to warn that the deck is empty.
I use several decks in hidden windows that are not accessible to the players and I send commands to those decks all the time. Since they’re hidden, they are never open and all the commands work just fine. I’m guessing you have a typo somewhere. Typo errors can leave me stumped for hours …one time, it was simply a space added at the end of a hot key command.
Note that the _numPieces will only carry a value on the window the deck is on. If you wish to carry that value to another window, you’ll have to pass along that value to a Global Property and then display the Global Property.
Does that help?
DrNostromo, I think you didn’t understood my problem. Here is an example module. Open the module, open the “Deck Map” and click de “Dead a card” button. When the “Deck Map” is open you will see the message “The deck is empty”, but when this window is closed it doesn’t call the hotkey.
I do realise that hotkeys just work when the window is open as “uckelman” said, but that is when it is expecting user input. When we have a deck sending the message, that was no user input for the hotkey, it is the system itself that sent it. This is why I expected the hotkey to work, the empty deck message should work with the deck hidden or visible.