How do I put local storage on my game select level

Get help using Construct 2

Post » Tue Aug 18, 2015 6:10 am

Hello guys,

I been trying to put local storage on my game but i failed, every time I clear the stage and refresh browser it wont load from local storage.

anyone can fix my capx file is much appreciate.

https://www.dropbox.com/s/qhimrwy5tv95v ... .capx?dl=0

Thank you
B
6
Posts: 16
Reputation: 280

Post » Tue Aug 18, 2015 9:59 am

@mec

well, there were quite a few problems in there. It was actually saving the data, but it was never reading it and even if it did, the defaults were getting reset after every level. There was a lot happening every tick that didn't need to be running. I found the code very difficult to follow, so I structured it in a way that makes sense to me!

It works well now... I put in comments to try to explain what I was doing. I didn't add any error checking (because there isn't much you can do) but it does adapt itself if the number or levels increases - you will need that because it did save on your system thinking there were 4 levels and now it thinks there are 12.

http://www.rieperts.com/games/forum/localsavefix.capx
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Tue Aug 18, 2015 11:02 am

AllanR wrote:@mec

well, there were quite a few problems in there. It was actually saving the data, but it was never reading it and even if it did, the defaults were getting reset after every level. There was a lot happening every tick that didn't need to be running. I found the code very difficult to follow, so I structured it in a way that makes sense to me!

It works well now... I put in comments to try to explain what I was doing. I didn't add any error checking (because there isn't much you can do) but it does adapt itself if the number or levels increases - you will need that because it did save on your system thinking there were 4 levels and now it thinks there are 12.

http://www.rieperts.com/games/forum/localsavefix.capx


Thank a lot AllanR.

Now, I understand more on local storage

Much appreciate
B
6
Posts: 16
Reputation: 280

Post » Sat Sep 03, 2016 7:21 pm

Need help with my own Stage Select; Maybe this can help me...
B
13
S
1
Posts: 63
Reputation: 719


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, plinkie, rayolf and 10 guests