Is there any way to avoid WAIT being broken on layout change?

0 favourites
  • 5 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • If I have something happen at the start of the layout, then add in a WAIT 10 seconds command and trigger something else... if I change the layout before those 10 seconds have passed, the event chain breaks.

    Is there a way to stop this from breaking? I mean, I understand that it makes sense the way it is, but on my program, it breaks things.

    Is there a way to make the eventsheet global, somehow? So it runs on its own?

    I can think of ways around this, but they require a massive amount of effort :( Had I thought of this being an issue ahead of time, I would have planned for it... but I'd rather know if there was a quick and easy solution to my issue, before I have to tear everything apart and essentially re-write 200 events :(

    EDIT - In before someone tells me about shared events sheets. This sheet is already shared.

  • There are many ways around this, depends on what your goal is.

    Some options include the timer behavior on a global object or a global variable you can increment.

  • Yeah, this is my time consuming solution, which I'm trying to avoid.

    At the moment my code reads as:

    A > Wait > B > Wait > C Wait > D

    If I manually add in a timer, it'll need to read:

    A > If Var = A & Counter = 0 > B > If Var = B & Counter = 0 > C

    Etc... etc...

    I was hoping there was some way that construct maintained the wait, even between layouts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's always a bad idea to use long running waits like that. You don't have any control - can't pause or cancel the delayed actions.

    I would do this with a global object+Timer, as oosyrag suggested. Another option is to compare system time from the Date plugin.

  • Thanks! I'll either set it up to stop the layout from being changed during those waits, or I'll rework it to get it to work without the waits.

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