Page 1 of 1

[ Solved ] gameinfos.inc.php

Posted: 09 January 2024, 13:58
by Fred504
Hello
In this studio doc page
https://en.doc.boardgamearena.com/Game_ ... ner_fields

we can read examples like
'players' => array( 3, 4, 6 )

But this is not PHP code! Should I put it in some data like this?
$this->someData = [ 'players' => array( 3, 4, 6 ) ] ;

Re: gameinfos.inc.php

Posted: 09 January 2024, 15:37
by RicardoRix
it looks ok to me.
It's just showing you one element of an array (a key->value pair).
The example omits the fact there is an outside array brackets[], or array() declaration. Quite often it's spread out over multiple lines.

Code: Select all

$this->someData =
[

 'player' => array(1,2,3),


];

Re: gameinfos.inc.php

Posted: 09 January 2024, 15:54
by Fred504
RicardoRix wrote: 09 January 2024, 15:37 it looks ok to me.
It's just showing you one element of an array (a key->value pair).
The example omits the fact there is an outside array brackets[], or array() declaration. Quite often it's spread out over multiple lines.

Code: Select all

$this->someData =
[

 'player' => array(1,2,3),


];
Nice!

But how the BGA system will use someData?
To say, for example, that we can play at 3,4 or 6 players ?

Re: gameinfos.inc.php

Posted: 09 January 2024, 15:58
by LeSteffen
The framework will read what you put into gameinfos.inc.php. But don't forget to click on "Reload game informations" on your studio game site

Re: gameinfos.inc.php

Posted: 09 January 2024, 15:58
by RicardoRix
Yeah, it's mainly self-explanatory.

You should only be able to select 3,4, or 6 players when you try and start a game table.

Pretty sure it's not called 'someData' just whatever it was called in the file originally - you need to leave it alone. You just fill it in, or add to it as required. No modifying names and hoping the magic fairy knows what you're talking about.

Re: gameinfos.inc.php

Posted: 09 January 2024, 16:09
by Fred504
RicardoRix wrote: 09 January 2024, 15:58 Yeah, it's mainly self-explanatory.

You should only be able to select 3,4, or 6 players when you try and start a game table.

Pretty sure it's not called 'someData' just whatever it was called in the file originally - you need to leave it alone. You just fill it in, or add to it as required. No modifying names and hoping the magic fairy knows what you're talking about.
It's not called someData.
So what should I write in gameinfos.inc.php
Only this?

Code: Select all

 'player' => array(3,4,6),
Please tell me what I should write with this example.

Re: gameinfos.inc.php

Posted: 09 January 2024, 16:44
by RicardoRix
It called this->gameinfos = [];

and inside it's called 'players' (not 'player').

Just look at a finished project to see examples.

https://github.com/ekelly/bga-ninetynin ... os.inc.php

Don't change the names or the types of things, just fill it in.

Re: gameinfos.inc.php

Posted: 09 January 2024, 16:55
by Fred504
RicardoRix wrote: 09 January 2024, 16:44 It called this->gameinfos = [];

and inside it's called 'players' (not 'player').

Just look at a finished project to see examples.

https://github.com/ekelly/bga-ninetynin ... os.inc.php

Don't change the names or the types of things, just fill it in.
Thanks! 👍