Push Action inside Array Loop

Get help using Construct 2

Post » Mon May 06, 2013 2:57 am

Its that possible to Push an element in a current and self Array loop and the limits of the Loop increase dynamically without breaking the Loop?
Its kind Recursivity what I want to do.

For example:

Line.Width = 5

For each X Element in Line(Array)
    Push Front 1 on X Axis.

//After the First Loop the Index becomes 2 (considering in this example the beginning is 1) and the Line.Width now Expanded to 6.
// So I want the next Loop considers that the Line.Width is 6 not 5 as the First time the Array looped.

If that is possible, I want to Dynamically Push and Pop values and dont break the loop when a custom Flag or Condition happen!

@Yann
@Kyatric


B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Mon May 06, 2013 5:10 pm

Anyone?
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Mon May 06, 2013 6:54 pm

I just tested it and it does indeed seem that you can do it. But you must do a push back if you want the new value to be selected by the for each, otherwise the same value get picked twice.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Mon May 06, 2013 7:19 pm

Aaa! Thank You @Magistross!
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Mon May 06, 2013 7:32 pm

You could also use "Insert at Array.CurX + 1" to get the newly added value picked next in the for each.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802


Return to How do I....?

Who is online

Users browsing this forum: SpartCrafter, Yahoo [Bot] and 24 guests