lp96's Recent Forum Activity

  • Update: The high score works perfectly. It saves instantly to the localstorage. It is the lifetime score variable the one I'm having problems with, which is basically the sum of all the scores the player has ever had. Now I'm even starting to wonder if this is actually something that can be done, although I don't see why it shouldn't.

    I even tried to do exactly the same process with lifetime score than the one I use with high score, but so far, it still is taking a long time to save the lifetime score:(

  • Alright, I did the Wait for Previous Actions to Complete while also keeping an eye on the debugger. It did perform the action a little faster than what it took the debugger to display the new saved data, but it's still taking around 30 seconds or something like that:(

  • I'm using the debugging preview to check on the time. I go to localstorage object and check on the keys, and there I see how long it takes to save. Is this a reliable method to do so?

  • I added the triggered once condition as a sub-event to the game over events like this:

    But nothing changes. It saves, but unfortunately still takes a long time.

  • Thanks for your answer, Bartalluyn.

    The every tick saving was actually a desperate attempt from me to make the game save faster to localstorage, but it was unsuccessful. I just did a test in which I toggled that disabled, and left the saving to trigger when the user lost, meaning the game over menu is displayed (which can be seen here:

    It still takes a long while to save.

    It's interesting because the global variables do change immediately, so this is definitely a problem regarding either when the saving is triggered or simply that the saving takes that long by default (which I hope is not the case).

  • It seems I missed the first image. I can't edit my post so I will add it here.

  • Thanks for your reply, Maverick.

    The following screenshots are specifically for the lifetime score variable, which simply is the sum of all the scores the player has ever had ever.

    I started with a specific Event Sheet for the saving, which I included in the playing level layouts, as shown below.

    As I at first thought it was outright not saving anything, I also added it specifically in the levels, when the game over menu is displayed, right after the score has been added to the lifetime score, as shown below.

    As I mentioned before, all of the global variables work and the localstorage does ultimately save, but it takes too long doing so.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. I'm a rather new user of Construct, and only recently even discovered localstorage. I'm making a simple game that requires to save some statistics, including high scores after every time the user plays.

    When trying the debug feature, I can see the stats do save to localstorage, but they take some time, sometimes up to a minute, which tells me that at least the saving part of my code works. However, since this is for a phone game, users won't wait a whole minute for the game to save before closing the app.

    I wanted to know if localstorage usually takes this long to save data, or if you've had similar experiences with this.

    Thank you!

lp96's avatar

lp96

Member since 10 Jun, 2020

None one is following lp96 yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies