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

  • 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:

    Level selection event sheet:

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

  • 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?

  • 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:

    Level selection event sheet:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just an example of "Is processing Gets" condition

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

    Well done anyways!

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