Containers and Families

0 favourites
  • 2 posts
  • Containers and Families don't mix reference associated instances.

    Lets say you have 2 objects and 2 families

    If hitbox overlaps Attack

    destroy movebox

    This works as intended with Containers and instancing.

    if overlaps attack


    This works as intended, destroying only that one instance.

    if overlaps attack


    This destroys every instance. It should hopefully recognize the associated instances of the family objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Thndr, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    You might be able to solve this by using "Families" to escape the reciprocal picking that happens with containers.

    Manual > Families:


    Place the person into a family named "Damageable".


    Hitbox is attacking. // Selects all attacking Hitbox objects.

    For each hitbox.


    Hitbox is overlapping Damageable family

    Pseron.UID does NOT equal Damageable.UID // Prevents the Hitbox from attacking the Person who owns it.


    Damage Damageable. // Deals damage to all Persons overlapping the Hitbox who are not the Hitbox owner.

    Note the sub event condition that includes Person.UID.

    Here we are assuming that the Hitbox's Person is selected because they are both in the same container, and we're also hoping that won't influence the selected objects in the Damageable family, and it shouldn't, BUT...

    If you want to be absolutely sure that the containers aren't involved, and thus can't get up to any of their containerly shenanigans, then instead of getting Person.UID from the Person implicitly selected along with the Hitbox, you can store the Person UID directly in the corresponding Hitbox when the Hitbox is created.


    Hitbox, On created:


    Set Hitbox private variable "parentPersonUID" to Person.UID.

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