How do I use Get Item with Local Storage?

0 favourites
  • 7 posts
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • I'm using the save feature for saving the whole game, but there are some aspects that I would like to override, and for that I'm using Local Storage (being control settings, unlocks, etc.).

    I'm trying to use get item for 3 individual keys simultaneously, but it seems only 1 loads correctly. If I disable 2 of them, then the 3rd will load correctly (no matter what the selection is), but if all 3 are enabled seemingly only 1 of them gets loaded.

    Am I using it wrong? Can I not use it this way? I want to basically be able to save the options.asjson (dictionary), an unlock.asjson (dictionary), and loadable.asjson (check if you can continue from a saved game), so it wouldn't make sense to group these all into 1 dictionary.

    Thanks in advance...

  • Are you using it wrong? Show us how you're using it, let's see the event sheet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I wonder if "on item exists" is a trigger and can only be triggered once per tick, and all 3 are being triggered simultaneously?

  • You're probably racing them so localstorage.itemvalue is not what it should be when you grab it. Have you tried ordering them so when the first one is missing or found, check the next one?

  • the reason I know it’s not catching is because to test it I put Browser:Close as the action on each one. Only one of them was triggering. Maybe I’ll try your suggestion and have them done in sequence.

    Still seems strange to me you couldn’t check simultaneously.

  • Great suggestion! It ended up working; incredibly annoying but at least nothing has to be redesigned :)

    Thank you!

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