How do I [Set Text to Array Data]

Get help using Construct 2

Post » Sat Apr 01, 2017 6:23 pm

I am trying to set text to array data i have looked at other similar posts but none of the information in them helped me with my problem,

I am adding data to an array, X is being the name if the item and Y is being the quantity of the item.

I want it to display as
First item: First item amount
Second Item: Second Item Amount

For each xy element : Set text to Array.Curvalue just gives me the the amount of the first item and not the rest

Any help would be greatly appreciated, Thanks :)
B
3
Posts: 6
Reputation: 187

Post » Sat Apr 01, 2017 6:48 pm

For each X: Set text to "array.at(array.curx,0)& array.at(array.curx,1)"
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Sat Apr 01, 2017 6:53 pm

Hey man, thanks for the quick reply

This works for the first item i add to the array but does not add the 2nd line in when i add another X to the array
B
3
Posts: 6
Reputation: 187

Post » Sat Apr 01, 2017 6:58 pm

ah i see how that works now
i have it working with 2 items like this

For each X element : Set text to Array.At(0,0)&Array.At(0,1)&newline&Array.At(1,0)&Array.At(1,1)

Is there a way i can set this on a loop or something so it will only show whats there, as right now this way it shows [ 00 ] for the item(s) that are yet to be added

Thanks :)
B
3
Posts: 6
Reputation: 187

Post » Sat Apr 01, 2017 7:50 pm

Yes, you can use the text append action for utilization in a loop, where you use loopindex in place of your array.at y value.

Edit: with the condition that the current value is not 0.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo, Exabot [Bot] and 30 guests