0 Favourites

Loopindex aways return 0 when have wait action in the loop

  • Problem Description

    According with the manual on How to use wait action, i can add the wait funcion inside loops with time*loopindex. This works fine with simple loops, but when i have other loop inside, it don't works as expected. I don't know if this is really a bug or if there is a trick that i doesn't know.

    Attach a Capx

    Description of Capx

    In this capx i added two buttons that should fill the tilemap. The first, without wait, works fine. The second, with wait, should fill the tilemap with 0.5 seconds of interval between the coluns, but it only fills the first column.

    Steps to Reproduce Bug

    • Click on the the 'without wait button to see that it only fills the first column

    Observed Result

    it only fills the first column

    Expected Result

    Should fill the tilemap with 0.5 seconds of interval between the coluns.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 8.1

    Construct 2 Version ID

    212.2

  • Hey Ashley,

    Just figured out that the problem occurs with simple loops too. It seens that the issue is that when the wait action is added in the loop, the loopindex expressions aways return 0.

    I uploaded another capx that shows the issue:

    This is basically the same capx, but with just a simple loop and a text object instead of the tilemap, that appends the loopindex of the loop.

  • Just changed the title of the topic to better explaim the issue.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Closing as by design. By the time the wait timeout expires, the loop has finished! If it worked like you wanted, the entire game would hang whenever you used "Wait", making the feature useless.

  • Ok, understood. But I still need that the loop runs with a delay for each loop. There is a solution or its impossible?

  • Hey, i just managed to get my looping working thanks to the plugins Event Balancer and Loop Iterator from rexrainbow.

    Actually i was triyng to add wait in the loops to improve the performance, since my game have heavy level loading.

    Thanks rexrainbow for the amazing plugins!

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