Using the Players Name in an online Game

My buddy has done this on a few modules. He keys off the “At Start of Fresh Game or Player Join/Side-Change”. This works for the first player to join. For the remaining players the workaround is to retire and re-join. More details in this post: Startup GKC not working on Player Join. I’ve implemented a new Startup Global Key Command that only fires on player join/side-change. It’s in the queue for inclusion into Vassal. That would make this feature work seamlessly.

You do need a set of Global Properties to store the names. These are the button text. Base these Global Properties off of the player sides. As an example, if you have Red, Blue and Green sides, make your properties RedName, BlueName and GreenName. Consistent naming simplifies the setting of player names by avoiding conditionals.

Setup the Startup Global Key Command with a Global Key Command (i.e. not Hot key).

Add a single piece to an At-Start Stack. The single piece has a Trigger Action and Set Global Property. The Trigger Action filters out player retirements to observer. Trigger when {PlayerSide!=“”}. The trigger invokes the Set Global Property, of which the name is {PlayerSide+“Name”}. Thus circling back to the naming of the Global properties (i.e. if PlayerSide is Red, this sets RedName). For the key command, the type is “set value directly” and the Prompt is {PlayerName}.

Without getting into a lot of details that is basically the gist of it. If you don’t like the workaround, the players will have to manually update by clicking on some button. This mostly repeats what has already been posted with a variation on the trigger action.

1 Like