Resetting one of different Global Variables

0 favourites
  • 6 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:

    Do you know if it's possible to reset just one of different Global Variables?

    For example, in a platform game: you have Lives and Collectibles in the levels. Both are Persistent objects with Global Variables. After the player dies, you have to Reset the Lifes but not the Collectibles, as once it's taken it doesn´t have to appear anymore.

    Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ofris - yes, you have complete control over Global variables. You can always use the System->Set Value action.

  • Hi Manley23:

    Thank you for your answer. I can´t solve it with System-> Set Value action. Do you know if I can apply System -> Reset global variables to just one Global Variable?

  • Ofris - I don't think the global reset action is just for one variable. But, can you explain further why you can't just Set Value on the Lives to change it back to 3 or whatever but keep the Collectibles value the same so it works?

  • Hi!

    I can Set Value on Lives so the Player always Starts with 3 Lives after Game Over.

    But as the Life item (which adds +1 to Life Global Variable when the Players touch it) is Persistent, when the Player starts a new Game the Life items won´t appear. That is why I need to keep the Life item Persistent but reset it each time you start a new game. Maybe the Reset Variables was not the better solution.

    I don´t want to take you more time


  • Ofris - yeah, I think you almost have it done. Just put in your "Start New Game" code to reset all variables, otherwise only reset the Player Lives on Game Over.

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