How do I keep new variables when loading a older save?

0 favourites
  • 8 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I've been struggling with this for a while, haven't found a way to do it though.

    I have a shop on a different layout but to go back to the first Layout I use the load action (Since you need to save what was done previously).

    The issue is that I need to save the new variable changes that happen after buying from the shop, which doesn't happen when you load a old save.

    I don't mind using plugins.

    (I do not plan on buying Construct 3).

  • Why do you need to load an old save when returning from the shop? You can save to the same save file after the shop.

  • because i save the game right before going to the shop layout, when you move layouts it resets them.

  • It is not normal to go to a shop then after exiting load a previous save, doesn't make too much sense, but I can't see how your game works or why you would add this. You should be able to go to the shop and back to the game without doing any of this save/load

  • The "Shop" is a different layout, when you change layouts, they reset.

    This is the .capxhttps://www.mediafire.com/file/8mxpst6bcdcoddz/AsteroidGame.capx/file (it's probably pretty messy)

  • Can't really open it as construct 2 and argh plugins, but what is 'they' when you say they reset? A layout can reset without loading a save file, there should be a way to do what you are trying without save/load.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A layout resets when you switch between them(as in, the two layouts I have.)

    The problem is that the players needs to keep its stats and location after leaving the game layout and moving to the store layout (and vice versa).

    I use the load function to load the location and the changes to the game layout, but when I do, the updated variables (the ones you changed after buying things in the store layout) do not save.

  • To resolve the game layout you can use either global variables which are good for player stats as they are preserved between layouts, or you can use persist behaviour on objects which means when you return they keep their variables, position and such. You don't need to save the game then reload it between layouts.

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