Discord
Login
Community
DARK THEME

Im making a level making game how do i get all of the data from the game dowloaded to an .html file so you can reopen and re edit a level

game url: https://microstudio.io/JensGameStudios/bobmaker/

If you run the program as a plugin, then you have access to the project files.

You can read the project files and write system.project.readFile()

system.project.writeFile()

If you want to load data in an already released program (game) and run outside MicroStudio, you can Export to e.g. json and load the data via a text file (code run in the browser).

You cannot access the file system from the browser automatically for read and write operations - this is a security model, otherwise each www page would download your disk.

The only option is to open a dialog window and the user must indicate the file, or the user must drag the file to the game area (you must write javascript code for this).

https://developer.mozilla.org/en-US/docs/Web/API/Window/open

It is possible that when you export your game to .exe format, it will be possible to open local files.

You can also save (send the file) to some server.

It wouldn't be an HTML file, but you can convert the data to a serializable object and save it as JSON, either using storage or using assets as a plugin.

thanks!!!

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community