How do I problem with localstorage

0 favourites
  • 4 posts
  • Hi friends <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> Recently I posted a play in the play store that gave a certain success. That's okay, so I started getting a lot of negative reviews about the user's saved data. Complaints about total data loss. I trusted the security of LocalStorage, I made the entire system of saves, saving variables and arrays in local storage.

    I would like to know if there is a way to avoid this problem of data loss in the local storage and especially if it has to save the progress of the users in the cloud.

    I am very worried about this situation, even more that I implemented microtransaction to the game.

    Any free or paid solution is welcome! xD

    Thanks for reading this far.

    and sorry for my english I'm Brazilian.

    For those who are curious about the game, follow the link. https://play.google.com/store/apps/deta ... corruption

  • Please share a screenshot of the event sheet where you deal with Local Storage.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please share a screenshot of the event sheet where you deal with Local Storage.

    Part 1 key call

    Part 2

    Part 3 saving the key

  • First, if you are using "Check item exists", you don't need "Get" and "On item get".

    You can access LocalStorage.ItemValue from the "On item exists" event.

    But this should not cause any issues.

    Most problems with local storage happen when people don't wait for Set Item action to finish before reading the same item from local storage.

    For example - at the end of the level 1 you save some item into local storage and then change layout to level 2.

    On start of level 2 you Get the same item from local storage. If you don't wait for Set action to finish before switching to the next layout, then there is a big chance that the item will be read incorrectly.

    Another common mistake is when people don't wait for the Get action to finish before trying to access this data.

    For example:

    Get item "HighScore"

    Score Set text to HighScoreVar

    Use "Local Storage -> On all gets complete" and "Local Storage -> On all sets complete" and "System-Signal", "System-Wait for signal" to properly organize your flow of events.

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