Page 1 of 1

gameoptions enable/disable

Posted: 12 August 2017, 23:09
by Rudolf
Hello,
I need to make some gameoptions dependant of other gameoptions,,,there are some funcitons for that, and its done in Race of Galaxy.
I just discover that I cannot see the code of race of galaxy ( not possible to put this one in readonly)
Is it possible to give me access to the gameoptions file of ROG? Or put the code here?
thanks

Re: gameoptions enable/disable

Posted: 16 August 2017, 17:18
by galehar
What you're looking for are displaycondition and startcondition.

Here is the gameoptions for RFTG:

Code: Select all

$game_options = array(

    100 => array(
                'name' => totranslate('Expansion'),
                'values' => array(
                            1 => array( 'name' => totranslate('Base game'), 'tmdisplay'=> totranslate('Base game') ),
                            2 => array( 'name' => totranslate('The Gathering Storm'),  'tmdisplay' => totranslate('The Gathering Storm'),  'premium'=>true,  'nobeginner' => true ),
                            3 => array( 'name' => totranslate('Rebel vs Imperium + The Gathering Storm'),  'tmdisplay' => totranslate('Rebel vs Imperium + The Gathering Storm'),  'premium'=>true,  'nobeginner' => true ),
                            4 => array( 'name' => totranslate('Rebel vs Imperium + The Gathering Storm + Brink of War'),  'tmdisplay' => totranslate('Rebel vs Imperium + The Gathering Storm + Brink of War'),  'premium'=>true,  'nobeginner' => true ),
                            5 => array( 'name' => totranslate('Alien Artifacts (with Orb)'),  'tmdisplay' => totranslate('Alien Artifacts (+ Orb)'),  'premium'=>true,  'nobeginner' => true ),
                            6 => array( 'name' => totranslate('Alien Artifacts (no Orb)'),  'tmdisplay' => totranslate('Alien Artifacts (no Orb)'),  'premium'=>true,  'nobeginner' => true ),
                            7 => array( 'name' => totranslate('Xeno Invasion (with Invasion))'),  'tmdisplay' => totranslate('Xeno Invation (+ Invasion)'),  'premium'=>true,  'nobeginner' => true ),
                            8 => array( 'name' => totranslate('Xeno Invasion (no Invasion))'),  'tmdisplay' => totranslate('Xeno Invation (no Invasion)'),  'premium'=>true,  'nobeginner' => true ),
                        ),
            		'startcondition' => array(
			            1 => array( array( 'type' => 'maxplayers', 'value' => 4, 'message' => totranslate( 'Base game is only available for 4 players maximum.' ) ) ),
			            2 => array( array( 'type' => 'maxplayers', 'value' => 5, 'message' => totranslate( 'The Gathering Storm is only available for 5 players maximum.' ) ) ),
			            3 => array( ),
			            4 => array( ),
			            5 => array( array( 'type' => 'maxplayers', 'value' => 5, 'message' => totranslate( 'Alien Artifacts is only available for 5 players maximum.' ) ) ),
			            6 => array( array( 'type' => 'maxplayers', 'value' => 5, 'message' => totranslate( 'Alien Artifacts is only available for 5 players maximum.' ) ) ),
			            7 => array( array( 'type' => 'maxplayers', 'value' => 5, 'message' => totranslate( 'Xeno Invasion is only available for 5 players maximum.' ) ) ),
			            8 => array( array( 'type' => 'maxplayers', 'value' => 5, 'message' => totranslate( 'Xeno Invasion is only available for 5 players maximum.' ) ) ),
                    )
            ),

    101 => array(
                'name' => totranslate('Draft variant'),
                'values' => array(
                            1 => array( 'name' => totranslate('No draft') ),
                            2 => array( 'name' => totranslate('Draft'),  'tmdisplay' => totranslate('Draft'),  'premium'=>true,  'nobeginner' => true ),
                        ),
                'displaycondition' => array(    // Note: do not display this option unless these conditions are met
				   array( 'type' => 'otheroption', 'id' => 100, 'value' => array(2,3,4) )
				),
        		'startcondition' => array(
			        1 => array( ),
			        2 => array( array( 'type' => 'maxplayers', 'value' => 3, 'message' => totranslate( 'Draft option is available for 3 players maximum.' ) ) ),
                ),
                'disable' => true

        ),
    102 => array(
                'name' => totranslate('Takeovers'),
                'values' => array(
                            2 => array( 'name' => totranslate('No takeover') ),
                            1 => array( 'name' => totranslate('Allow takeovers'),  'tmdisplay' => totranslate('Takeovers'),  'premium'=>true,  'nobeginner' => true ),
                            3 => array( 'name' => totranslate('2-Player Rebel vs Imperium Takeover Scenario'),  'tmdisplay' => totranslate('RvI scenario'),  'premium'=>true,  'nobeginner' => true ),
                        ),
                'displaycondition' => array(    // Note: do not display this option unless these conditions are met
				   array( 'type' => 'otheroption', 'id' => 100, 'value' => array(3,4) )
				),
                'startcondition' => array(
                        1 => array( ),
                        2 => array( ),
                        3 => array( array( 'type' => 'maxplayers', 'value' => 2, 'message' => totranslate( 'Rebel vs Imperium Takeover Scenario is available for 2 players only.' ) ) ),
                ),
      'disable' => true

        )
// Be careful : 103 is used as a constant in the game.


);

Re: gameoptions enable/disable

Posted: 18 August 2017, 00:19
by Rudolf
thanks;)