Can load a json file into array, but not save the array as a json file?

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hi everyone. I've successfully created a system that supports using multiple languages in the game.

    I also have a .json file called "settings" which stores sound and music volume, and the chosen language (all 3 are just integers). Everything is loaded into an array on startup which works fine. The problem is I want to save the settings array to overwrite the settings.json file. All I can find is the "Download as file" thing but this prompts the user to save the file which it shouldn't. It should be silent.

    As far as I can tell, if I want to save the information I have to completely rewrite the settings functionality using the local storage object, saving 1 key at a time.

    Am I doing things totally backwards?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Might be overthinking it? You wouldn't need to save the file again. If you are updating the current settings of the player then you update the array during runtime. If you want to save the game you can use system save/load.

  • What a genius way of doing it. Such a big headache removed just by using 2 lines of code. Thank you :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)