GKC with a variable in the name


Can you call a GKC with a variable in its name ?
I mean, I have a PlusOneBlue, PlusOneRed, PlusOneGreen … and I want to use a GKC that says : PlusOne$PlayerSide$
This does not work, and I know I can use matching properties $PlayerSide$=“Blue” to act on GKC PlusOneBlue, but that makes too many traits to create.

So … possible or not ? With which syntax ?

Thanks for your ideas

As long as those variables exist as Global or Dynamic Properties, that should work fine. Proper syntax (if you’re using the old style Vassal syntax) would be

PlusOne$PlayerSide$ = (value) or $(variable)$

Hi Dr, thx for the answer.
In fact, I want to call either PlusOnBlue or PlusOneRed by a Global Key Command saying PlusOne$PlayerSide$
I don’t want to edit a Global Property which name is PlusOneBlue. I know how to do that and it works fine.
It’s more aquestion about a keystroke … I don’t use Ctrl+C as a Key Stroke. I use named commands, as PlusOneBlue …

I may not be clear. I’ll think about rephrasing.

So. PlusOneBlue is a KeyStroke defined in a Trigger trait as in : watch for these keystrokes.
Of course, I have 5 colors, so 5 single pieces at-start Stack which are my 5 players scoring cubes.
Instead of using a GlobalKeyCommand naming PlusOneBlue, that uses a match condition {PlayerSide==“Blue”} I’d like to say the GlobalKeyCommand immediately depends on PlusOne$PlayerSide$.

I made a prototype, with the 5 Global Key Commands, each testing the PlayerSide color, But I’d want to get rid of these 5 options for each card.

I’m still not clear on what you’re trying to do but if you’re asking if a variable can be included in a keystroke, the answer is no. It has to be a hotkey, like CTRL-C, or a command word or phrase …no variables.

Thank you. That’s the conclusion I had reached after many tries. But I like it crystal clear :slight_smile:.