How do I count boolean inside a family

Get help using Construct 2

Post » Fri Jan 30, 2015 7:30 pm

Hi,

I have family and everyone in the family has a boolean variable. Each boolean can be true or false during the game... it's changing.

I want to count all the true boolean to be able to end a level when the player reach let's say 3 true boolean variable.

I'm able to count the true boolean with a global variable but i can't figure out how to do this when the player is changing the value of the boolean. I've tried to use trigger once but it doesn't work.

Thanks
B
9
S
3
Posts: 36
Reputation: 1,144

Post » Fri Jan 30, 2015 7:35 pm

Pick all family objects that have the boolean set to true and then use the Family.PickedCount expression to check how many there are.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Fri Jan 30, 2015 8:48 pm

hum.. i'm working on it but i'm doing something wrong... Can you take a look on my capx... it's at the bottom

thanks
You do not have the required permissions to view the files attached to this post.
B
9
S
3
Posts: 36
Reputation: 1,144

Post » Sat Jan 31, 2015 12:00 am

Just like this:

pickedcount.PNG


That will set total_noir to the number of sprites that have that boolean set. I think you have problems in your other events though.
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sat Jan 31, 2015 2:05 pm

yes i do have some weird issues and i want to work on it to try to solve those. If you can, when i'm done with this, could you review it and suggest me better practice to help me to get better. thank you very much for your help
B
9
S
3
Posts: 36
Reputation: 1,144

Post » Sat Jan 31, 2015 4:08 pm

Yeah sure, no problem.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650


Return to How do I....?

Who is online

Users browsing this forum: David181, HellMax, OBLIVION and 48 guests