What could be clearing my arrays?

Discussion and feedback on Construct 2

Post » Thu Feb 28, 2013 2:56 am

In my first layout I'm setting the values for this array of help-screens. After it's done, I have it print a value to test if it worked alright, which succeeds. If I put that same line print on the next layout, it returns as 0. When I try doing this with an otherwise blank project, it works fine. Ideas?
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Thu Feb 28, 2013 4:48 am

are you sure your array is set to global?
Image
B
42
S
11
G
5
Posts: 269
Reputation: 10,890

Post » Thu Feb 28, 2013 7:28 am

Are you including the event sheet in which the array is populated on the layout in which you're trying to print it?
B
8
S
2
G
3
Posts: 83
Reputation: 2,668

Post » Thu Feb 28, 2013 7:48 am

@danuyos
The arrays are indeed global.

@tanoshimi
I've tried putting the include in other layouts, but it still doesn't work. Even if I totally move it to another layout, and put the exact same call to print as I did the main menu, it still returns zero. It seems as though the Event Sheet that populates only wants to work in one layout, and the arrays refuse to carry over to the others.

I'm pulling my hair out over this thing at this point, cos it isn't making any sense. I must have spent 4 hours trying to figure this thing out today.adagar2013-02-28 07:48:58
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Thu Feb 28, 2013 7:52 am

Time to post your .capx, I think...
B
8
S
2
G
3
Posts: 83
Reputation: 2,668

Post » Thu Feb 28, 2013 2:49 pm

:\ I don't really feel comfortable posting this whole project that we've been working on for months online. I'll try to cut out as much core stuff as I can while keeping the problem intact and come back.
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Thu Feb 28, 2013 3:03 pm

Check the start of layout events in all sheets.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Feb 28, 2013 4:00 pm

Did so. What I did that seemed to fix the problem was taking the array out of its family (deleted the family, deleting all references to it). Going to put it back together in steps to see exactly where things break down.
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Thu Feb 28, 2013 4:03 pm

Confirmed: The only difference between the arrays clearing and not clearing is whether it is inside a family or not. @ashley is there something I'm overlooking?
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Fri Mar 01, 2013 4:19 am

Is the array in a container? Then deleting an object from the container might clear the array?
B
7
Posts: 38
Reputation: 476

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans and 7 guests