games exported on HTML5 don't work when i start the index.html

raouf ben 9100

  • Posts: 9
when I test games on html5 they work just fine but when I publish and try the index.html the game freeze on the loading screen and the game never starts

Luyren

  • *
  • Posts: 2347
The attached image was the explanation precisely about that on the discord server a couple of days ago.

The zip file or the resulting folder should be uploaded to a server for it to work. As far as I know when you upload to a site like kongregate or newgrounds that is handled for you.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

jayrstewart

  • Posts: 1
If you have Python installed, you can use this from a command line from within the same folder as the index.html to test an HTML5 export:

Python 2.x:
python -m SimpleHTTPServer 8080

Python 3.x:
python -m http.server 8080

Then you can open http://localhost:8080/ in your browser and it should load your game.

Change the port 8080 to whatever you like.

Source: https://stackoverflow.com/questions/7943751/what-is-the-python-3-equivalent-of-python-m-simplehttpserver

raouf ben 9100

  • Posts: 9
why do you need a server to use it ? is it possible to make it playable without putting it in to a server?

Luyren

  • *
  • Posts: 2347
From what I understand, it's a security feature of browsers to prevent the execution of malicious scripts, that's why you need a server.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

JeffreyDriver

  • Posts: 2260
For yourself I don't see why LAMP/WAMP wouldn't work. If you were hoping to share this with friends, then that's not a workable solution.

designpeg

  • *
  • Posts: 730
I'm having a similar problem, this didn't happen with the previous build. The error I get is my clients server can't find the .pak file that contains the game assets, and gives a 404 error for default.pak when you look at the request there is an extra forward slash after lib like this gamename /lib//default.pak

This causes the game to freeze on the loading page- which sounds like your situation. My problem is that I don't know of it's Stencyl or my clients server that's causing the problem.

Might be worth you looking at your browsers console log to see if it's the same issue?

lordk

  • Posts: 3
I also uploaded to a azure webserver but still have the freeze problem when loading. It seems that HTML5 exporting is failing and with FLASH deprecated we don't have any option for publish our games.

Seems that STENCYL is no longer a option for online develop.

« Last Edit: June 27, 2020, 08:50:58 am by lordk »

Luyren

  • *
  • Posts: 2347
I can export games to HTML5, post them on itch.io and everything works just fine. We can't help you unless you provide  more information. The problem is most likely how you have your server setup.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

lordk

  • Posts: 3
Woow! Great resource! thanks for the tip!...

What do you think is the configuration of itch vs a clean server? js execution? or what..

Luyren

  • *
  • Posts: 2347
I have no knowledge on servers, so I can't help you with that. There are several websites you can upload your game and play (newgrounds, kongregate and itch.io to name few). You can make a new thread to ask about it, or go to Stencyl's discord server and see if anyone knows how to properly setup a server.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter