There is no more active player

Game development with Board Game Arena Studio
Post Reply
User avatar
shapeshifter999
Posts: 27
Joined: 18 January 2018, 02:23

There is no more active player

Post by shapeshifter999 »

Ho Ho Community!

Issue

I am trying to implement a team setup screen and I am facing There is no more active player. Here my source code:
https://github.com/sderrico/decrypto-bga/

Code

All the players are at teamSetup state. When the last player click on READY, the next phase kick in: newRound and there is an action called stNewRound.

states.inc.php

Code: Select all

    20 => array(
        "name" => "teamSetup",
        "description" => clienttranslate('${actplayer} must choose a team'),
        "descriptionmyturn" => clienttranslate('${you} must choose a team!'),
        "type" => "multipleactiveplayer",
        "possibleactions" => array( "changeTeamName", "completeTeamSetup", "switchTeam" ),
        "transitions" => array( "newRound" => 30 )
    ),
    30 => array(
        "name" => "newRound",
        "description" => clienttranslate('${actplayer} must guess for team1'),
        "descriptionmyturn" => clienttranslate('${you} must guess for team1!'),
        "type" => "activeplayer",
        "possibleactions" => array( "guess" ),
        "action" => "stNewRound",
        "transitions" => array( "playCard" => 20, "pass" => 20 )
    ),
decrypto.action.php

Code: Select all

    public function completeTeamSetup()
    {
        self::setAjaxMode();
        $this->game->completeTeamSetup();
        self::ajaxResponse();
    }
decrypto.game.php

Code: Select all

    function completeTeamSetup()
    {
        $playerId = $this->getCurrentPlayerId();
        $this->gamestate->setPlayerNonMultiactive($playerId, 'newRound');
    }

    function stNewRound()
    {
        $this->gamestate->setAllPlayersMultiactive();
    }
Expecting result

All the player would be at newRound state and they are all active but the players are facing a Error: there is no more player!.

Thank you for your help or any pointers!
Sebastien

UI Draft
Image

UI Error
Image
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: There is no more active player

Post by Tisaac »

Newround is an activeplayer state, why are you setting all players multiactive ??
You should put a game state in between to correctly set up the active player.
User avatar
shapeshifter999
Posts: 27
Joined: 18 January 2018, 02:23

Re: There is no more active player

Post by shapeshifter999 »

Good catch, this fix it. Thanks!
Post Reply

Return to “Developers”