Private parallel states with change in active players

Game development with Board Game Arena Studio
Post Reply
User avatar
JudgeWhyMe
Posts: 36
Joined: 08 August 2012, 17:14

Private parallel states with change in active players

Post by JudgeWhyMe »

Hello

Here is my problem:
I have 4 players
Player 1 and Player 2 are active players
Player 1 and player 2 are in private parallel state 1, waiting for them to perform an action
Player 1 performs their action => they are moved to private parallel state 2
I'd like Player 3 to also become active and enter the same private parallel state 2

Is there a way to do that?

I tried the following:
in Game.php, in the actAction procedure, I tried to set Player 1 and 3 as active and send them to next state

Code: Select all

        $activePlayers[$idPlayer1] = $idPlayer1;
        $activePlayers[$idPlayer3] = $idPlayer3;
        $this->gamestate->setPlayersMultiactive($activePlayers, 'transitionToState2');
        $this->gamestate->nextPrivateStateForPlayers($activePlayers, "transitionToState2");
But I have the following error:

Code: Select all

Undefined array key 2413805 in /var/tournoi/release/tournoi-250505-1448-gs/www/Bga/GameFramework/GamestateMachine.php on line 1305
2413805 being player's 3 id

Thanks for the help
User avatar
JudgeWhyMe
Posts: 36
Joined: 08 August 2012, 17:14

Re: Private parallel states with change in active players

Post by JudgeWhyMe »

I tried something different, I set all the players to active, but manage to prevent player 3 and 4 to perform an action.
So when Player 1 performs an action, I move both player 1 and Player 3 in private parallel state 2

Seems to work for now, but if you have any other ideas, please let me know
Post Reply

Return to “Developers”