Hi, thanks for the pointers. Indeed, this works. There is only one problem: I have a game option called "board size", and it has several possible values: 6x6, 11x11, 13x13, and so on. The displaycondition can apparently only be attached to the entire "board size" choice, rather than to an individual value within that choice. So I had to make two separate options, one for training mode and one for everything else like this:
Code: Select all
$game_options = array(
// For training mode
100 => array(
'name' => totranslate('Board size'),
'displaycondition' => array(
array(
'type' => 'otheroption',
'id' => GAMESTATE_RATING_MODE,
'value' => 1
)
),
'values' => array(
6 => ...,
11 => ...,
13 => ...,
etc.
),
),
// For anything other than training mode
101 => array(
'name' => totranslate('Board size'),
'displaycondition' => array(
array(
'type' => 'otheroptionisnot', // negation!
'id' => GAMESTATE_RATING_MODE,
'value' => 1
)
),
'values' => array(
11 => ...,
13 => ...,
etc.
),
),
)
That's a lot of repetition, and then my *.game.php has to check both variables 100 and 101 to figure out the actual board size. Another small disadvantage is that if a user selects a board size first (say, 13x13) and then switches to or from training mode, the board size gets reset to the default (say, 11x11).
What I was hoping I would be able to do was something like this instead:
Code: Select all
$game_options = array(
100 => array(
'name' => totranslate('Board size'),
'values' => array(
6 => array(
'name' => ...,
'displaycondition' => array(
array(
'type' => 'otheroption',
'id' => GAMESTATE_RATING_MODE,
'value' => 1
)
)
),
11 => ...,
13 => ...,
etc.
),
)
)
i.e., to disable just one individual *value* within the choice, rather than disabling the entire choice. But I could not figure out a way to make this latter approach work. Is there such a way? It's fine if there is not, as the first approach above is a workable solution. It's just not quite as smooth as I was hoping it could be.
I have not yet looked into using "startcondition" rather than "displaycondition". If the startcondition can be used to disable individual combinations of options, then it may solve my problem. The user could select 6x6 in non-training mode, but would not be able to start the game.