How do I clear everything including arrays?

0 favourites
  • 3 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • Before I spend an hour researching to figure out the answer is no, it's not possible...

    Anyone know if there is a way to clear every bit of stored information in one command?

    I'm guessing it's a manual process of dumping arrays (plus an additional 1 command to clear all local storage).

    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
  • I don't know of a single command to clear everything but, maybe this information can help you cut down your events.

    Since you are specifically asking about arrays, one thing to remember is, arrays are marked global by default. This means the information in them persists between layouts. If you are trying to reset these values at the beginning of a layout, just uncheck the global parameter for your arrays. If they aren't marked global, they won't persist between layouts and will be reset when starting the next layout.

    If you aren't specifically trying to reset arrays on start of each layout, but are instead just resetting them arbitrarily, you could add them to a family and call the families clear action, instead of clearing each array individually.

    Variables are similar. Like arrays, if you are trying to reset these values on start of layout, don't use a global variable. Local or instance variables all reset on start of layout without having to use an action.

    Of course, if you aren't reseting on start of layout and you NEED to use/reset global variables, the system has a Reset Global Variables action that will reset all global variables to their initial value. This resets ALL global variables though so you need to make sure there are no variables you need to persist.

    For Objects, the system has a Reset Persisted Objects action that will reset all items marked as persisted to their initial values.

    These suggestions can reduce your actions quite a bit.

  • Thanks for the reply. I ended up just make a huge function and had it clear everything.

    It's for a logout/login/new account setups thing. Big ole pain in the rump, but done.

    Thanks again.

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