How do I add individual stats in family?

Get help using Construct 2

Post » Mon Jun 19, 2017 5:48 pm

Greetings! ^_^
So, i am not sure if this can be done in an easy way, but here we go. Sample;

Family 1 - 'Mage Enemies'
Member 1: Tiny mage (100 hp)
Member 2: Sorcerer (200 hp)
Member 3: Wizard (250 hp)

And well, they are in the 'mage' family. So when they take damage, can we somehow make it accordingly to their individual HP, or must the entire family have the same HP, that is addding 'Health' string in the 'Mage Enemies' family instance?

'Mage Enemies collision with bullet - Subtract 5 from health' <- i want this to go to individual enemy rather than family.
Is this possible? Or must the entire family have the same HP value?
Thanks
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon Jun 19, 2017 5:57 pm

I assume you added the instance variables on the family. In this case, substract 5 from health does exactly what you need. Instance variables are for each instance of the family, not the whole family.
B
15
S
3
Posts: 62
Reputation: 989

Post » Mon Jun 19, 2017 6:19 pm

WackyToaster wrote:I assume you added the instance variables on the family. In this case, substract 5 from health does exactly what you need. Instance variables are for each instance of the family, not the whole family.


Should i not add the instance 'Health' variable to the family? I do not want all the members of the family to have the same Health.
And if i try to add it individually, it says 'Health variable is already taken!' - due to it being on the family.

EDIT: You got it backwards btw, i want each individual of the family to have their own health.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon Jun 19, 2017 7:31 pm

Yes, you should add the health variable to the family. Then place your mages on the layout and change the health variable to whatever you want for each mage.
B
15
S
3
Posts: 62
Reputation: 989

Post » Mon Jun 19, 2017 8:16 pm

WackyToaster wrote:Yes, you should add the health variable to the family. Then place your mages on the layout and change the health variable to whatever you want for each mage.


Aaaaah i see!! Thanks alot!! Worked perfectly!! ^_^
B
12
S
3
Posts: 164
Reputation: 1,530


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Lancifer, newt and 13 guests