C++ project not working correctly when building to HTML5

In my project I’ve made a couple Blueprint nodes in C++ to save to/load from a text file. When I package to a Windows EXE the game runs as expected, with the saving/loading working correctly. When I package to HTML5 I don’t get the same results. The game runs and there are no errors as far as I know, but the saving/loading doesn’t work. Is this caused by HTML5 not supporting these C++ features, or am I doing something wrong?

Hello ,

Could you provide the logs for when you attempt to package so that I can see what errors it is giving you? Have you tried packaging to HTML5 with a fresh project to see if it is specific to what you are doing? If it is specific to your project, can you provide screenshots of the blueprint and post the relevant C++ code?

Here’s the log, I think.

As for errors, I’m not getting any. The HTML5 version of the game runs exactly like the Windows EXE version of the game, except for that the saving/loading to a text file doesn’t work in HTML5. I’ll add the c++ code below.

Here is the code

I should also add that I have tested it on a different project, and got the same results. It seems that that C++ feature can’t be done in HTML5 currently for some reason.

I’m still looking into this issue and just wanted to update to let you know. I’ll be sure to let you know when any solution/reason is found.

Hello ,

Thank you for your patience thus far. Is it possible for you to upload a sample project with the save/load feature that you’re using so that we can take a look at it? This could be a limitation of the engine but we’re unsure at the moment and will need more time to look into the issue.

Edit: If you wish for the sample project to be uploaded privately, feel free to link it to me in a private message on our [forums][1].

Hello ,

I’ll get back to you on Monday with this as I won’t be back to work until then. I definitely will upload a sample project though. I’ve done some thorough testing myself on this problem and haven’t come up with a fix as well. Thanks for the help so far.

Hello ,

I just sent the project to you on the forums.

Thank you. I’ve received it. I’ll let you know when I’ve made any discoveries.

Hello ,

The methods that you’re using to save are in-memory file saves, which will not persist past file page reloads. We’ll be putting in a task to make a “save game” API for the HTML5 platform. In the meantime, based on what your game will be, you could have the data saved on the server rather than locally (i.e. A cloud save). You would need to write this up yourself but it would be the best workaround for the moment.

I hope this helps and that we can get that other method in soon!

Hello ,

We are looking into a server based solution now, once we get that going we should be good to go! Thanks for the help.