Families & IID's?

Get help using Construct 2

Post » Sun Mar 08, 2015 12:11 am

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!
Last edited by xeed on Sun Mar 08, 2015 12:39 am, edited 2 times in total.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Mar 08, 2015 12:30 am

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.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Sun Mar 08, 2015 12:35 am

Thank you for the reply.

I can't confirm that. For example, Family(IID).width does only work on objects generated during runtime.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Mar 08, 2015 1:36 am

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.
You do not have the required permissions to view the files attached to this post.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Sun Mar 08, 2015 4:56 am

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.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: Cryttexx, imhotep22, makkancs, RXIIIGAMES, SnipG and 12 guests