Is there a way to clear the save game data?

0 favourites
  • 8 posts
From the Asset Store
Basics sprites and tilesets to build a platformer game or prototype
  • So im using the standard "Save/Load" from the System actions, and i wanted to implement and option to clear all the save games, is there a way to do this? I didnt find an action to this, shouldnt be one for this? Its pretty common for games to have a way to hard reset it.

  • There is no way to delete a save, the way you could do it is just deleting a reference to a save, like checking a webstorage value that would be related to that save.

    Ashley the request is still really valid, could a simple "delete existing save (by name)" exist?

  • There is no way to delete a save, the way you could do it is just deleting a reference to a save, like checking a webstorage value that would be related to that save.

    Ashley the request is still really valid, could a simple "delete existing save (by name)" exist?

    you can delete the savegame by "clear cache" of your browser... and this isn't good if you want to make a game online...

    but it depends what do you want to store... save game system will save all, position of the instance, variable, global variable etc...

    for delete a savegame is possible to save a state at the first access like "reset" savestate, and when you want to reset all stats, just click a button, and a "reset" savestate will replace the old gamesave... that should work...

    but I suggest to save a game on some server with a php an AJAX, and if the player want to reset the game, just do this process and replace with the json file on the server... I don't like to store information on the browser... if you are making a game with a lot of level, or something important to continue the game (store coin, jems, position of the sprite...levels..other important stuff..)....and the user clear the cache, just say bye bye to your save...

    but depends of the game... if you are making a game like tetris... and just post your score at the end of the game... no problem

    EDIT: I add a capx

  • Oh man thanks Ribis thats a really good idea, im making and Idle game like Coockie Clicker or Clicker Heroes, so i think the cache will be fine.

  • Its been a while since I used C2. but I started updating an old game and I found and I couldn't delete save game either (easily anyways..)

    I found a work around if you want to delete the entire save database for the game. Use the Browser object and execute the javascript "window.indexedDB.deleteDatabase('_C2SaveStates');"

    I haven't found an easy way to delete individual keys from the "saves" objectstore.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know this is an old post, but since C3 Runtime is now the default and not C2 I think this still applies.

    When I switched to C3 a lot of my project broke, so I am trying to get things working under C3 Runtiume.

    For some time now I have been successfully deleting the database by:

    	window.indexeddb.deletedatabase('_c2savestates');
    

    However, I can no longer find the name of the database in the scripts/c3runtime.js so I am unable to delete it like I have in the past.

    (Started a new topic here: https://www.construct.net/en/forum/construct-3/how-do-i-8/how-to-delete-indexeddb-in-c3-138497)

  • Hello dear collegues!

    I am making a NW.js app in C2 that should run for several days and when I use "Save/Load" general function, in Chrome or Nw.js at least it drives to "memory leak" ... the only way I found to solve it is to clear entirely (manually delete in the inspector of chrome or NW.js) so memory do not reach the limits to crash the app... (that is about 2 hours)...

    I found very interesting the option to call the browser object to run the javascript "window.indexeddb.deletedatabase('_c2savestates');" ... but it does not work for me, I don't know if need any kind of permission, or what to do... but it does not clear (nor delete) this database...

    could you make me a CAPX example or give me some tip to erase this _c2savestates ?

    thank you in advance, please someone help me cause I am working on this app for about 3 months and is useless due to this crash..

    Note: tried to use localstorage because of the amount of variables and objects... does not work for me, long to explain, just believe I need to use save/load

    Thanks in advance again!

  • Hey Colleagues!

    I figure out even deleting manually... program eventually will crash... somehow using general save/load and being patient and deleting manually... the memory raises (much slower) but will raise enough to crash...

    I don't know why can not be used the general save and load from Contruct2 in chrome, chromium, NW

    ....

    awful... I dont know what will do now...

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