arrays and the mistery behind them

Get help using Construct 2

Post » Sun Feb 12, 2012 11:07 pm

I would prefer not to since it's an almost finished game, is it ok if I strip everything out leaving just the array logic?
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Sun Feb 12, 2012 11:31 pm

Ok, stripped everything but the array logic, same thing as the one @Kyatric posted, it looks like something bugged and the arrays are not working anymore.. I created another layout and on that I got back the array properties, you may notice that if you create a new one it hasn't got the properties (one included).

Interesting..

here it is: http://dl.dropbox.com/u/1606950/array.capx

If someone manages to fix this can please explain what happened and why?
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Mon Feb 13, 2012 12:07 am

yeah the array aren't in your layout

You have to save you're game as project and go into your layout xml to add the array back in it.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Feb 13, 2012 12:21 am

How this has happened? And what is the syntax for getting the array back into the layout, I looked at the xml but where do I have to put it exactly and what is the syntax for the array object?
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Mon Feb 13, 2012 12:46 am

Create another project and put an array in it, then save it as project and look at how the xml is made.
You then just have to mimic the syntaxe
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Feb 13, 2012 12:56 am

Thank you very much for you help!
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Mon Feb 13, 2012 12:59 am

In bugged.xml add:
[code]line99:    </layers>
    <nonworld-instances>
          <instance type="Array">
            <properties>
               <width>10</width>
               <height>1</height>
               <depth>1</depth>
            </properties>
        </instance>
          <instance type="Array_Positions">
            <properties>
               <width>10</width>
               <height>1</height>
               <depth>1</depth>
            </properties>
        </instance>
     </nonworld-instances>
line116: </c2layout>[/code]

Line 99 is just for you to know you have to add it at the end, between the layers tag and the c2 layout tag.

As for why, as I said in my post above, there's a bug that requires any object type to have an original instance in a layout.
This applies to arrays too, but it is harder to see as they are "nonworld" type of objects, they don't have a displayed instance in any layout.
But still, their layout of creation is also their layout of initialisation.
So if you create an array object on a layout, and later destroy this layout from your project, the array has no original instance anymore, and you can't create another instance (this is by design for nonworld instances I think, like you need only one "Keyboard" for all your project; all should be resolved once the "original instance bug" is fixed, on @Ashley's todo list already).

Also I forgot : the edited capxKyatric2012-02-13 01:00:41
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Feb 13, 2012 1:20 pm

Thank you very much for your help, finally I understand.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Aug 28, 2012 4:06 pm

This thread helped me out too! Thanks, everyone, for your helpful input
B
4
Posts: 6
Reputation: 587

Previous

Return to How do I....?

Who is online

Users browsing this forum: currypuff, makotto, randomly, Walessio and 25 guests