Retrieve next value in array

Get help using Construct 2

Post » Tue May 07, 2013 10:36 pm

It shouldn't be this hard and the documentation in the manual is frustrating.

On System, start of layout, declaring array, set value at 0 to "apples", set value at 1 to "pears", set value at 2 to "rabbits"

On System, start of layout, declare text box, set text value to declaredArray.At(0)

Touch, on any touched end, declare text box, set text value to declaredArray.CurX+1

and nothing. just changes it from the text value of apples, to 1.

what am i doing wrong?
B
5
Posts: 11
Reputation: 697

Post » Tue May 07, 2013 11:02 pm



Example of the event sheet

Further info - All I'm trying to achieve is continue to the next X value in the array. Is there anything along the lines of a ++ operator in construct? baschit2013-05-07 23:22:38
B
5
Posts: 11
Reputation: 697

Post » Wed May 08, 2013 1:13 am

CurX only applies inside a for each loop. Use a variable instead.

currentPosition = 0

Set text to enemyNames.At(currentPosition)
Add 1 to currentPosition
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Wed May 08, 2013 1:56 am

I love you. Thank you.
B
5
Posts: 11
Reputation: 697


Return to How do I....?

Who is online

Users browsing this forum: HeinRich, Zakeru and 24 guests