Save a variable even when I close and reopen the game

  • The problem is that you said you wanted a way of saving instance variables and I recommended that link. What you should be doing is saving that unlock information as a global variable, local storage is what you should be using for this. If it's not working properly with other global variables then it's a logic error, possibly you are loading the key items to global variables then resetting their values afterwards.

  • The problem is that you said you wanted a way of saving instance variables and I recommended that link. What you should be doing is saving that unlock information as a global variable, local storage is what you should be using for this. If it's not working properly with other global variables then it's a logic error, possibly you are loading the key items to global variables then resetting their values afterwards.

    May it be a problem related to this ??

    "Note that most browsers have a limit on how much data a web page can save to disk.... Appropriate use of the No Save behavior can also help make savegames smaller (see below)."

    in fact, even if I export game to nw.js is still based on the chromium browser right?

    in my project I did not use "No Save behavior" on objects and the project capx is 130MBytes, (90MB of videos)..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No idea about that but you don't need to use that save state now that you've explained what you're trying to save. To check whether time attack mode is available you just need local storage and a key. To toggle whether it is available use a global variable instead of an instance variable.

  • No idea about that but you don't need to use that save state now that you've explained what you're trying to save. To check whether time attack mode is available you just need local storage and a key. To toggle whether it is available use a global variable instead of an instance variable.

    ok done it, now is working fine.

    anyway nonsense problem with reset global variables one by one to avoid "reset global variable" because "reset global variable" fortunately DON'T touch key stored values

    So I could safely enter key value e reload them at the appropriate moment

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