setAllPlayersMultiactive not working properly
Posted: 19 October 2020, 08:12
I'm trying to configure a multiplayer turn, where all players must play a card simultaneously.
This is my code:
State Machine:
Game PHP
When I reach the state "Playacard", I got the following error: "Invalid or missing substitution argument for log message: undefined error" and I go into an undefined state.
If I remove the setAllPlayersMultiactive call, I don't get the error, but then, after the card selection is completed, if I use the function setPlayerNonMultiactive($player_id, "Applyaction"), I have the error: "Unexpected error: Unexpected final game state (4)"
This is my code:
State Machine:
Code: Select all
3 => array(
"name" => "Playacard",
"description" => clienttranslate("Play one card"),
"type" => "multipleactiveplayer",
"action" => "stPlayacard",
//"updateGameProgression" => true,
"possibleactions" => array( 'Playacard' ),
"transitions" => array( "Applyaction" => 4 )
),
Code: Select all
function stPlayacard()
{
$this->gamestate->setAllPlayersMultiactive();
}
If I remove the setAllPlayersMultiactive call, I don't get the error, but then, after the card selection is completed, if I use the function setPlayerNonMultiactive($player_id, "Applyaction"), I have the error: "Unexpected error: Unexpected final game state (4)"