Reversed order of the for loop and custom step

Get help using Construct 2

Post » Fri Oct 26, 2012 2:42 pm

Hello fellas,

Of course it is easily doable with the "while loop + variable", but

right now it's not possible to iterate a "for loop" in the reversed order (like from 10 to 1). Could this feature be implemented? It would be also helpful to define an iteration step (like 3 instead of 1 ) with a variable value.

Cheers

   xoros2012-10-26 14:44:31
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Sat Oct 27, 2012 2:25 am

Couldn't you just alter the loopindex where it's needed?

loopindex*3 to change step to 3

and 10-loopindex to go from 10 to 1?
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Oct 27, 2012 12:39 pm

Thanks man, you opened my eyes at LOOPINDEX - never considered it from this perspective.

But in spite of this good solution, it still would be great to have this options in the for loop - I think logic will be less error-prone.     
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Sat Oct 27, 2012 2:19 pm

It could be useful, yeah.. after all, it does let you set the start number which saves you from doing number+loopindex.. so why not more options?

Have you worked out what you needed, or still getting an error?

B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Oct 27, 2012 9:16 pm

Yeps, your suggestions work well.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 29 guests