[R104] Layouts not duplicating arrays

Bugs will be moved here once resolved.

Post » Sat Oct 06, 2012 7:55 pm

I'm not sure how to upload a demo of this, so I'll do my best to explain.

1) Create a new project
2) Add a sprite and an array to the layout
3) Duplicate the layout.

If you now compare the two layout XML files you will notice that the sprite was copied fine, but the array is missing in the '<nonworld-instances>' section.

Side bug: If you have two pre-existing layouts and you add an array to your game, it is only added to the layout tab you have open (so you can have both layers open, but only the active one will get the array).

If I manually copy the array XML to my new layer everything works fine.
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Sat Oct 06, 2012 10:28 pm

Array is global by default, meaning it only needs to be on one layout. If it's on a second layout, you will silently end up with two instances, which could become very confusing. Are you sure you want this?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sat Oct 06, 2012 11:12 pm

Bah, I think I found what it was. Construct simply wasn't regenerating the XML file. Turns out, after duplicating layouts, you have be sure to save the project before you run it so it can recreate the XML. All other changes seem to be able to run directly without saving first. I think the whole array thing was just a red herring.

Yep.

Sorry Ashley, I was sure this was a bug...

B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Sun Oct 07, 2012 2:40 pm

Yeah, nothing is actually written to disk until you press 'Save'.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to Closed bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests