How do I make game settings persist to other layouts?

0 favourites
  • 4 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • So I'm making this platformer, and I just got back into fixing my game settings, they're good, my only issue with them is that they don't persist to the next layouts, so, for example, if I set the game's language to be Spanish, it will reset to English in the next layout, and that happens to all settings, except the timer types (the current game settings the player can manipulate are screen luminosity, a hide UI option, game languages, character speed, and the player can opt between two types of timers), strangely, this setting seems to persist on most levels except in the Levels 2 and 3.

    I'm trying to use a local storage to save the settings variables to other layouts, but nothing really seems to happen.

    So far, this is all the code I got, since I haven't been coding a lot today. Am I missing anything important, or is there any incorrect logic? I've only been to Construct for around two years, so I'm a beginner.

    Tagged:

  • Local storage is used to save values between sessions. If you are just switching to another layout, you don't need Local Storage - simply store the values in global variables or in a dictionary.

    The reason your language resets is probably because you change it in "LocalStorage on any item get". So if you are reading other values from LS, like "Speed", it will overwrite the language value.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I was already using global variables, and they still reset. But I'll use a dictionary and see what happens.

  • Well, I was already using global variables, and they still reset.

    They should not reset, unless you have an event that resets them.

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