array in different layouts

Bugs will be moved here once resolved.

Post » Tue Nov 22, 2011 3:39 pm

im not 100% sure, but im making a leveleditor and everything works in the one layout, also everything works from the editor include in the other layout

the one thing that not seems to work is my array, i put the array as global but no reaction

could there be a bug where you create an array in one layout that the other layouts dont have control over it? im out of debugging methods   

ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Nov 22, 2011 6:29 pm

Im guessing your problem has to do with global only meaning that the object will not be destroyed when going from one layout to another. That means at runtime if you have a global object on layout two, but your first layout is layout one, the global object will not be in your project until you go to layout two. It also won't be destroyed if you go back to layout one.Arima2011-11-22 18:30:15
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Tue Nov 22, 2011 7:03 pm

I can confirm what @Arima said. I had the same issue a while back.
Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608

Post » Tue Nov 22, 2011 8:06 pm

the situation is like this:
i first created a "mainlayout" 'game'
then later on i created the array in seperate "editerlayout" 'editor'
i worked everything out, everything works

i included everything in the mainlayout and placed the editor'objects'
this works except the arraycode,   then i made the array from editorlayout global still doesn't work

@arima @wastrel well if thats the case, then you need a seperate array per layout? as i cant put the same array on mainlayout, it wont let me..., well i thought the arrayobject was global to begin with..


vtrix2011-11-22 20:08:24
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Nov 22, 2011 8:18 pm

vtrix, the array isn't created until you activate the layout in which it is defined.

Assuming your initial layout (the one that starts up when you launch the game) is mainlayout, and that the array is defined in the editorlayout, then the array won't exist when you first start the game. It will be only be created once you've activated the editorlayout.

Once you activate the editorlayout, the array will be created, and will exist globally, no matter which layout you activate after that.

The solution is to define the array in the mainlayout, or create an initialize layout that initializes all of your global objects, then automatically switches to the desired initial layout.Wastrel2011-11-22 20:19:30
Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608

Post » Tue Nov 22, 2011 9:06 pm

i see i works!, thankyou for the info!, not sure if there would be a better way of doing this, like if you make it global you can access the object in every layout or something... but anyway i can continue
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests