Is there a way to clear the save game data?

Discussion and feedback on Construct 2

Post » Thu Nov 27, 2014 1:09 pm

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.
B
13
S
3
Posts: 101
Reputation: 1,238

Post » Thu Nov 27, 2014 2:27 pm

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?
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Thu Nov 27, 2014 7:05 pm

Aphrodite wrote: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 :D

EDIT: I add a capx
You do not have the required permissions to view the files attached to this post.
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Sun Nov 30, 2014 10:56 pm

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.
B
13
S
3
Posts: 101
Reputation: 1,238

Post » Mon May 08, 2017 10:27 pm

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.
B
16
S
1
G
1
Posts: 17
Reputation: 1,857


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests