How do I use Loop For and array [Solved]

Get help using Construct 2

Post » Mon May 30, 2016 5:13 pm

Hi everyone i want to know what is the alternative of this code in construct 2


For(i=0;i<array.length;i++) {
array[i]=1;
}

Last edited by MarkeGamer on Mon May 30, 2016 5:39 pm, edited 1 time in total.
B
5
Posts: 27
Reputation: 281

Post » Mon May 30, 2016 5:28 pm

for ""=0 to array.width...>array.set at((loopindex),loopindex)
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Mon May 30, 2016 5:31 pm

system > for

Name = "i"
Start= 0
End = Array.Width - 1 (width = size on X-as)

i = in the expresision loopcounter("i")
element = Array.at(loopcounter("i"))

OR

Array > condtion 'For each element X'

element = Array.CurX used as an expression
or use the condition 'Compare current value'
to know 'i' is not needed
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon May 30, 2016 5:37 pm

granpa wrote:for ""=0 to array.width...>array.set at((loopindex),loopindex)



OMG!!!!! Thankssss bro it worked like a magic 8-) 8-) 8-) 8-) 8-)
B
5
Posts: 27
Reputation: 281

Post » Mon May 30, 2016 5:38 pm

99Instances2Go wrote:system > for

Name = "i"
Start= 0
End = Array.Width - 1 (width = size on X-as)

i = in the expresision loopcounter("i")
element = Array.at(loopcounter("i"))

OR

Array > condtion 'For each element X'

element = Array.CurX used as an expression
or use the condition 'Compare current value'
to know 'i' is not needed



Thanksssss so much 8-) 8-) 8-) 8-) 8-) 8-)
B
5
Posts: 27
Reputation: 281


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests