How do I add individual stats in family?

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • 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

  • 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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!! ^_^

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)