getGameinfos not working

Game development with Board Game Arena Studio
Post Reply
User avatar
VinnieG
Posts: 1
Joined: 22 May 2020, 00:11

getGameinfos not working

Post by VinnieG »

I created a new project and then copied my code from a working version (and changed all the names). Now I get the following error when trying to access the player_colors of gameinfos. Also, the items in material.inc.php are not valid.

Notice: Trying to access array offset on value of type null

In 'setupNewGame':

$gameinfos = self::getGameinfos();
$default_colors = $gameinfos['player_colors'];


I performed a 'reload game informations' and used CTRL+f5 but it didn't help.

Thanks!
NFranklin
Posts: 1
Joined: 10 March 2022, 02:03

Re: getGameinfos not working

Post by NFranklin »

self::getGameInfos(); should simply be returning the gameinfos array defined in your gameinfos.inc.php file so if the function isn't working correctly, the answer ought to be there.

Is 'player_colors' defined in that file and long enough for the number of players you have? (Though it should just reuse colors if length is an issue)

How exactly did you go about copying over code from your working project instance? The best way is to just use the provided source version control in the project management page to overwrite a newly created project with the working instance.
Version control.png
Version control.png (232.82 KiB) Viewed 231 times
Post Reply

Return to “Developers”