Getting object subset count without picking?

Get help using Construct 2

Post » Fri Oct 18, 2013 10:59 pm

Is there way to get the count of a certain subset of instances without picking them?

Like, if I wanted to get the number of sprites with instance variable x set to y to use that number in a comparison, could I do it without actually picking the instances and using PickedCount?
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Sat Oct 19, 2013 12:11 am

What's wrong with picking them?
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Sat Oct 19, 2013 2:53 am

In this particular case, the point at which I'd like to check is after a relatively complex pick of the same instance type, so it would be convenient to be able to do so.
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Sat Oct 19, 2013 8:21 am

You can pick things separately in sub event, your higher level picked objects will stay intact. Do something like this:

variable: count
.. complex stuff picking here
.... pick all stuff
.... pick stuff you want to count
.... set count as stuff.pickedcount
.. do things with before mentioned complex picked stuff
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Sat Oct 19, 2013 2:04 pm

Or make a function that returns the count.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests