When I don't call nextState everything works fine but if I expliciatly call next state, then the next state I go to automatically goes to the next state after it without letting the player act
So if this is my States.php
And I put nothing in the StartState function, then the game works as expected goes to step 200 where
Then after all the players have chosen a card state 3 runs to set the Dealer for the game
However if I change my state 2 to something like
and change startState to
Then what happens is stCutDeal runs and the state stSetDealer also runs. I know this because I can put a var_dump("200 step") in stCutDeal and the error check in stSetDealer also runs and the game bombs
I do want to get to the point from step 2 where a choice is made based on game options
So if this is my States.php
Code: Select all
$machinestates = array(
// The initial state. Please do not modify.
1 => array(
"name" => "gameSetup",
"description" => "",
"type" => "manager",
"action" => "stGameSetup",
"transitions" => array( "" => 2 )
),
2 => array(
"name" => "startState",
"description" => "",
"type" => "game",
"action" => "stStartState",
"updateGameProgression" => true,
"transitions" => array("" => 200)
),
// Note: ID=2 => your first state
200=> array(
"name" => "cutDeal",
"description" => clienttranslate('Opponent must choose a card '),
"descriptionmyturn" => clienttranslate('${you} must choose a card'),
"type" => "multipleactiveplayer",
"action" => "stCutDeal",
"possibleactions" => array( "cutDeal"),
"transitions" => array('done'=>3)
),
3 =>array(
"name" => "setDealer",
"description" => "",
"type" => "game",
"action" => "stSetDealer",
"transitions" => array('tie' => 2, 'winner'=>9)
),
9 => array(
Code: Select all
function stCutDeal() {
// Just activate the selection
$this->gamestate->setAllPlayersMultiactive();
}
However if I change my state 2 to something like
Code: Select all
"transitions" => array("cut" => 200)
Code: Select all
function stStartState () {
$this->gamestate->nextState('cut');
}
I do want to get to the point from step 2 where a choice is made based on game options
Code: Select all
"transitions" => array("cut" => 200, "auto"=>3)