Globals and Savegames

0 favourites
  • 4 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hey everyone,

    I just started messing with save and loading games which seems to be working but it seems like it resets Global values. So say I have a loader layout, a main layout and a menu layout. On the main layout is where all the global variables are being set as their defaults. In the menu layout you can click Save game. On the loader layout, once its loaded you can click the Load game button which loads the save and puts you in the menu layout. Once it does that, I navigate back to the Main layout and all the globals seem to be set back to their defaults. (This is after closing the browser window and reopening after saving).

    So do the Globals reset to default no matter what when you navigate to the layout that uses the sheet even if you loaded from a save game after closing the window and coming back?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Depends if you have made it so to assign values to those variables in your main/menu layout.

    Provide your capx, it will be simpler to spot where things might go wring and provide efficient help.

  • How do you set your variables on main layout?

    for example if you do something like this

    +Start of layout -> var 1 set to 1

                        var 2 set to 1

                        var 3 set to 1

    They will always set to these values every time you visit that layout - no matter if you save them or not.

    I haven't seen your capx but I think thats your issue.

  • Thanks for the replies I think I got it now. I had the globals on the main layout and it seems like, if you load a game and go to a layout that has default 0s or whatever those get set again. So I just made a new layout that has a sheet just for the globals and when you do a new game it will reset those and any time after that you never go to that layout that resets them. It works, thanks guys :)

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