How do I clear / reset the save slot

Get help using Construct 2

Post » Tue Mar 25, 2014 4:36 am

I am not understanding from the manual how to completely wipe a save slot using the "Save" action.

There are events for load failed. I want to force a load fail by making sure my slot is always clear.

I see Save and Load as actions, how do I Clear/Reset?
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Thu Mar 27, 2014 5:25 pm

Can anyone at least point me to the right code for this? or is it embedded with the exe?

I want to add a Clear option as well as a "Does Exist" check.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Thu Mar 27, 2014 7:15 pm

the save system uses webstorage plugin, so you can check for the local key

local key "save key" exist, and action : clear local key

ps: not checked but i think its in this direction
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017

Post » Thu Mar 27, 2014 7:34 pm

Load Save only happens when they hit the continue button in my game. So I also have a new Game button. If they hit new game (since they haven't loaded a save yet) it saves the default state of the game to the same slot and overwrites the past save.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Thu Mar 27, 2014 7:59 pm

vtrix wrote:the save system uses webstorage plugin, so you can check for the local key

local key "save key" exist, and action : clear local key

ps: not checked but i think its in this direction


So the Save action is exactly the same as local storage set? This is what I'm confused on...
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Thu Mar 27, 2014 8:01 pm

I think the save/load isn't using webstorage, but indexedDB, I don't think it is possible to flush it out in vanilla C2 though :/, could be wrong
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Mar 27, 2014 8:36 pm

ok it not saved in webstorage,

you can read more about the options you have, here

https://www.scirra.com/tutorials/526/how-to-make-savegames
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017

Post » Fri Mar 28, 2014 4:37 pm

vtrix wrote:ok it not saved in webstorage,

you can read more about the options you have, here

https://www.scirra.com/tutorials/526/how-to-make-savegames


I've looked through that, but all it does is explain how to do it, for my case I don't want to use the overwrite ability, mainly because of the way you can exit and enter the app.

I still would like to add a Clear and IfExists just to make it clean and easier to use in my code. Still looking for the location of these Save/Load functions.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Fri Mar 28, 2014 7:05 pm

these functions doesn't exist for indexedDB, you probably can check them tho in javascript console under rescources, , other than that maybe do a feature request
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, Darth Crusher and 1 guest