Create account / Log in

Number of players

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Number of players

Postby barbanera » January 15th, 2012, 1:07 pm

Hello, I am trying to find my way back into Vassal module designing after many years. Apologies in advance if some questions I might ask are already answered somewhere else.

How do I find out how many players are "connected" at the start of a game via the Vassal server? And their nicknames?

The module I am designing is for 2 to 4 players and I am trying to automatize setup of the game. In particular, I need to distribute cards and such in different ways, depending on the number of players in the game.

I would also like to possibly show the name of the players next to some turn tracker/victory track counter.
barbanera
 
Posts: 384
Joined: January 12th, 2012, 2:27 pm

Re: Number of players

Postby mycenae » January 15th, 2012, 3:58 pm

I think it's necessary to have the players actively do something to trigger setup (such as having each one click a button). The button could be a disposable counter and could even be deleted after the game setup is over. The module won't know passively how many players are connected.

Or have one player click a 'Number of Players' button that triggers the right card deals at game start. There could be commands on the button, 1 for each player number ("Setup 2 Players", "Setup 3 Players", etc.) Each one of these commands triggers the setup routine for that number of players.

Their nicknames, however, are each contained in the $PlayerName$ property. For labels on the turn tracker, use Text Label Traits on the counter. If you set up a command for each player to click, you could have the command set a group of Global Properties with each player's name ($PlayerName$) and then use the GP values for the labels.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm

Re: Number of players

Postby DrNostromo » January 15th, 2012, 4:02 pm

How do I find out how many players are "connected" at the start of a game via the Vassal server? And their nicknames?


You can't do that. However, you can create an initialization process for your players. This is something I do in most of my modules as the game setup is generally dependent upon how many players are in the game.

Create a initialization button for each player and a Game Start button. As each player logs into the game, they click their initialization button. You can have this button increase a Global Property (something like PlayerCount) to keep track of the number of players and you can set up any number of other properties for each player.

Once all active player are initialized, click the Start Game button and have it do whatever it needs to do based on the PlayerCount.

I would also like to possibly show the name of the players next to some turn tracker/victory track counter.


You can set up an At-Start stack that displays the name of the player anywhere you like. See page 58 of the Designers Guide for more information on Text Labels.

http://www.vassalengine.org/mediawiki/i ... rguide.pdf
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Number of players

Postby barbanera » January 15th, 2012, 4:49 pm

thank you all for the suggestions

I guess I could go the "each player clicks a button" way (so to know how many there are and what's their actual side name and player name is).... but surely the vassal engine does know how many have joined and which side they selected to play with, doesn't it?

I tried my first online Vassal game today (yes.. never played before, just worked for ages on my module before giving up years ago) and when I clicked on "synchronize" with the guy who had started the room I got a screen asking if I wanted to join as player 3, 4 or 5 (game creator and another guy where already in), so of course the game knows how many people have logged in and which sides are still available..

it does sound strange that those properties are reserved and not visible at module level..
barbanera
 
Posts: 384
Joined: January 12th, 2012, 2:27 pm

Re: Number of players

Postby mycenae » January 15th, 2012, 5:26 pm

No, those properties are visible at the module level. For each player, you can access a property called 'PlayerSide' (the side the player has joined). So Vassal definitely knows your side if you're in the game. There's another one called PlayerName that works the same. You can use these properties in reports, text labels, comparisons, etc.

What's not exposed is the converse. If a player is in a game, you can access the property that names the side he's on...but not the property that tells you whether a given side has a player assigned (and which player it is). Like you point out, when logging on, there can be only one player 1, player 2, so the module definitely knows when a side is taken... but this property of a side is not visible.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm

Re: Number of players

Postby barbanera » January 15th, 2012, 7:38 pm

so the module definitely knows when a side is taken... but this property of a side is not visible


If that is really so it's unfortunate.. Are you absolutely sure about it or just your educated guess?

Please take no offense, you are being very helpful and your replies are much appreciated... just trying to make sure before I start adding tons of extra buttons/triggers etc just to find out who really is in the game!
barbanera
 
Posts: 384
Joined: January 12th, 2012, 2:27 pm

Re: Number of players

Postby mycenae » January 16th, 2012, 3:18 pm

Yes, I've had to do the same thing in a few modules.
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm


Return to Module Design

Who is online

Users browsing this forum: stew-rt and 1 guest