Create Family Object with Multiple Instances

Get help using Construct 2

Post » Sat Feb 02, 2013 1:08 pm

I don't think You can.
one of the solution would be to specify somewhere all attributes for variables

Family1.id = 1 - > set Color = "blue"
                   set PosX = "123"
                   set PosY = "321"

Family1.id = 2 - > set Color = "red"
                   set PosX = "567"
                   set PosY = "765"
...
That way family objects with corresponding id number will always have this values.

I'm not at home at the moment so I can't check for other possibilities.
ImageImageImageImage
B
155
S
63
G
41
Posts: 2,587
Reputation: 34,464

Post » Sat Feb 02, 2013 1:17 pm

You could make objects in other layouts global and hide them from layouts they are not needed in. I suggest that you find other approach to the problem though (saving in array, passing variables when changing layout for example)
B
24
S
9
G
7
Posts: 756
Reputation: 7,292

Post » Sat Feb 02, 2013 1:26 pm

I think the instance variables are all set to 0 when the object is spawned and that's why all spawn on the same spot and with the same color ...

I could be wrong ...

Try positionning them out of the layout , and just moving them
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Sat Feb 02, 2013 1:27 pm

[QUOTE=Whiteclaws] I think the instance variables are all set to 0 when the object is spawned and that's why all spawn on the same spot and with the same color ...

I could be wrong ...

Try positionning them out of the layout , and just moving them[/QUOTE]

That is correct.

ImageImageImageImage
B
155
S
63
G
41
Posts: 2,587
Reputation: 34,464

Post » Sat Feb 02, 2013 1:41 pm

[QUOTE=Whiteclaws] I think the instance variables are all set to 0 when the object is spawned and that's why all spawn on the same spot and with the same color ...

I could be wrong ...

Try positionning them out of the layout , and just moving them[/QUOTE]

Instance id is not unique to an object, it is just an index to selected objects :-) So if picked objects change you cannot use same iid to reference the object anymore.vee412013-02-02 13:41:54
B
24
S
9
G
7
Posts: 756
Reputation: 7,292

Post » Sat Feb 02, 2013 11:57 pm

I've read all your posts, so i guess the conclussion is C2 has no way to pick instances from another layout, it was impossible.

So the workaround to create objects with manual values, it could work and repeat events.

Thanks!
B
96
S
34
G
29
Posts: 3,138
Reputation: 28,234

Previous

Return to How do I....?

Who is online

Users browsing this forum: bclikesyou, imhotep22 and 13 guests