[Solved] Hotseat mode and "gamedatas.playerorder"

Game development with Board Game Arena Studio
Post Reply
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

[Solved] Hotseat mode and "gamedatas.playerorder"

Post 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 ?
Last edited by Draasill on 08 August 2020, 11:44, edited 1 time in total.
User avatar
Inaofr
Posts: 142
Joined: 26 March 2020, 22:26

Re: Hotseat mode and "gamedatas.playerorder"

Post 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).
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: Hotseat mode and "gamedatas.playerorder"

Post by Draasill »

I really don't know which category, neither 😅
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: Hotseat mode and "gamedatas.playerorder"

Post by Draasill »

My bad !

"playerorder" is not set correctly when we are an observer, not because of hotseat !
User avatar
dudi2
Posts: 223
Joined: 05 December 2015, 20:30

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

Post 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?
Post Reply

Return to “Developers”