array in different layouts

From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • 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   <img src="smileys/smiley5.gif" border="0" align="middle" />

  • 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.

  • I can confirm what Arima said. I had the same issue a while back.

  • 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..

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)