Families, Private Variables, Attributes

This forum is currently in read-only mode.
  • Hi, I am trying to use families a little bit, and I am a little confused with the information I have found. Basically, I just want to know how family private variables work, and what differentiates families from attributes.

    I've read that all family members have to have the same private variables... but is that only if I'm trying to change a variable on family? For example, I have family 'Dog' with variable 'Legs'. The two members of this family are 'Lab' and 'Bulldog'. Each of them has the 'Legs' variable because they are both members of the family... but I want to add a unique variable to both 'Lab' and 'Bulldog'; let's say 'Lab' has a variable 'Snout' and 'Bulldog' has a variable 'Tail'.

    Now, will the family have problems with this? Obviously I cannot try to change variable 'Tail' in an event for the family because not every member of the family has that variable, but that's fine with me.

    Next, from what I understand, Attributes differ from families only in that we cannot perform a large number of events on Attributes, correct? And I guess that families all have to be the same type of object (Sprite, Tile, etc), while Attributes don't?

    Finally, along with my first question to an extent... can an object have multiple families? It would be pointless if each family had to have the same private variables, because then they would all pretty much be the same... right? Could I have family 'Animal', and then in that family I have family 'Dogs' and family 'Birds'... and then within each of those families can I have multiple objects? Such as types of dogs and types of birds? Basically, can I build this structure so I can select EVERY animal, or just every bird, or just a specific bird, or a specific dog, etc? Will families work like this?

    Thanks for any input!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as I'm aware of, there shouldn't be a problem using unique pv as well as family pv.

    Attributes are more like states, as you can set them on or off. But you can use them in whatever number of events you want. (I'm not quite sure if I understood your question correctly)

    Objects can be members of more than one family. If you use a family with an event, you always pick that members of the family that match to the condition, so you are free to pick just one member or a whole family, based on the conditon. If you would set a pv for all members of a family to 1 and later test against that value, you would pick all members of that family.

    But I'm sure there are more advanced users who can answer more specific.

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