[solved] How do I make Localstorage remember my progress?

Get help using Construct 2

Post » Sun Aug 02, 2015 4:12 pm

Hello everybody,

i just wanted to know something about the Localstorage/Webstorage: I have a level selection (locked, unlocked, 1 to 3 stars) screen, with arrays and instance variables and everything works perfectly: when i finish a level and i go back to the screen selection, the passed level is done and the unlocked level is ok. For example, if i pass level 3, level 4 is unlocked, and if i decide to go to level 1, nothing changes, the progress is perfect!

Somehow, when i use the localstorage or the webstorage (same result) and I refresh the browser, it locks the last unlocked level! I did every possible thing that could be done, but I can't figure if it's a problem in my code or that there's a problem in the storage.

Here are screenshots of what I'm talking about:

Level event sheet:
Image

Level selection event sheet:
Image
Last edited by DonRIF on Sun Aug 02, 2015 6:00 pm, edited 1 time in total.
B
24
S
6
Posts: 64
Reputation: 1,436

Post » Sun Aug 02, 2015 4:51 pm

You can compare if the data is completely obtained, using "Is processing gets" from Localstorage plugin.
B
15
S
5
Posts: 40
Reputation: 1,221

Post » Sun Aug 02, 2015 4:56 pm

nonom wrote:You can compare if the data is completely obtained, using "Is processing gets" from Localstorage plugin.

Thank you for your answer! Where exactly should i put that condition?
B
24
S
6
Posts: 64
Reputation: 1,436

Post » Sun Aug 02, 2015 6:00 pm

Ok guys, I figured it out! I managed to solve it by pushing every important global variable on the Localstorage. Here are the screenshots, it now saves the progress perfectly! Thanks everyone!

Level event sheet:
Image

Level selection event sheet:
Image
B
24
S
6
Posts: 64
Reputation: 1,436

Post » Sun Aug 02, 2015 6:32 pm

Just an example of "Is processing Gets" condition

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

Well done anyways!
B
15
S
5
Posts: 40
Reputation: 1,221


Return to How do I....?

Who is online

Users browsing this forum: minigame, tannerdler, Uk4dee and 9 guests