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
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

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
8
G
7
Posts: 756
Reputation: 7,192

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
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

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
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

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
8
G
7
Posts: 756
Reputation: 7,192

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
25
G
20
Posts: 3,054
Reputation: 22,642

Previous

Return to How do I....?

Who is online

Users browsing this forum: jeffige, nedzad and 19 guests