Number of players is not reseting

Game development with Board Game Arena Studio
Post Reply
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Number of players is not reseting

Post by JesterX »

Hello, I'm a new developper here.

My game is configured to be playable only by 2 players.

I resetted the gameinfos.inc.php and it loaded correctly :

'players' =>
array (
0 => 2,
),

However, when I do start a new game, it's still only playable by 1-4 players and I can't reduce the number of player to "2" (in the new game screen), I get the following message:

"Can't start game with less players"

What should I do?
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Number of players is not reseting

Post by pikiou »

Works fine for me, when I start a table, I'm forced to have 2 players.
Problem might be coming from clicking "Create a table with the same settings than current one", which forces the same 1-4 number of players.
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Re: Number of players is not reseting

Post by JesterX »

Here are screenshots of the said problem:
player count 1.png
player count 1.png (34.96 KiB) Viewed 3602 times
player count 2.png
player count 2.png (199.41 KiB) Viewed 3602 times
Any idea?
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Re: Number of players is not reseting

Post by JesterX »

Ok, I found the source of the error. Careful, very technical stuff below :)

It's in ly_metasite.js

game_min_players is equal to 2 (As it should be)
but
Since minp is equal to 1, even if I reduce maxp by 1, minp is still inferior to 2.

minp comes from the "wanted_min" control. It seems that it comes from the _a19.min_player object.

Now, I wonder where that value come from. It might be queried from a database which is not "dead"?

How can I reset all previous instances of my game? drop all databases related to it?

Anyone knows where _a19.min_player is loaded from?

function(_aad, _aae)
{
var minp = toint($("wanted_min").innerHTML);
var maxp = toint($("wanted_max").innerHTML);
minp += _aad;
maxp += _aae;
if (maxp < minp)
{
if (_aae == -1)
{
minp = maxp;
}
else
{
maxp = minp;
}
}
if (maxp < this.tabledatas.current_player_nbr)
{
this.showMessage(_("Expel a player first"), "error");
}
else
{
if (minp < this.tabledatas.game_min_players)
{
this.showMessage(_("Can't start game with less players"), "error");
}
else
{
if (maxp > this.tabledatas.game_max_players)
{
this.showMessage(_("Maximum number of players for this game"), "error");
}
else
{
$("wanted_min").innerHTML = minp;
$("wanted_max").innerHTML = maxp;
this.ajaxcall("/table/table/changeWantedPlayers.html",
{
table: this.table,
maxp: maxp,
minp: minp
}
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Re: Number of players is not reseting

Post by JesterX »

Seems that the _a19 object comes from an ajax call to /table/table/tableinfos.html

So, I guess that this is the newly created game table.

How come the newly created game table have a minimum number of players value of 1 and a maximum number of players value of 4 for a game that is configured to be played with 2 players only

How does the backend create game tables?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Number of players is not reseting

Post by Een »

Hi,

Can you try with

Code: Select all

'players' => array( 2 )
then

Code: Select all

'players' => array( 1, 2, 3, 4 )
and see if one of these configuration works ?

Cheers,
Een
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Re: Number of players is not reseting

Post by JesterX »

Based on Een solution, I found a way to solve it!

Thanks Een!

For future knowledge base:

I setted the game infos to the following:

Code: Select all

'players' => array (1, 2, 3, 4)
I started a new game, setted the amount of player to 2 (min 2, max 2)

Then I changed back the infos to the right value:

Code: Select all

'players' => array( 2 )
And now, when I start a new game, everything is fine.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Number of players is not reseting

Post by Een »

Great! (you must have started a table with a 1-4p configuration before setting the 2p configuration, and since the system creates a new table with the same settings as the last one created by the same player, there was a conflict)

Cheers,
Een
Post Reply

Return to “Developers”