Game options displaycondition

Game development with Board Game Arena Studio
Post Reply
User avatar
Woodruff
Posts: 412
Joined: 08 March 2014, 00:53

Game options displaycondition

Post by Woodruff »

Hi everybody,

I am dealing with a 4-player game game which can be played either in teams or individually.
If there are teams, I want to display another option to choose how teams are created based on the position of players in the table.
So, I think that's a job for 'displaycondition'. Here what I'm

Code: Select all

$game_options = array(
    100 => array(
        'name' => totranslate('Game type'),
        'values' => array(
            1 => array('name' => totranslate('Teams'), 'tmdisplay' => totranslate('Team game')),
            
            2 => array('name' => totranslate('Free-for-all'), 'tmdisplay' => totranslate('Free-for-all game')),
        )
    ),
    
    101 => array(
        'name' => totranslate('Team settings'),
        'values' => array(
            1 => array('name' => totranslate('Random')),
            
            2 => array('name' => totranslate('1st/2nd vs 3rd/4th')),
            
            3 => array('name' => totranslate('1st/3rd vs 2nd/4th')),
            
            4 => array('name' => totranslate('1st/4th vs 2nd/3rd')),
        ),
        'displaycondition' => (
            array(
                 'type' => 'otheroption',
                 'id' => 100, // Only if game type...
                 'value' => 1 // Is set on "Teams"
            )
        )
    )
);
Unfortunately, the second option "Teams" does not disappear when I select the "Free-for-all" value on the first option...

So I think I miswrote that; what am I missing?

Thanks a lot!

Tcheby
User avatar
Een
Posts: 3854
Joined: 16 June 2010, 19:52

Re: Game options displaycondition

Post by Een »

Hi!
I think you are missing an array declaration. It should be:

Code: Select all

'displaycondition' => array(
            array(
Post Reply

Return to “Developers”