How to make Global Variable?

0 favourites
  • 5 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.
  • Hi

    There's a Global.Var in "Layout_A" that every second, "1" is added to it.So for example if I wait for 60 seconds,the variable will show 60.

    Now I save the game,go to "Layout_B" and wait there for 10 seconds.

    Again I load it so that it loads "Layout_A" but the variable still shows 60 when it has to show 70 (The variable isn't added anymore when I'm in Layout_B)

    What should I do?

    PS:there's two different eventsheets and addind 1 to var every second is programmed for both of them

  • When you said load it do you mean load the save game? Other than this it's hard to work out unless we see the event sheets. Even if layout B is only linked to the first event sheet it should still add 1 every second I guess.

  • ●Yes,i meant load the saved game.

    ●If Layout A and B were attached to the same event sheet , it was ok but the problem is that they have their special event sheets.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well unless I've missed something, loading the save game will load it at the point you saved so the variable will be 60, doesn't matter what you do after the save if you are loading it later.

  • You might try just running a second variable that triggers between switching layers and the load time of the save file. Then add that time to your saved and let it continue as normal. There is also the no-save behavior if you used a global sprite as a "place-holder" to accomplish the same thing.

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