(Finished) Need help with Local Storage

0 favourites
  • 6 posts
From the Asset Store
"Easy Local Notifications" enhances games with customizable local notifications.
  • Hey,

    So I got these events:

    But when I close the game and reopen it, the variable does not change...

    What am I doing wrong?

  • You have to have the following layout:

    Get item "HighScore" [action]
    On item get "HighScore" [event]
       -> Set HighScore to LocalStorage.ItemValue [action][/code:31xgsjjm]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have to have the following layout:

    Get item "HighScore" [action]
    On item get "HighScore" [event]
       -> Set HighScore to LocalStorage.ItemValue [action][/code:2u2qgew9]
    

    Great, thank you!

  • Heads up for anyone doing this:

    It does not work if the variable name and the local storage key name are the same

  • Hey, please follow these steps, i hope helps you,

    http://d.top4top.net/p_305a18v01.png

    1. in start page of your game you need to do like this image, and you need also to make unique local variable for local storage only, and call it record, (Means every score that user receive will be recorded in record variable,

    http://e.top4top.net/p_3055le1c2.png

    2. this image here you make a record variable, as you see inside the image, the high score will set same number with the record, set high score to record to stay on the same level that you received, note; ( local storage and record variable never removed if you set item currently.you set this on level selection page.

    http://f.top4top.net/p_30579jjx3.png

    3. in the whole levels, you must make a sup event behind the score that the use will received to save it in the record, this will save your high score even when you close and open the game in the browser or mobile phone it is the same.

  • Hey, please follow these steps, i hope helps you,

    http://d.top4top.net/p_305a18v01.png

    1. in start page of your game you need to do like this image, and you need also to make unique local variable for local storage only, and call it record, (Means every score that user receive will be recorded in record variable,

    http://e.top4top.net/p_3055le1c2.png

    2. this image here you make a record variable, as you see inside the image, the high score will set same number with the record, set high score to record to stay on the same level that you received, note; ( local storage and record variable never removed if you set item currently.you set this on level selection page.

    http://f.top4top.net/p_30579jjx3.png

    3. in the whole levels, you must make a sup event behind the score that the use will received to save it in the record, this will save your high score even when you close and open the game in the browser or mobile phone it is the same.

    Thank you SaRaB, but randomly helped me already...

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