Page 1 of 2

[SOLVED] Option only usable when Elo is off

Posted: 12 April 2018, 18:19
by Woodruff
Hi everybody :)

I am developping a classic card game, which length is not determined by the rules (unlike Belote, where there is a target score).
So I will certainly add several possibilities in the options. Something like that:
Game length
  • 4 hands
  • 8 hands
  • 12 hands
  • ...
I would like to add a kind of "friendly mode", where players can play as long as they wish: each time a hand ends, there is a vote to continue the game or not. The game ends when any player votes "No". If all players vote "Yes", the game continues with a new hand (things like that can be seen on some other game platforms, like https://www.whistenligne.com).

For that mode, Elo does not make sense because the winner can change depending on the game end, and I think I will manually neutralize scores at the end.
Is there any way to prevent players to play that option with Elo off, in gameoptions.inc.php? Or (more unlikely) to ovveride the Elo computation system to put +0 to everyone?
Even if I neutralize player score and strongly advise not to play this with Elo on, there is still room for Elo maniacs that could use that option to boost their stats quite fast...

Thanks for your help!

Tcheby

Re: Option only usable when Elo is off

Posted: 20 April 2018, 09:43
by Een
Hi Tchebychev,

You can use this displaycondition inside the definition of your "friendly mode" option. Then it will appear only if ELO mode is OFF.

Code: Select all

'displaycondition' => array(    // Note: do not display this option unless these conditions are met
											   array( 'type' => 'otheroption', 'id' => 201, 'value' => 1 )
											)

Re: Option only usable when Elo is off

Posted: 20 April 2018, 12:22
by Woodruff
Hi Een,

Thanks for your reply. I think I'd rather display the option all the time (I think few players play with ELO off by default so most player would not be aware that option exists).
So, if it is possible with the framework, since thanks to you I know the option for ELO has id 201, I think I will replace the display condition with a start condition, showing up a message if somebody tries to start the table with Elo on. (I assume here that the value for ELO on is 0):

Code: Select all

         'startcondition' => array(
             1 => array(), // 
             2 => array(), // "Normal" game length options (4 turns, 8 turns...) can be played with no restriction
             ...
             6 => array(
                 array(
                   'type' => 'otheroption',
                   'id' => 201, // Option for ELO
                   'value' => 0, // Value for ELO on ?
                   'message' => totranslate('This option can only be played with ELO off.')
                 )
             ),
         ),
Will that work, do you think?

Re: Option only usable when Elo is off

Posted: 20 April 2018, 15:44
by Een
Well, startcondition currently implements only minplayers and maxplayers values, so... no :P
But as this could be useful for other games, I suppose we can add it to the framework when releasing your game. Please remind us when we'll be going for beta on this :D

Re: Option only usable when Elo is off

Posted: 20 April 2018, 18:27
by Woodruff
Alright. In the meantime I'll go for your solution.
I have almost finished to code the game (French Tarot), but I now have to test it a lot and debug it. I let you know when it's ready for beta testing (during May, probably).

Thanks a lot for your help Een :)
See you soon.

Tcheby

Re: Option only usable when Elo is off

Posted: 30 April 2018, 15:08
by Cococool69
Hi,
I'm very impatient to play Tarot and i ok to be on the beta player list.

Thanks Tchebychev

Re: Option only usable when Elo is off

Posted: 16 May 2018, 16:35
by Een
Tchebychev wrote:I think I'd rather display the option all the time (I think few players play with ELO off by default so most player would not be aware that option exists).
This was also requested by Victoria_La.
With the next release, you will be able to add a 'notdisplayedmessage' to your option, that will cause the option to show as disabled (instead of just removing it when displaycondition is set and not valid).

NB: this is already available on the studio so you can test it.

Re: Option only usable when Elo is off

Posted: 17 May 2018, 00:53
by Victoria_La
Do you mean like?

Code: Select all

  'notdisplayedmessage' => totranslate('This option can only be played with ELO off.')
Een wrote: This was also requested by Victoria_La.
With the next release, you will be able to add a 'notdisplayedmessage' to your option, that will cause the option to show as disabled (instead of just removing it when displaycondition is set and not valid).

NB: this is already available on the studio so you can test it.

Re: Option only usable when Elo is off

Posted: 17 May 2018, 08:43
by Een
Victoria_La wrote:Do you mean like?

Code: Select all

  'notdisplayedmessage' => totranslate('This option can only be played with ELO off.')
Yes, exactly.

Re: Option only usable when Elo is off

Posted: 17 May 2018, 13:24
by Victoria_La
Did not work like that. Anything else is missing?

Code: Select all

        100 => array(
                'name' => totranslate('Learning Game (No Research)'),
                'values' => array(
                        
                        1 => array( 'name' => totranslate('Off'), 'tmdisplay' => totranslate('') ),
                        2 => array( 'name' => totranslate('On'), 'tmdisplay' => totranslate('Learning Game') ),
                        
                ),
                'displaycondition' => array(
                        // Note: user cannot use this option unless these conditions are met
                        array( 'type' => 'otheroption',
                                'id' => 201, // ELO OFF hardcoded framework option
                                'value' => 1, // 1 if OFF
                                'notdisplayedmessage' => totranslate('Learning variant available only with ELO off')
                        )
                ),
                ),