Move number

Game development with Board Game Arena Studio
Post Reply
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Move number

Post by Victoria_La »

When game goes to archive you can replay it and it shows Move # in top left corner. Is this available some-how in the database during the game?
I want to annotation my log message with move # but I am afraid if I calculate it myself it will be out of sync with that replay number...
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Move number

Post by Victoria_La »

Replying to my own post since I figured it out. Its a global variable number 6.
So in Php constructor
self::initGameStateLabels(array (
'move_nbr' => 6,
...
));

Where you need it:

$move = $this->getGameStateValue('move_nbr');
$this->trace("move number $move");
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Move number

Post by Victoria_La »

That was very wrong btw, the move number is actually global id 3, not 6. And you can just get it directly without label initializarion because
it is initialized by framework, i.e.

Code: Select all

$this->getGameStateValue('next_move_id'); // this is move number - global 3

$this->getGameStateValue('playerturn_nbr'); // this player turn number - global 6
Post Reply

Return to “Developers”