[ Solved ] gameinfos.inc.php

Game development with Board Game Arena Studio
Post Reply
Fred504
Posts: 22
Joined: 06 January 2024, 13:20

[ Solved ] gameinfos.inc.php

Post 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 ) ] ;
Last edited by Fred504 on 09 January 2024, 16:51, edited 2 times in total.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: gameinfos.inc.php

Post 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),


];
Fred504
Posts: 22
Joined: 06 January 2024, 13:20

Re: gameinfos.inc.php

Post 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 ?
Last edited by Fred504 on 09 January 2024, 16:02, edited 1 time in total.
User avatar
LeSteffen
Posts: 77
Joined: 13 July 2020, 15:32

Re: gameinfos.inc.php

Post 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
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: gameinfos.inc.php

Post 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.
Fred504
Posts: 22
Joined: 06 January 2024, 13:20

Re: gameinfos.inc.php

Post 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.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: gameinfos.inc.php

Post 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.
Fred504
Posts: 22
Joined: 06 January 2024, 13:20

Re: gameinfos.inc.php

Post 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! 👍
Post Reply

Return to “Developers”