pick multiple objects.

Get help using Construct 2

Post » Mon Jul 29, 2013 10:46 pm

I have two Text objects, one is simply a copy and paste of the other. They have two instance variables, myIndex and myValue.

I have set myValue to 0 for both.
I have set myIndex for one to 0, and the other two 1.

So there are two Text objects where myValue = 0.

The problem is how to pick them both.

I have tried many approaches, and all pick the first only.

See this 3 event capx:

https://www.dropbox.com/s/vusdakk5nr7qb09/pickTest.capx

I can obviously use a for each etc, but my interpretation of the manual pages, the ones I have used should select all, not the only the first one.

Any recommendations for a way to pick all objects where some condition is true?nutmix2013-07-29 23:09:37
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Tue Jul 30, 2013 6:36 am

Having a look at it, line 5 is the way to go for what you're tryingemoaeden2013-07-30 06:40:22
Using R243 for all examples
B
68
S
20
G
6
Posts: 378
Reputation: 9,672

Post » Tue Jul 30, 2013 7:00 am

Actually they are all picking the correct objects, but you are only logging the first. You then need to iterate (For each) through the results.
pickTest_BHT.capx
ImageImageImage
B
71
S
20
G
202
Posts: 3,573
Reputation: 114,440

Post » Tue Jul 30, 2013 9:18 am

@blackhornet - interesting, I had no idea you had to iterate through stuff that was picked. Many thanks for clearing this one up for me.

I guess the picker with iterator is the same speed as an iterator with a condition (i.e. my final event), may be the iterator with condition is faster (as I expect the picker will also be an iterator).

B
17
S
6
G
3
Posts: 370
Reputation: 3,942


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, FabianB, lukezero, RoaringPixels and 12 guests