Tutorial Reversi errors

Game development with Board Game Arena Studio
frankdimat
Posts: 2
Joined: 29 December 2022, 22:41

Tutorial Reversi errors

Post by frankdimat »

Hi to all,
i start to follow the tutorial, but is very hard in the first steps...
I upload the gameinfo.inc changed (only after one hour, i found i must impose to reload it with a button in the game page... :( )
Ok... I insert the board style in the .css file, then the div id=board code in the .tpl file (TPL??? what means TPL??? why not html???).
I upload them, ok but when i start with the "start express" button a large number of error messages appears:
Errors are in the "reversi.game.php" file... but, sorry, who had change it? Sure NOT ME!
Tutorial says about a "blank" game: if is "blank", don't read the .php file... So, the errors are:
"Unexpected error: Wrong formatted data from gameserver 1 (method: createGame): JSON_ERROR_SYNTAX
Notice: Undefined index: player_colors in /var/tournoi/release/games/frankdimattutorial/999999-9999/frankdimattutorial.game.php on line 64

Warning: array_shift() expects parameter 1 to be array, null given in /var/tournoi/release/games/frankdimattutorial/999999-9999/frankdimattutorial.game.php on line 72

Notice: Undefined index: player_colors in /var/tournoi/release/games/frankdimattutorial/999999-9999/frankdimattutorial.game.php on line 77

Warning: Invalid argument supplied for foreach() in /var/tournoi/release/tournoi-230111-1000-gs/www/game/module/table/table.game.php on line 912
{"status":1,"data":true} (reference: GS0 19/01 00:53:03)

Thanks for reading and for appreciate suggests
Francesco
frankdimat
Posts: 2
Joined: 29 December 2022, 22:41

Re: Tutorial Reversi errors

Post by frankdimat »

Hi,
i added (1,2) in the array players (I canceled the 2) but now errors are in the "init the board" function. I tryed to comment all this function in <mygame>.game.php.
Now the "red errors" disappears, but once again the game don't starts and the board don't load...
Now it seems that the error is in DB files:
"Sorry, an unexpected error has occurred...

Error while processing SQL request (Localhost via UNIX socket): SELECT board_x x, board_y y, board_player player FROM board WHERE board_player IS NOT NULL Table 'ebd_frankdimattutorial_448303.board' doesn't exist (reference: GS1 19/01 09:18:28)"

Why is so hard to see only the board in the game page? :cry:
User avatar
CheesePuppy
Posts: 10
Joined: 09 March 2023, 14:22

Re: Tutorial Reversi errors

Post by CheesePuppy »

I'm having issues here as well. Though, I don't think they're the same issues.

I'm at this part, and I've followed it character for character, and yet it is not working :? I wonder, has anyone else had this issue?
<div id="board">
</div>

edit your reversi.css file to transform it into a visible board:

#board {
width: 536px;
height: 528px;
background-image: url('img/board.jpg');
}
User avatar
Blacktango
Posts: 434
Joined: 18 April 2015, 12:15

Re: Tutorial Reversi errors

Post by Blacktango »

What is your issue? What happens or what doesn't?

"It is not working" doesn’t help a lot to be able to help you ;)

Did you upload your modified files? Did you reload the page?
User avatar
CheesePuppy
Posts: 10
Joined: 09 March 2023, 14:22

Re: Tutorial Reversi errors

Post by CheesePuppy »

Blacktango wrote: 04 May 2023, 18:38 What is your issue? What happens or what doesn't?

"It is not working" doesn’t help a lot to be able to help you ;)

Did you upload your modified files? Did you reload the page?
Eek. You're right. That was super not descriptive. I have uploaded the files and the board isn't showing up. I was originally able to update the tpl file, but then the board div isn't working. Yes, files were uploaded and I refreshed the page a bunch of times.

To be quite honest, I'm feeling pretty not smart for failing with a div, some style, and a jpg file.

https://github.com/VickiLanger/BGA-Reve ... epuppy.tpl
https://github.com/VickiLanger/BGA-Reve ... epuppy.css
User avatar
robinzig
Posts: 415
Joined: 11 February 2021, 18:23

Re: Tutorial Reversi errors

Post by robinzig »

Have you cleared the browser cache before reloading? (The keyboard shortcut is Ctr/Cmd+F5 on most operating systems/browsers.) This is a common problem for those new to web development and/or the BGA framework, especially as BGA handles the CSS and JS files differently in this respect - but you always need to clear the cache when updating CSS.
User avatar
Blacktango
Posts: 434
Joined: 18 April 2015, 12:15

Re: Tutorial Reversi errors

Post by Blacktango »

Did you download the board.jpg file and did you upload it in the img/ directory?
User avatar
CheesePuppy
Posts: 10
Joined: 09 March 2023, 14:22

Re: Tutorial Reversi errors

Post by CheesePuppy »

robinzig wrote: 04 May 2023, 22:13 Have you cleared the browser cache before reloading? (The keyboard shortcut is Ctr/Cmd+F5 on most operating systems/browsers.) This is a common problem for those new to web development and/or the BGA framework, especially as BGA handles the CSS and JS files differently in this respect - but you always need to clear the cache when updating CSS.
Interesting. I'll keep this in mind. Back end is where most of my experience is, but I'm not a stranger to web dev either. I've cleared cache and no luck.

Of note:
  • I can update the `edit this HTML in your ".tpl" file.` line and see the update
  • If I move my div above that line, the line moves to the bottom of the play area. So, the size of the div is recognized
User avatar
CheesePuppy
Posts: 10
Joined: 09 March 2023, 14:22

Re: Tutorial Reversi errors

Post by CheesePuppy »

Blacktango wrote: 04 May 2023, 23:17 Did you download the board.jpg file and did you upload it in the img/ directory?
I definitely have the file.

Worth noting:
  • clearing chache doesn't help
  • I can update the `edit this HTML in your ".tpl" file.` line and see the update
  • If I move my div above that line, the line moves to the bottom of the play area. So, the size of the div is recognized

Code: Select all

<div id="board">
</div>
This is my first asdfasdfgame interface. edit this HTML in your ".tpl" file.

Code: Select all

div {
    border-style: 10px solid red;
}

#board {
    width: 536px;
    height: 528px;
    background-image: url('img/board.jpg');
}

Code: Select all

➜  bga git:(main) ✗ cd img                            
➜  img git:(main) ✗ ls    
README    board.jpg
User avatar
Tisaac
Posts: 2351
Joined: 26 August 2014, 21:28

Re: Tutorial Reversi errors

Post by Tisaac »

CheesePuppy wrote: 05 May 2023, 15:17
Blacktango wrote: 04 May 2023, 23:17 Did you download the board.jpg file and did you upload it in the img/ directory?
I definitely have the file.

Worth noting:
  • clearing chache doesn't help
  • I can update the `edit this HTML in your ".tpl" file.` line and see the update
  • If I move my div above that line, the line moves to the bottom of the play area. So, the size of the div is recognized

Code: Select all

<div id="board">
</div>
This is my first asdfasdfgame interface. edit this HTML in your ".tpl" file.

Code: Select all

div {
    border-style: 10px solid red;
}

#board {
    width: 536px;
    height: 528px;
    background-image: url('img/board.jpg');
}

Code: Select all

➜  bga git:(main) ✗ cd img                            
➜  img git:(main) ✗ ls    
README    board.jpg
How exactly are you clearing cache ? You tried ctrl + maj + r ? (On firefox at least)
Post Reply

Return to “Developers”