How do I reset MOST global variables, but not all?

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

    I've got loads of variables, some I want to reset with each load of a layout, and some that I want to be upgradeable, and stay upgraded. Is there a way that I can reset the 15 variables I want reset every layout load, without it resetting the 5 I want left alone?

    I've tried putting them onto seperate event sheets, but it's still resetting them every time.

    I've attached photos to try show what I mean:

    The list that I want to reset during each game

    The list that I never want to reset

    Thanks in advance for any help

    Connor

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quick solution I can think is creating array as replacement for those global variables which need to be reset at once. Not very convenient since it is index based. Or keep the globals but make them refer to an array when assigning value.

  • There are many ways to store values - in a dictionary, JSON, array, in instance variables on some object, in Local Storage.

    I would suggest using a dictionary - copy the variables which you wish to keep to the dictionary. Then reset global variables. Then restore the values from the dictionary.

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