Page 1 of 1

[Solved] Hotseat mode and "gamedatas.playerorder"

Posted: 07 August 2020, 13:37
by Draasill
Hi,

I'm using "gamedatas.playerorder" in "Solar Storm", and it appears that in hotseat mode, it's not filled correctly.

A player has recently started such a game (2 players including 1 hotseat), and the "gamedatas.playerorder" contains only one player ID.

Which breaks the game :)

Is this expected ?

Re: Hotseat mode and "gamedatas.playerorder"

Posted: 07 August 2020, 19:09
by Inaofr
No, it is not. You should report a bug, but I don't know on which category (the issue is in BGA framework).

Re: Hotseat mode and "gamedatas.playerorder"

Posted: 08 August 2020, 11:36
by Draasill
I really don't know which category, neither 😅

Re: Hotseat mode and "gamedatas.playerorder"

Posted: 08 August 2020, 11:43
by Draasill
My bad !

"playerorder" is not set correctly when we are an observer, not because of hotseat !

Re: [Solved] Hotseat mode and "gamedatas.playerorder"

Posted: 24 October 2021, 17:57
by dudi2
My workaround is like this to get back same data format as this.gamedatas.playerorder:

In getAllDatas() in file gamename.game.php:

Code: Select all

$nextPlayerTable=self::getNextPlayerTable();
$spectatorPlayerOrder = array();
$nextplayer = $nextPlayerTable[0];
$i = 0;
do
{
	$spectatorPlayerOrder[$i] = $nextplayer;
	$i++;
	$nextplayer = $nextPlayerTable[$nextplayer];
}
while ($nextplayer != $nextPlayerTable[0]);
$result['spectatorPlayerOrder'] = $spectatorPlayerOrder;
In setup: function( gamedatas ) in file gamename.js

Code: Select all

if (this.isSpectator) { this.gamedatas.playerorder=gamedatas.spectatorPlayerOrder; }
Is there a reason the framework delivers a different result when a spectator watches the table than for regular players at the table?