Startup GKC Command Not Working

I’m trying to implement a Startup GKC, and can’t get it to work. On my main map window (Main Map) I have a button/GKC that shuffles a deck. Both the button itself and the hotkey I set (Ctrl-Shift-1) work; if I click the button or press Ctrl-Shift-1 the deck shuffles. Here are the button’s parameters:

So I’ve been trying to set up a Startup GKC to click the button…and it doesn’t work. Here’s the syntax I’m using:

…and it doesn’t work. At startup I get the report/message (“startup command - shuffle city tiles”), but the command isn’t actually being sent; the GKC is not sending the Ctrl-Shift-1 command.

If anybody can tell me what I’m getting wrong, I’d really appreciate it.

I can’t read the screenshots but if you are trying to trigger a hot key direct from a GKC that will not work. Instead, you need to put the functionality onto a piece and trigger the command there. You can still use the Global Hotkey if you really want to, but you must do it via a piece using the Global Hotkey trait.

Hope I have got all that right.

Another thing to be on the watch for–if you think people might be using your module for PBEM (asynchronous play), a Startup GKC will fire every time the module is loaded, even if to replay/create logfiles in stages of play after the game’s actual start. You may or may not want that. The 1960: Making of the President module is afflicted with this problem.

Those are both very helpful – thank you!

Joel, your information may send me in a completely different direction – I may just have to grit my teeth and have people manually shuffle the deck at the beginning of a game.

I don’t have an answer to your specific question (partly because your screen shots are too small), but seeing what you are trying to do, I thought I’d give you some tips. Forgive me if you already know this.

I notice you use the key combo cntl-shift-1–a rather awkward choice, and you probably chose it because you don’t want people pressing it during the game. The trouble with keystrokes is someone might accidentally do it anyway. I suggest you replace key strokes that you don’t want humans touching with key strings. In your example, I’d replace cntl-shift-1 with “shuffleProjectsDeck” or something similar. I know its long, but vassal does not have internal commenting, so I make the key strings long as a substitute.

Second, I try to avoid putting GKCs and such at the map level, and I use what I call “proxy pieces.” A proxy piece’s job is solely to perform module functions. Often it has no image and is not meant to be interacted by players. It sits in an at-start stack and sometimes off board. Sometimes a proxy piece will have a game function though such as a piece that shows text. In your case, I would have the map-level or startup GKC forward the command to the proxy piece, who would do all the real work. A proxy piece has a couple advantages: it has more options (powers) and it can isolate the setup code, which can get lost at the map level.

Third, I don’t use the startup GKC anymore. Nowadays I create a special “Set up the game” button, which I put prominently on the main map when someone starts a new game. I’ve been doing euros lately, and in those cases I often have different setups for different player counts, so I have a stack of set-up buttons for each count. The first player in can press the appropriate button. You can also provide other setup options at this time. Once pressed, the button piece does setup (as a proxy), and then it deletes itself and all its sisters so no one can press them again.

shilinski said:

I am doing something similar in my module One of my buttons that automates part of setup has two layers. One for before setup, and the other after, each with a different image. The button layer is set by a map level button status global property. The named command invoked by clicking the button activates a Trigger Action which only performs the actions if the button status property is for the level for the before setup state of the button, and the last action of the setup changes the button status property that goes with the after setup level for the button. With the change in status, the button, although still visible, is inactive, and has a message on it saying so, something like “setup done.”

The deletion of the setup button is pretty slick. I may change my module button to do that.

I normally have a “setup” button GKC in the toolbar where one can press at the beginning of a game.
It is an issue if someone click it twice, so one can guard that with a dead man’s switch by checking a global property first…