Local Storage stores value, but does not display correctly.

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Unless I'm overlooking something, I'm trying to store a value in local storage for a high score, but although I can see it has been stored while in Debugger mode, when reopening preview, the text box says NaN or 0 regardless of whether I use int(localstorage.ItemValue) or not. I even opened the Construct Local Storage Intermediate Template to find the same result. I've cleared my cache and removed the key as well. Same result.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should always pick up localstorage data to do the whole process:

    - check item exists

    - get item

    - on item get

    A good practice is to load all localstorage values into global variables as the game starts. To avoid always getting access to the localstorage.

    Do not forget to save the new values in storage as well

  • Thank you for replying. Even after doing this exact process I get the same result. If you have a moment to try the Construct Intermediate Template for Local Storage you should see what I mean.

  • Never mind. It was a version issue. I overlooked a fix in r140 that addressed it. Thanks for your time.

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