How do I pick several UID instances at the same time

Get help using Construct 2

Post » Wed Apr 30, 2014 6:33 pm

@RenatoB
regarding multi uid select
reading up on expression the OR expression adds to selection

pick sprite by evaluate
Sprite.UID= 1 | Sprite.UID= 2 | Sprite.UID= 3 do something works..
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Wed Apr 30, 2014 7:51 pm

Hi @vtrix

Actually I need to use AND instead of OR because all instances must be in the same frame to proceed. I cannot understand why the "pick by evaluate" does not accept AND (&&).

Thanks anyway.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Wed Apr 30, 2014 9:21 pm

@RenatoB, thats exactly what it does it picks all the instance in the same event that are evaluated in the expression
the same what you want to achieve with the && (i think c2 only uses &, even for expressions)

maybe an example showing you is more clear
https://dl.dropboxusercontent.com/u/61666915/multipick_UID.capx

i got the idea from this paragraph in "Guide to Construct 2's advanced event features"
Note how in ordinary 'AND' blocks, subsequent conditions filter out instances not meeting the event - progressively reducing the number of picked instances. In contrast, 'OR' blocks add instances meeting the event - progressively increasing the number of picked instances.


working directly with "or" blocks wouldn't work, but by using the evaluate it does..
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Thu May 01, 2014 12:08 am

@vtrix

Thanks for continuing to try to help me.

It really works this way that you built in your example. I had already tested this way. But it is not work for my purpose or maybe I'm doing something wrong. I used your file to simulate part of my project. Suddenly you can see something I'm not seeing.

https://www.dropbox.com/s/ihabm5603qhbv ... anged.capx

In this example, the correct would be to click on the 03 instances that the word "OK" to appear in the yellow box. But you simply click on one of the three instances that the word appears.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Thu May 01, 2014 12:16 am

In this case you can add the extra condition: Sprite.PickedCount = 3. This tells you that there are three items picked, that match the criteria.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Thu May 01, 2014 2:19 am

To make it exclusive, pick all with frame=1, then check that only the ones your care about match in count.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Thu May 01, 2014 10:55 am

Thanks @blackhornet. It really works.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Previous

Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, tarek2 and 24 guests