Loopindex aways return 0 when have wait action in the loop

Bugs will be moved here once resolved.

Post » Mon Sep 14, 2015 4:25 pm

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
http://onduck.com/c2/looping.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
Last edited by Renfd on Fri Sep 18, 2015 2:52 am, edited 1 time in total.
B
73
S
19
G
1
Posts: 107
Reputation: 5,070

Post » Mon Sep 14, 2015 4:38 pm

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: http://onduck.com/c2/looping2.capx

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.
B
73
S
19
G
1
Posts: 107
Reputation: 5,070

Post » Fri Sep 18, 2015 2:53 am

Just changed the title of the topic to better explaim the issue.
B
73
S
19
G
1
Posts: 107
Reputation: 5,070

Post » Fri Sep 18, 2015 1:21 pm

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.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Fri Sep 18, 2015 3:30 pm

Ok, understood. But I still need that the loop runs with a delay for each loop. There is a solution or its impossible?
B
73
S
19
G
1
Posts: 107
Reputation: 5,070

Post » Sat Sep 19, 2015 1:16 am

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!
B
73
S
19
G
1
Posts: 107
Reputation: 5,070


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests