Global layers: Objects go missing.

0 favourites
  • 14 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Problem Description

    Setting layers to global in the startup layout causes all other objects on all other same-name layers to disappear (editor displays zero objects for the layer in question and runtime will complain about missing instances of objects being referenced). Trying to add new objects to a layout that had objects go missing threw the error message below. Seems to have been a one-off thing, I'm not getting the error message anymore, though layout objects are still missing. Setting the startup layout's layer back to non-global restores the objects in other layouts.

    ---------------------------

    Construct 2 Check failure

    ---------------------------

    Check failure! This is probably a bug:

    Adding instance to layer with wrong layer owner

    Condition: instance->GetLayer() == this

    File: Projects\Layer.cpp

    Line: 109

    Function: void __cdecl Layer::AddInstance(class std::unique_ptr<class WorldInstance,struct std::default_delete<class WorldInstance> > &&,bool)

    Build: release 181 (64-bit) checked

    Component: Construct 2 IDE

    (Last Win32 error: 0)

    You are using a 'checked' release of Construct 2, intended for testing, which causes certain errors to be reported this way. Hit Ctrl+C to copy this messagebox - it's useful information for the developers, so please include it with any bug reports! Click 'Abort' to quit (unsaved data will be lost!),'Retry' to turn off messages for this session and continue, or 'Ignore' to continue normally.

    ---------------------------

    Abort Retry Ignore

    ---------------------------

    Attach a Capx

    https://dl.dropboxusercontent.com/u/705 ... rsBug.capx

    Description of Capx

    Simple capx with two layouts. Layout 1 has 3 layers and so does Layout 2. Layout 2 also have two objects, one on Layer 1 and one on Layer 2.

    Steps to Reproduce Bug

      Set layer 1 or layer 2 on first layout to global. Watch layout 2 objects on same-name layer disappear.

    Observed Result

    Objects disappear/get disabled both in edit-time and in runtime.

    Expected Result

    That objects don't get disabled

    Affected Browsers

    • Chrome: Don't know
    • FireFox: Don't know
    • Internet Explorer: Don't know Node-Webkit: Yes

    Operating System and Service Pack

    Windows 7 Service Pack <at least 1>

    Construct 2 Version ID

    r181

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Updated with capx link

  • I just checked your link... your layers haven't been assigned global.

    Check this capx. it works for me.

    It will jump layout1 to layout2 to layout1 etc ever 3 seconds. I added global to both layouts.

    layout1 - gui

    layout2 gui2

    [attachment=0:2ediy3ch][/attachment:2ediy3ch]

    Edit; this is such a cool feature - going to save countless hours - lol

  • Yeah, but what happens if you try to set one of the local layers to global on Layout 1 with my capx? Do you still see both objects on Layout 2?

  • Yeah, but what happens if you try to set one of the local layers to global on Layout 1 with my capx? Do you still see both objects on Layout 2?

    Performs as expected.

    I changed layer2 to global and added a spritefont saying "I'm Global"

    It performs as expected. Am I missing something?

    [attachment=1:1yo7ss7t][/attachment:1yo7ss7t]

    Edit; Your capx only have 1 sprite on layout two. Must I add the other?

    okay added other sprite(blue) on and I see both.

    [attachment=0:1yo7ss7t][/attachment:1yo7ss7t]

  • and now added 2nd sprite on startup

    [attachment=0:27tnkrvp][/attachment:27tnkrvp]

    Works as expected.

    Did you add the object - sprite to layout2? because you have to do that else you get error.

  • [quote:3feowtcm]Edit; You online have 1 sprite on layout two. Must I add the other?

    Nope. There are supposed to be two there, one greenish-blue and one purple. The green one is on Layer 1 and the purple on Layer 2.

    If you start up the capx and go directly to the Layout 2 tab you should see em both. Then, if you set Layer 1 to global on Layout 1, the green one will vanish from Layout 2. At least that's what happens here.

  • Okay downloaded your original. Don't know how my changed.

    I went layout2, yes both sprites are there.

    On layout1, I set layer1 to global and both sprites stayed. Nothing vanished.

    Everything worked as expected. Interesting bug, Ashley hates these as they can't be reproduced. Maybe he gets same result as you and can trace it.

  • [quote:2k8p4xsd]Ashley hates these as they can't be reproduced.

    I bet! I would too.

    I also get this when shutting down C2 right after following the steps in my previous post:

    ---------------------------

    Construct 2 Check failure

    ---------------------------

    Check failure! This is probably a bug:

    Object texture leak: a texture is still loaded when cleaning up an ObjectTexture, check all textures released properly

    Condition: gl_instances.empty()

    File: Projects\ObjectTexture.cpp

    Line: 33

    Function: __cdecl ObjectTexture::~ObjectTexture(void)

    Build: release 181 (64-bit) checked

    Component: Construct 2 IDE

    (Last Win32 error: 0)

    You are using a 'checked' release of Construct 2, intended for testing, which causes certain errors to be reported this way. Hit Ctrl+C to copy this messagebox - it's useful information for the developers, so please include it with any bug reports! Click 'Abort' to quit (unsaved data will be lost!),'Retry' to turn off messages for this session and continue, or 'Ignore' to continue normally.

    ---------------------------

    Abort Retry Ignore

    ---------------------------

  • It's by design that if you set a layer to global, it overrides the objects on all the other layers with its own content. However due to the architecture of the editor the overridden layers can't be displayed on the other layouts, so their content will seem to disappear. This is still by design at the moment.

    I can reproduce editor issues if you try to modify a globally overridden layer - the editor will prevent that and tell you to modify the original global layer instead. I can reproduce some cases there and I'll try to fix all cases of that for the next beta. However the OP alludes to a runtime error but does not specify how that occurs. Can you describe some more about that? Can you still get it to happen even if you pretend the editor doesn't allow you to modify a layer which has been overridden?

  • [quote:1nnqxpn5]It's by design that if you set a layer to global, it overrides the objects on all the other layers with its own content. However due to the architecture of the editor the overridden layers can't be displayed on the other layouts, so their content will seem to disappear. This is still by design at the moment.

    So that means the global setting wipes any objects assigned to same-name layers on other layouts as long as it's in effect? Makes sense that the runtime throws an error then.

    [quote:1nnqxpn5]However the OP alludes to a runtime error but does not specify how that occurs. Can you describe some more about that? Can you still get it to happen even if you pretend the editor doesn't allow you to modify a layer which has been overridden?

    If I try to set layers to global on the 'startup' layout in my own project I get this error message during preview:

    'Savestate_Lab' is a global object I use to keep track of some variables during the first section of the game. It's meant to minimize savestate size and I destroy it when outside that first section. I also destroy and re-create it each time the game is restarted, including on first-time run. The 'Savestate_Lab' object itself exists on the first layout that gets switched to after the 'startup' layout (on one of the layers that get over-ridden). And the events below happen on the 'startup' layout right before switching.

  • Me too have the same problem .Thanks for your info.

  • ErekT - you have not provided a .capx for what you describe, so I cannot investigate it - however if the object only exists on a layer which has been overridden by a global layer, then it acts as if it is not placed anywhere in the project (since the overridden instances on the global layer don't count), so that is by design.

    Closing this report as the editor issues should be fixed for the next build.

  • Yeah, I'd rather not post the entire project file out in the open. Sounds like it's not necessary anymore anyway, but if you still want to double-check with the actual capx, let me know and I'll PM you a link.

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