(Solved) How to delete indexedDB in C3 Runtime? (Save State Database c3runtime.js)

  • Before I switched to C3 Runtime I was able to delete the Save State Database "_C2SaveStates" located in the c2runtime.js This simply clears all save states.

    	"window.indexedDB.deleteDatabase('_C2SaveStates');"
    

    however, I am unable to find the name of the indexed DB in "scripts/c3runtime.js". One would assume it would be "_C3SaveStates" but it is not the case.

    Anyone know what the database ID changed to?

  • This is the kind of internal hackery with the engine that can break at any time as we change the engine.

    Why do you need to do this? You can clear storage using the browser development tools if you are testing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I agree, it is unfortunately a hack. As well, of course I am open to doing this properly. However I could not find the proper solution at the time.

    I used this hack to clear all saved data stored to the local machine from the "System Save Slot". It acted as a simple one line function to globally clear everything in the project itself. Unlike the browser clear cache, which isn't practical for this project.

    Unlike "localStorage" which has (Clear Storage, Remove Item) the "System Save" doesn't seem to have a clear function. It only has (load, load from Json, save) I am open to suggestions and appreciate any feedback you may have.

    Many Construct users have had this question and have also resulted to deleting the database.

  • As I mentioned in another thread, you can use LocalStorage to track which saves are in use, where you can iterate and delete keys.

  • The issue isn't with LocalStorage it is with "System Save Game State" Or are you saying we need to create an additional LocalStorage key for each "System Save Slot"?

  • Or are you saying we need to create an additional LocalStorage key for each "System Save Slot"?

    Yes, exactly. You can work around the fact you can't really clear save slots by just keeping a list of the save slots you are using in LocalStorage, and just delete the save slot from LocalStorage when you don't need it any more. When you want to know which save slots are in use, check with LocalStorage.

  • That makes sense, I will do that. Thanks once again :)

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