How to determine the number of players ?

Hi,

The goal :

The number of players in my prototype ranges from 2 to 5.

At a given phase of each turn, each player must perform a “secret vote” . I would like to make impossible to reveal the final (public) result before each player have make its own choice. Thus, I must compare (with GKC) the number of choice already done with the number of players.

The question :

What is the variable name for the actual number of players ?

Thx.

Ijam

AFAIK, that kind of information is not exposed in any variable name. You need to devise your own check-in engine at game start to store the name and number of players.

Or wait for Vassal 4, I guess.

OK, clear.

I must check the name of the 5 players : if not empty playernb = playernb +1…

… or something like that.

Thanks.

Ijam.

Hmm, that might work, altough I am not sure how you defined “empty” in vanilla property checks ("" or ‘’ won’t work). Maybe possible with the new property expression engine, though (Vassal 3.2.0).

My suggestion was to have players at start up click on some “check-in” button to update the number of players.

 This is what I do. I call it player initialization. When players log in, they click a button of some type. This can be used to create a set of variables for a player, if necessary, but, most importantly, you can have this click increment a Global Property of some kind like PlayerCount. You can then use that in cases where you need to deal with the specific number of people in the game.

Hi,

I think it is possible to do it with the following assumptions:

  1. during the first phase of each turn, each player move at least one piece on a board and this movement end sent a GKC.
  2. after each turn the number of players could change (mom calling, lunch time, swimming pool, etc.)

The strategy is :

A -initialization of Global Properties at the beginning of each turn :
NbOfPlayer = 0
NamePlayer1 = “”
NamePlayer2 = “”
NamePlayer3 = “”
etc.

B- Trigger to test the GKC
Test = True
If NamePlayer1 == “” && Test== True then
NamePlayer1 = $playerName$
NbOfPlayer = NbOfPlayer +1
Test = False
end if
If NamePlayer1 == $playerName$ then
Test = False
end if
'-------------------------------------
If NamePlayer2 == “” && Test== True then
NamePlayer2 = $playerName$
NbOfPlayer = NbOfPlayer +1
Test = False
end if

etc.

What do you think ?

Ijam.

Ok I did it. :slight_smile:

I would like to upload the file but is too big … 480Ko.

How to proceed ?

Ijam

Hi,

I find an easy way by using a “Startup Global Key Command” at module level.

In fact this GKC is sent at login of each player and updates (via a Trigger) a “Global Property” named, for example, NumberOfPlayer.

Ijam.