How do I make an action specific to a row of list boxes

Get help using Construct 2

Post » Sun Feb 21, 2016 8:58 am

Hi,

I have a layout setup that will contain multiple list boxes in a row. Starting on the left you choose your first value (For example Fruit / Veg / Meat) and then this selection will populate the next list along depending on your choice. So if you choose Fruit, the second list in the row will then change to (Apples, Bananas.....)

This then gives you price per unit and you can choose quantity.

I have everything working for a row as I'd like but to make the rule work for multiple rows currently I need to choose "clone object type" past underneath and then copy all my "row1" code and do a replace all for the lists / boxes all the way along. It works but it doesn't seem a very efficient way of doing my app.

I have not done much list / family / UID stuff in C2 so I have been trying to find (with no success) if there is a way I can create a set of rules for a row and then simple copy / past the row underneath. All I could think to relate a list to another is they would have the same .Y coord value.

Any existing tutorials / examples / help would be appreciated =)

A simple example of what I have so far is below:

Image
https://www.dropbox.com/s/wew0qksg21btu ... .capx?dl=0

Thanks,
B
38
S
11
G
1
Posts: 201
Reputation: 4,469

Post » Sun Feb 21, 2016 3:28 pm

something like... List Example.capx ?
Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827

Post » Sun Feb 21, 2016 6:59 pm

Hi @korbaach

Nice example/ Much cleaner than my one! Although if I copy and add a couple more rows all the values change in all the boxes. I am hoping to find a way so that I can have any amount of rows and it changes only that row.

Thanks,
B
38
S
11
G
1
Posts: 201
Reputation: 4,469

Post » Mon Feb 22, 2016 10:55 pm

I can't open your capx because it uses a plugin I don't have installed currently, and I'm lazy about installing plugins.

It sounds just like a picking issue, namely picking two different instances of the same object type. You can find solutions for that elsewhere on the forum. One thing you could do instead is loop through the list objects and save the current selection to a variable so the next one would have a value to compare to.

To have multiple independent rows you could pick by y first then loop over them by x.
https://dl.dropboxusercontent.com/u/542 ... _list.capx
B
91
S
31
G
103
Posts: 5,241
Reputation: 67,768

Post » Wed Feb 24, 2016 7:45 pm

@R0j0hound

Thanks a million! Exactly what I was after. Just need to implement it with my text lists but I'll play around and sort that.

Appreciate the help!
B
38
S
11
G
1
Posts: 201
Reputation: 4,469


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, DuqueKarl, Vinterstille and 2 guests