Create account / Log in

How to determine the number of players ?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

How to determine the number of players ?

Postby ijam » November 11th, 2012, 7:25 am

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
ijam
 
Posts: 16
Joined: October 20th, 2012, 6:01 am
Location: Bruxelles, BELGIUM

Re: How to determine the number of players ?

Postby barbanera » November 11th, 2012, 2:07 pm

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.
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: How to determine the number of players ?

Postby ijam » November 11th, 2012, 4:41 pm

barbanera wrote: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.
ijam
 
Posts: 16
Joined: October 20th, 2012, 6:01 am
Location: Bruxelles, BELGIUM

Re: How to determine the number of players ?

Postby barbanera » November 11th, 2012, 7:57 pm

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.
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: How to determine the number of players ?

Postby DrNostromo » November 12th, 2012, 3:14 pm

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.
User avatar
DrNostromo
 
Posts: 1036
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: How to determine the number of players ?

Postby ijam » November 13th, 2012, 8:24 pm

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.
ijam
 
Posts: 16
Joined: October 20th, 2012, 6:01 am
Location: Bruxelles, BELGIUM

Re: How to determine the number of players ?

Postby ijam » November 17th, 2012, 11:34 am

barbanera wrote: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.


Ok I did it. :)

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

How to proceed ?

Ijam
ijam
 
Posts: 16
Joined: October 20th, 2012, 6:01 am
Location: Bruxelles, BELGIUM

Re: How to determine the number of players ?

Postby ijam » January 20th, 2013, 8:40 am

barbanera wrote: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.


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.
ijam
 
Posts: 16
Joined: October 20th, 2012, 6:01 am
Location: Bruxelles, BELGIUM


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest

cron