Page 1 of 1

DisplayOption constraint.

Posted: 29 August 2017, 20:52
by Rudolf
Hello,
Well I need to display 'team play' when the number of players is 4 or 6 ,
so I used

Code: Select all

'displaycondition' => array(array( 'type' => 'nbplayers', 'value' =>array(4,6))),
like this

Code: Select all

104 => array(
            'name' => _('Team play'),
            'displaycondition' => array(array( 'type' => 'nbplayers', 'value' =>array(4,6))),
            'values' => array(
                0 => array( 'name' => totranslate( "Alone/no team"), 'tmdisplay' => totranslate( "Alone/no team" )),
                40=> array( 'name' => totranslate( "4 players - Team random" ), 'tmdisplay' => totranslate( "4 players - Team random" )),
                42=> array( 'name' => totranslate( "4 players - Team 1-3 vs 2-4" ), 'tmdisplay' => totranslate( "4 players - Team 1-3 vs 2-4" )),

                //41 => array( 'name' => totranslate( "4 players - Team elo equillibrium" ), 'tmdisplay' => totranslate( "4 players - Team elo equillibrium" )),
                60=> array( 'name' => totranslate( "6 players - Team 2 players random" ), 'tmdisplay' => totranslate( "6 players - Team 2 players random" )),
                //61 => array( 'name' => totranslate( "6 players - Team 2 players elo equillibrium" ), 'tmdisplay' => totranslate( "6 players - Team 2 players elo equillibrium" )),
                62 => array( 'name' => totranslate( "6 players - Team 1-4 vs 2-5 vs 3-6" ), 'tmdisplay' => totranslate( "6 players - Team 1-4 vs 2-5 vs 3-6" )),
                70=> array( 'name' => totranslate( "6 players - Team 3 players random" ), 'tmdisplay' => totranslate( "6 players - Team 3 players random" )),
                //71 => array( 'name' => totranslate( "6 players - Team 3 players elo equillibrium" ), 'tmdisplay' => totranslate( "6 players - Team 3 players elo equillibrium" )),
                72 => array( 'name' => totranslate( "6 players - Team 1-3-5 vs 2-4-6" ), 'tmdisplay' => totranslate( "6 players - Team 1-3-5 vs 2-4-6" )),


                        //60 => array( 'name' => totranslate( "6 players - Team 2 players" ), 'tmdisplay' => totranslate( "6 players - Team 2 players" )),
                        //61 => array( 'name' => totranslate( "6 players - Team 3 players" ), 'tmdisplay' => totranslate( "6 players - Team 3 players" )),
                ),
            'startcondition' => array(
                   0 => array( ),
                   40 => array( array( 'type' => 'nbplayers', 'value' => 4, 'message' => totranslate( 'This team player 4 is only available for 4 players.' ) ) ),
                   42 => array( array( 'type' => 'nbplayers', 'value' => 4, 'message' => totranslate( 'This team player 4 is only available for 4 players.' ) ) ),
                   60 => array( array( 'type' => 'nbplayers', 'value' => 6, 'message' => totranslate( 'This team player 4 is only available for 6 players.' ) ) ),
                   62 => array( array( 'type' => 'nbplayers', 'value' => 6, 'message' => totranslate( 'This team player 4 is only available for 6 players.' ) ) ),
                   70 => array( array( 'type' => 'nbplayers', 'value' => 6, 'message' => totranslate( 'This team player 4 is only available for 6 players.' ) ) ),
                   72 => array( array( 'type' => 'nbplayers', 'value' => 6, 'message' => totranslate( 'This team player 4 is only available for 6 players.' ) ) ),
                   )
            ),
 

but this part is not displayed when I put 4 players in the table... any idea? ..; is 'nbplayers' coded for displaycondition?

Re: DisplayOption constraint.

Posted: 30 August 2017, 02:22
by Victoria_La
nbplayers did not work for me but this did
'startcondition' => array (
1 => array (
array ('type' => 'maxplayers','value' => 2,
'message' => totranslate('Base game is only available for 2 players maximum.') ),
array ('type' => 'minplayers','value' => 2,
'message' => totranslate('Base game is only available for 2 players minimum.') )
),
...
),

Re: DisplayOption constraint.

Posted: 03 September 2017, 23:53
by Rudolf
yes i made that... (but I don't like the way to display a wrong message)...
I think it could be good to add this in BGA code. Hope EEn will enhance that.

Re: DisplayOption constraint.

Posted: 04 September 2017, 21:16
by Victoria_La
Rudolf wrote:yes i made that... (but I don't like the way to display a wrong message)...
I think it could be good to add this in BGA code. Hope EEn will enhance that.
Why don't you change message then to "Only available for 4 players"? Both of them

Re: DisplayOption constraint.

Posted: 04 September 2017, 21:41
by Rudolf
Hello Victoria
But that s what I did!
Sorry when I speak about 'wrong message', i speak about the red message... I don't like to make a red error square appear if player try to launch the game ;)
maybe some options will be add one day in displayoptions ;)
By the way,
there is something more important, I have a strange bug linked to displayoptions ( in another post)... I don t understand why this happens...

Re: DisplayOption constraint.

Posted: 21 March 2018, 18:34
by quietmint
+1

I also want to use minplayers/maxplayers in displaycondition but currently this only works in startcondition.

Re: DisplayOption constraint.

Posted: 15 August 2020, 19:17
by quietmint
Bump! Can we get a displaycondition related to number of players yet? :D

Santorini now has this same problem. When player count = 4, it is team mode and I want to display an addition an option to pick teams. When player count = [2, 3] I want to hide this option because it doesn't make sense for individual mode.

Re: DisplayOption constraint.

Posted: 11 November 2020, 12:26
by Een
Sorry for the late reply. The thing is, number of players on a table is a range (except if the table admin selects min = max).
That's why conditions are only startcondition (then we know the exact number) and not displaycondition (if min != max it's fuzzy).