DisplayOption constraint.

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

DisplayOption constraint.

Post 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?
User avatar
Victoria_La
Posts: 608
Joined: 28 December 2015, 20:55

Re: DisplayOption constraint.

Post 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.') )
),
...
),
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

Re: DisplayOption constraint.

Post 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.
User avatar
Victoria_La
Posts: 608
Joined: 28 December 2015, 20:55

Re: DisplayOption constraint.

Post 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
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

Re: DisplayOption constraint.

Post 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...
User avatar
quietmint
Posts: 262
Joined: 31 July 2017, 00:28

Re: DisplayOption constraint.

Post by quietmint »

+1

I also want to use minplayers/maxplayers in displaycondition but currently this only works in startcondition.
User avatar
quietmint
Posts: 262
Joined: 31 July 2017, 00:28

Re: DisplayOption constraint.

Post 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.
User avatar
Een
Posts: 3854
Joined: 16 June 2010, 19:52

Re: DisplayOption constraint.

Post 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).
Post Reply

Return to “Developers”