Feature Request :: On For Loop Completed.

0 favourites
  • 5 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • SO I have this Ajax Call that when the onComplete is called, executes a loop.

    We are able to give a loop a name and I think that is great for loop index and all but I want to execute another series of events after that particular loop is over, is there a way to implement "On Loop Complete (Specifiy Loop Name)" inside Construct 2 ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A loop is done when it's called, so the next tier event is effectively your oncomplete.

    The system ignores everything else other than a function during that time.

  • I'm not sure it's work that way, but I use the "Else" event after a loop for doing actions that requires the loop to finish first.

  • Any top level sub event will do.

    As long as it's in the same event.

    The "add blank sub event" works nice here.

    Knowing that the "on loop completed" needs to be called every time.

  • If you know how big the loop is you can just do a compare 2 values, and check if you are on the last iteration of the loop.

    if loopindex=10 then whatever....

    Also C2 reads things sequentially. If you stack one loop on top of another loop, it will execute the top loop before the bottom loop. So you really don't need to know when it is done, the next condition will not execute until it is done. Most of the time you can stack them together.

    If you are using a function you can also use the return value thing to flag when things happen.

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