Add Startup GKC for when a player joins, retires, or changes sides V2#13904
Add Startup GKC for when a player joins, retires, or changes sides V2#13904rlament wants to merge 2 commits into
Conversation
This is different from the existing GKC in that it does not fire on start of fresh game. Includes modifications to both code and documentation.
|
Does this seem to work when you test it in multiplayer and in log-based play? I don't see the part that makes sure that it gets called if someone joins mid-stream - or maybe that already existed, I can't remember? The PR itself seems simple enough I just recommend testing all the edge cases, to make sure it gives timely notifs: |
Add a sideChange listener to the startup GKC commands. The listener saves state for the apply action.
|
Good points. I had to rework things particularly for point 3.
Yes, I tested both scenarios. I created a test module that reports on all 5 Startup GKCs. Tested modules with and without sides. When there are no sides, this Startup GKC never fires. The latest change adds a
Yes, one GKC per player at the beginning. It can be before or after any other startup GKC. That depends on the relative placement within the module editor. Startup GKCs are fired in order from top down, when the corresponding condition is satisfied.
Yes
Yes, it sends the GKC and logs it if logging is active.
This GKC is modelled after APPLY_START_GAME_OR_SIDE_CHANGE. The exception being one GKC per player at start instead of just one GKC for just the first player (or game start). This GKC works the same as APPLY_START_GAME_OR_SIDE_CHANGE which also reports switching to "observer". A module can check {PlayerSide} to ignore specific "sides". Although upon testing, sometimes it would be nice to know the side from which the player left {PreviousSide?}. Perhaps a TBD? |
|
Absent this feature, a technique that I use is to wrap the built-in Retire component's hotkey in an Action button. i.e. the Retire component's button is assigned a null image and is replaced by the Action button. Here is a simple example where "RETIRE" is hotkey for the built-in retire or join prompt: validSideSwitch in this example is a feature to ensure that valid side is selected. It would be determined within the POST_JOIN_OR_RETIRE action. hideHand is simply closing open window(s), if any. To ensure that the Startup player is covered, I call POST_JOIN_OR_RETIRE from a Startup GKC. @rlament is this different from the new feature that you are developing here ? |
Great tip on handling the pre-retirement to clear out the previous side. Tried it and it works really well. This feature deals with side selection via the wizard. The retire button functionality just falls into place. This feature fires a Startup GKC as each player joins using the wizard user interface. The existing "At Start of Fresh Game or Player join/Side-Change" Startup GKC only fires once from the wizard regardless of how many players join the game. So the first player gets preferential treatment and the others are left out. @riverwanderer I'm wondering which Startup GKC you use and how you deal with side selection from the wizard for the second and each subsequent player? |


This is different from the existing Startup GKC in that it does not fire on start of fresh game. This GKC fires as players join at startup via the wizard and anytime during the game when any player(s) retires, joins or changes side. Closes #13903
I neglected to add a reference to the original PR for Startup GKC on fresh game or player join/retire #11918