Making clear how Families work because of issues

This forum is currently in read-only mode.
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Okay, I've used Construct for quite some time now, and I haven't ever been able to use Families without variable consistency errors, and yet it seems like other people are able to use them just fine. My problem is that it seems like when I change or reference variables pertaining to a family an object is in, things can go haywire where the wrong variables are called for (at least that's how I remember it, and how it seemed).

    I read this in the Wiki about families:

    "Note that adding a new object to a family with common private variables, effects or behaviors will invalidate all existing events using them, if it does not have the same common variables etc. To ensure consistency between objects, the family manager should be used to add and remove objects from families."

    I might be dumb for not being able to wrap my head around it, but it sounds like there's some sort of situation where events are invalidated. I'm trying to understand if what it says is that if I have BlueFamily and Guy is part of it, and BlueFamily is assigned variable 'butt', I can't change 'butt' in an event where I just reference Guy. Because that kind of would make my problems make sense, but sort of invalidate the use of Families for me.

    I think I'm wrong though, I just want to clear up why I always get strange conflicts and have to stop using Families, which is making me create some inefficient code as replacement. Is it just a matter of being really careful to always use "Manage Families" when doing anything whatsoever to do with them?

    Either way there's a problem, or something I don't understand about Families. Help!

  • I haven't had any problems like that. It didn't make heavy use of families, but I recently posted an example .cap that used a family so that I could pick two different instances of the same object, and it referenced private variables, here: http://www.scirra.com/forum/viewtopic.php?f=16&t=7028. I've used families for other things with no problems, as well. I did have one project that had a different problem that I never figured out, which used families, though. This was several builds of Construct ago...

    [quote:24k7cs23]I read this in the Wiki about families:

    "Note that adding a new object to a family with common private variables, effects or behaviors will invalidate all existing events using them, if it does not have the same common variables etc. To ensure consistency between objects, the family manager should be used to add and remove objects from families."

    I think that this means that if you manually add a new object to a family in the layout editor, without using the family manager, and it doesn't have the common variables that the other objects have, that Construct will likely not work correctly in regards to that family. This would be understandable, if so.

    As I recall, if you use the family manager to do so, it will take steps to ensure that the new object has the common attributes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have found bugs related to the post by the OP.

    Adding variables to families sometimes yields strange results... such as the family NOT having the variable applied, but the objects inside the family having the variable.

    The only thing you can really do in a situation like this is remove all variables from the objects individually, and use the family manager to add the new variables using the family manager only.

    I have reported the problem to Ashley... it seems the way variables is applied is a bit weird (according to Davo).

    I guess a lot of people haven't come across this issue, since it seems to be OK most of the time. I only came across it for the first time ever about 3-4 days ago. I think you have to be pretty unlucky to end up with this problem, but alas... "pretty unlucky" is my middle name.

    ~Sol

  • [quote:3kgzlk6o]I think that this means that if you manually add a new object to a family in the layout editor, without using the family manager, and it doesn't have the common variables that the other objects have, that Construct will likely not work correctly in regards to that family. This would be understandable, if so.

    Not really understandable if you actually CAN add objects through the Layout editor, it's like an evil trick!

  • I've come across it often enough that I don't use families at all. I hadn't read the thing about the family manager,but for me, anytime I add anything to a family member after its already in a family, everything goes completely messed up and unusable. Not just private variables either, behaviors, too. I can never anticipate everything ill need when I start out, so I avoid using families at all, since it almost always ends in disaster. Ill have to look into this family manager though, I thought it wad just there for convenience

  • i usually dont have trouble with families except for the odd time or two.

    adding variables is pretty intuitive for the most part, and if you somehow mistakenly add a variable to an object alone or it goes into the wrong family, you CAN just add a variable with the same name to the family and the variable will automatically be replaced with the family counterpart

    ive never had any irreversible bugs with families though and if your worried by it, you can just save before you try to do something you havent done before and revert if something messes up.

    by all means you should use them if your constantly rewriting events for different objects.

  • But even when you use the layout editor to add the family doesn't it usually prompt you to add the variables to the object?

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