How do I sum all instances matching another instance?

Get help using Construct 2

Post » Wed Apr 19, 2017 10:21 am

Hi!

I have a family with many objects with four family instance variables. The first one (string) is the type of this object (for example "Enemy1", "Enemy2", etc.) and the other ones are values (for example "Health","Attack", etc.).

What I want is to sum all these number instance variables for each type of object (for example, health of all Enemy1s toghether, and then attack of all Enemy2s toghether, etc.).
B
21
S
7
G
1
Posts: 164
Reputation: 1,910

Post » Wed Apr 19, 2017 10:35 am

For each lets you use a family and not just objects so just use that.
Image
B
17
S
6
G
1
Posts: 41
Reputation: 1,725

Post » Wed Apr 19, 2017 10:42 am

Yes, I know. But as every object had many instances, I had to use an Array.
Anyway, now it's solved, thank you :) @Maukka
B
21
S
7
G
1
Posts: 164
Reputation: 1,910


Return to How do I....?

Who is online

Users browsing this forum: Syazanie Amirin and 43 guests