Saving Data

  • I have read up on Local Storage and feel comfortable moving forward with it, but I am not 100% comfortable with comments regarding the data saved off and whether it is protected. If a player clears their cache, can it be wiped out?

    If you have a game where players need to play through a lot of levels and you need to save off their progress in addition to coin counts, is the only sure way to do this with a web-based DB? Is there any way to do it locally if the user gives permission?

    My apologies if this answer is out there on the forums somewhere. I just cannot seem to find a definitive answer. Thank you in advance for any help.

  • I have read up on Local Storage and feel comfortable moving forward with it, but I am not 100% comfortable with comments regarding the data saved off and whether it is protected. If a player clears their cache, can it be wiped out?

    If you have a game where players need to play through a lot of levels and you need to save off their progress in addition to coin counts, is the only sure way to do this with a web-based DB? Is there any way to do it locally if the user gives permission?

    My apologies if this answer is out there on the forums somewhere. I just cannot seem to find a definitive answer. Thank you in advance for any help.

    You can use File Chooser, Browser, AJAX and default save/load actions if you need to store user's files on user's disk.

    On save complete - start to download SaveStateJSON string (with browser or any other plugin that can download as string), then if user want to load the game, he need to choose the downloaded file with File Chooser, then your game need to read the contents of this file as string, you can use AJAX object for that, Request URL - FileChooser.FileURLAt(index) and when AJAX triggers On Completed you need to use system's action Load from JSON and set AJAX.LastData as a JSON string to load from. You can download any JSON with savegames data, not only system's SaveStateJSON.

  • Good and quick explanation I found the solution by reading your response to this topic. Thanks for that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sisyphus Would I also need NW.js to write the file?

  • Sisyphus Would I also need NW.js to write the file?

    Nope, you can use any export option with support of ajax and file chooser.

  • > I have read up on Local Storage and feel comfortable moving forward with it, but I am not 100% comfortable with comments regarding the data saved off and whether it is protected. If a player clears their cache, can it be wiped out?

    >

    > If you have a game where players need to play through a lot of levels and you need to save off their progress in addition to coin counts, is the only sure way to do this with a web-based DB? Is there any way to do it locally if the user gives permission?

    >

    > My apologies if this answer is out there on the forums somewhere. I just cannot seem to find a definitive answer. Thank you in advance for any help.

    >

    You can use File Chooser, Browser, AJAX and default save/load actions if you need to store user's files on user's disk.

    On save complete - start to download SaveStateJSON string (with browser or any other plugin that can download as string), then if user want to load the game, he need to choose the downloaded file with File Chooser, then your game need to read the contents of this file as string, you can use AJAX object for that, Request URL - FileChooser.FileURLAt(index) and when AJAX triggers On Completed you need to use system's action Load from JSON and set AJAX.LastData as a JSON string to load from. You can download any JSON with savegames data, not only system's SaveStateJSON.

    Hi, can you please provide a capx example file for this?

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