Error when trying to express start copy of hearts

Game development with Board Game Arena Studio
Post Reply
User avatar
JCase16
Posts: 116
Joined: 26 June 2015, 19:07

Error when trying to express start copy of hearts

Post by JCase16 »

So I'm trying to copy the hearts game into my "myspades" game just so I can start digging in. I believe I changed everything that needs to be changed to make this work but when trying to express start a game, I get this:
"Warning: require_once(/var/www/tournoi/include/action_myspades.inc.php): failed to open stream: No such file or directory in /var/tournoi/release/tournoi-151226-1240-gs/www/index.php on line 50 Fatal error: require_once(): Failed opening required '/var/www/tournoi/include/action_myspades.inc.php' (include_path='/var/tournoi/release/tournoi-151226-1240-gs/www/lib/google-api-php-client/src:.:/usr/share/php:/usr/share/pear') in /var/tournoi/release/tournoi-151226-1240-gs/www/index.php on line 50"

Anyone have any idea what may be causing this? I do not have a file named action_myspades.inc.php but I also have no idea where that would have come from.
User avatar
episodic
Posts: 7
Joined: 29 December 2016, 23:15

Re: Error when trying to express start copy of hearts

Post by episodic »

I have no idea what is the problem in this case, sorry, so maybe I post here off-topic, but just wanted to say that I gave up on trying to put the Hearts together. And when I was trying, I found an error in "gameoptions.inc.php":

Code: Select all

$game_options = array(

		100 => array(
				'name' => totranslate('Game length'),
				'values' => array(
						1 => array( 'name' => totranslate( 'Quick game (75 points)' ) ),
						2 => array( 'name' => totranslate( 'Standard game (100 points)' ),
				),
				'default' => 1
		)

);
- there is one closing bracket missing after (100 points)'
it should be:

Code: Select all

2 => array( 'name' => totranslate( 'Standard game (100 points)' ) ),
Maybe it helps you somehow.

BTW, Andy_K's "Nile" in shared code is great for checking how a card system works and it has no errors :)
User avatar
JCase16
Posts: 116
Joined: 26 June 2015, 19:07

Re: Error when trying to express start copy of hearts

Post by JCase16 »

Thanks episodic. DO you have any idea what changes have to be made to a game's code to make it work in a new game location? If I took Nile and just dumped it into my new game's FTP "mynewgame" then what needs to change?
User avatar
fafa-fr
Posts: 383
Joined: 22 December 2013, 21:58

Re: Error when trying to express start copy of hearts

Post by fafa-fr »

Hi,
JCase16 wrote:DO you have any idea what changes have to be made to a game's code to make it work in a new game location? If I took Nile and just dumped it into my new game's FTP "mynewgame" then what needs to change?
I once copied the content of a project folder to another project folder, and all I changed was the names of the files, and the occurences of the game name in the code (in 3 or 4 files at least, and not only at the beginning of the files). Beware if you use a case-sensitive search to look for the occurences of the game name, some of them are uppercase.
User avatar
episodic
Posts: 7
Joined: 29 December 2016, 23:15

Re: Error when trying to express start copy of hearts

Post by episodic »

edit: yes, exaclty what @fafa-fr has written.
You need to copy-paste the code from the following aknile files into your mynewgame files:
aknile.action.php
aknile.css
aknile.game.php
aknile.js
aknile.view.php
aknile_aknile.tpl
dbmodel.sql
material.inc.php
states.inc.php
stats.inc.php

And "img" folder with image files too.

After that you need to exchange all instances of aknile into mynewgame ->
From aknile.action.php file in mynewgame.action.php file:
class action_aknile extends APP_GameAction
class action_mynewgame extends APP_GameAction

$this->view = "aknile_aknile";
$this->view = "mynewgame_mynewgame";


From aknile.game.php file in mynewgame.game.php file:
class aknile extends Table
class mynewgame extends Table

function aknile( )
function mynewgame( )

return "aknile";
return "mynewgame";


From aknile.js file in mynewgame.js file:
return declare("bgagame.aknile", ebg.core.gamegui, {
return declare("bgagame.mynewgame", ebg.core.gamegui, {

console.log('aknile constructor');
console.log('mynewgame constructor');

this.ajaxcall("/aknile/aknile/pass.html",
this.ajaxcall("/mynewgame/mynewgame/pass.html",

this.ajaxcall("/aknile/aknile/market.html",
this.ajaxcall("/mynewgame/mynewgame/market.html",

this.ajaxcall("/aknile/aknile/offering.html",
this.ajaxcall("/mynewgame/mynewgame/offering.html",

this.ajaxcall("/aknile/aknile/plant.html",
this.ajaxcall("/mynewgame/mynewgame/plant.html",

this.ajaxcall("/aknile/aknile/speculate.html",
this.ajaxcall("/mynewgame/mynewgame/speculate.html",

From aknile.view.php file in mynewgame.view.php file:
class view_aknile_aknile extends game_view
class view_mynewgame_mynewgame extends game_view

return "aknile";
return "mynewgame";

$this->page->begin_block( "aknile_aknile", "myblock" );
$this->page->begin_block( "mynewgame_mynewgame", "myblock" );

$this->page->begin_block( "aknile_aknile", "field" );
$this->page->begin_block( "mynewgame_mynewgame", "field" );

$this->page->begin_block( "aknile_aknile", "opponent" );
$this->page->begin_block( "mynewgame_mynewgame", "opponent" );

and that is it.
Post Reply

Return to “Developers”