I am using a Global Key Command to send a card from a Deck to a Start Stack on a specific Map Window. The Map Window is named Player 1’s Hand. I am using the .substring(X,Y) function to return the “Player 1” substring, which I use in the follwing expression.
The expression doesn’t work. I know that the substring function returns “Player 1 Deck”, having tested it in a Report Action. And, if I use
If I’m right, Vassal will generate a bad data error but you might have missed that. Also, the Expression Builder would show a red X - try pressing the calculation icon next to the expression.
Before:
In fact, you do need the quotes around CurrentMap. However, you don’t actually need GetProperty() at all here. You could try this: {DeckName == CurrentMap.substring(0,8) + " Deck"}
I think that will do what you intended, but instead of using the Additional Expression field, why not use Pre-select? Like this:
This first solution did not work, even though the Expression Builder shows a green check mark and when using the same Expression in a Report Action generates the correct string: Player 1 Deck.
I have had issues getting a GKC to recognise CurrentMap, but I wouldn’t have expected it in the additional matching expression, as that is evaluated on the piece. Curious but at least the Pre-Select solution is working.
I’m not so concerned but you could equally use {handSide + " Deck"}