How do I override a saved value?

0 favourites
  • 3 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • Hi!

    I have published my game in the Play store. I'm using the "save game" feature to store the game state between plays. The problem is that I have a global variable called "readyLevels" that indicates how many levels I have finished for the game. I set that to 10 when there was only 10 levels in the game. Now I have created more levels, but I can't seem to push a new variable value through because the load feature always restores the "readyLevels" variable back to 10.

    I tried to create a new object, give it the "no save" behavior and give it an instance variable for the amount of ready levels that I have made. Then I load the saved game and "on load complete" I'm attempting to override the global variable with the value from the "no save" object's instance variable. For some reason this doesn't seem to be working though.

    What would be a good way for overriding a single global variable value when using the "save game" feature in Construct?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the trick with a new object with NoSave behavior should work. Have you checked in Debug Mode what's happening with this object?

    Another option is to create a new variable to replace the old "readyLevels", and set it as Constant. Constant variable will not be restored from the saved game.

  • Oh love the constant suggestion! Thanks!

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