Page 1 of 1

Copiing BGA Studio project fails

Posted: 10 November 2019, 13:42
by Woodruff
Hi everybody,

I am trying to copy my project of Toc (already published in BGA) in order to do bug hunting without wrecking my base code.
I named this project TocDebugg and at this moment it has the same code as Toc (I did not change anything).

But when I try to launch a TocDebug game, it fails on loading the game: "An important BGA module couldnt be found, and your game cannot be loaded [...]"
While the original Toc still loads well.

I also tried to reload all reloadable files (stats, img, options...) but that does not solve the problem.

What do I miss do you think?

Thanks a lot!

Woodruff

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 14:52
by RicardoRix
you could zip your current folder to make a backup, make changes and if it fails then re-employ the zip.

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 15:46
by A-dam
Check if every reference to original name toc is changed in new project correctly.

For example in js file:

Code: Select all

return declare("bgagame.toc", ebg.core.gamegui, ...
->

Code: Select all

return declare("bgagame.tocdebug", ebg.core.gamegui, ...
this must be done in all concerned files, reference is almost in all php files and the name must be correctly changed

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 15:53
by DrKarotte
What about the lines where the project name is set, e.g. in the JS constructor, or ajax calls, can these stay the same as in the original game?

See A-Dam's more detailed reply.

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 16:52
by Woodruff
Hi,
Thanlks for your answers. I've check everything, everything has been replace correctly except my references to stockitem, which have been replaced by stocdebuggkitem :o :o :o

I corrected that but unfortunately the problem is still there...
Any more ideas?

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 17:04
by RicardoRix
the module error can crop up due the JS define and declare statements.
do you need to click any of those load buttons in the control panel...

But IMO you're missing the obvious solution.

Re: Copiing BGA Studio project fails

Posted: 10 November 2019, 17:31
by Woodruff
I already clicked them all.
But your're right, I'll backup my current project and work from it.
Still, I pinpointed that this is a bug that prevents to use that button for other uses, such as developing an expansion.

Re: Copiing BGA Studio project fails

Posted: 11 November 2019, 13:32
by Een
Thanlks for your answers. I've check everything, everything has been replace correctly except my references to stockitem, which have been replaced by stocdebuggkitem :o :o
Ah, yes, copying a project relies on replacing the project name by another one in class names and such automatically. If the name of the game is not specific enough, the replacement can do a little too much...
I am trying to copy my project of Toc (already published in BGA) in order to do bug hunting without wrecking my base code.
I named this project TocDebugg and at this moment it has the same code as Toc (I did not change anything).
You can use the version control system for that, just take a note of the current version when clicking show log history, and you can go back to this version of the codebase anytime after your bug hunting. It's better than creating copies in most cases.