Families & IID's?

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hi,

    using the Debugger (still) shows all pre-set instances of a family with IID 0.

    The problem is, that the instance creation of Family Objects during runtime makes the Layout Designer (c2 GUI) useless. Most levels are designed through c2 GUI directly. But these objects can't be accessed the same conditions during runtime if dragged right in the GUI, especially for family or container instances.

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • IID is calculated per object, not per family, So, if I understand correctly, you can have multiple instances in a family with the same IID. I just tested, and confirmed that when looking in the debugger by family, only the first instance of an object has the IID 0.

    If I understand correctly, You can still use the system action "pick by nth instance", and it will work for families. It should be possible to use this to set up an instance variable for Family Instance ID.

    I apologize if I have misunderstood.

  • Thank you for the reply.

    I can't confirm that. For example, Family(IID).width does only work on objects generated during runtime.

  • I'm still not quite sure what you are seeing, or what you are expecting. I put together a capx as an example.

    I two objects in a family. Each displays it's own IID. When the layout starts up, both objects have IID 0, because they are the first object of their type, even though one is the second object in the family. More objects are created with left and right click, and the IID is always the next highest number for that object. I also set up something to cycle through and pick everything in the family in order, and it does this correctly, despite the fact that there are two separate IID sequences in the Family. If you were to add a third object type to the family, it would also start counting it's IID from 0.

  • [quote:30euxzz6]Each displays it's own IID. When the layout starts up, both objects have IID 0,

    Thats the problem. I need to access them through family(iid).value, not family.object(iid).value - I dont need families for this expression object(iid).value.

    Where is the sense of a family.IID value when each object types inside are seperated in a different order?

    And again, it works for DIFFERENT objects created during runtime. Then the order is done for all family objects... no matter what type of.

    I see the problem in creation of new family members... which is also random.

    Maybe the Scirra team can get an answer how to fix this without extra instance variables.

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