How can I run an HTML5 template and swap out the .pck file for different games?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DigNZ

We are setting up a gallery of games powered by a CMS. To manage this we need to host the html in a templated file / page type and then load the .pck file.

I’ve tried taking the html of the game and templating the const MAIN_PACK so that can be populated from the database for the given game. I then initialise the engine with a path to the .wasm file, the theory being that if all the games are from the same engine we can reuse the html framework, the .js file and the wasm file and just swap out the .pck file.

I’ve got it loading the .pck and .wasm file with the progress and loading indicators showing. but it always fails with an alert:

Could not load game data at path ‘.’. Is the .pck file missing?

Looks like something I haven’t found is expecting the pck file in a certain place.

Any pointers on how I can achieve this and what other variables need to change in the javascript or elsewhere to get this working?

:bust_in_silhouette: Reply From: Lucas Pires Camargo

I’ve had a similar problem when loading the pck from a different location. Please try again with the 3.2.1 release, which fixed it for me.