Switching Layouts Bug - Cap Collection

This forum is currently in read-only mode.
From the Asset Store
Toggles Dials Switches and Alerts ! A foundational sound grouping of Analog type switches and Steampunk effects
  • Didn't know where exactly it would make sense to post this lucid, so I decided to start a thread. Please don't discuss here, just post caps that are reduced to a possible bug related to switching layouts - no complete projects. Add a short description.

    Globals messed up when transitioning:

    Two layouts. Switching back and forth. Two global objects. Start the cap. It should run. Now toggle action 1 and action 2 of event 2 in both layouts. Now with a transition active, no globals will appear on layout 2 (visual problem only) and the layouts only switch one time (timer not resetted?).

    LayoutBug.cap

  • thanks tulamide. apparently there is more than one problem with the layout changing then. Because there are still crashes without transitions on certain caps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • kayin, Metal_X,@davioware, and anyone else with crashing caps on layout switches.   thanks to R0J0hound in the other recent crash thread, I now know that an OR condition during a transition can cause crashes. I've done a little forum searching, and apparently xaudio playing during a layout change causes crashes, and having the No Serialize attribute sometimes alleviates crashes. If anyone who has a crashing cap can try removing any of those conditions(conditions meaning circumstances, not construct conditions) see if it fixes it, or if anyone else remembers any little nuggets about what types of things cause or fix these crashes, when I have more time I'll look into it.

    Another question that might help narrow things down if someone has noticed, when it crashes with a transition, does it crash right when the transition should begin? or after it's complete?

  • The breakout Tutorial I was working on now crashes between layouts. I do have a MOD playing and I don't stop it before going back to the previous layout. And it seems to make the layout change, completely, then locks up.

    This one locks up when you go back to the main menu by pressing ESC... or alternatively cheating to win the game by pressing F12.

    dl.dropbox.com/u/60872572/Breakout%2009.cap

    Are these bugs in the new version of CC and not present in the old one?

  • Seems like removing the MOD music from the layout stopped the crashing when switching to the menu layout.

  • I have no crash, but for me just switching to a given Layout with the press of a button doesn't work.

    Just make an empty cap, two layouts. Each Layout has its own Sprite object (different positions and colors, for easier differentiation). And a global MouseKeyboard Object.

    + On 'Space' pressed:

    -> Go to Next Layout/Switch to Layout Nr.(either behaves the same)

    I have one of this Event on each of the two Layouts:

    + On 'Space' pressed:

    -> Switch to Layout Nr.

    However, every time after the application has been started, the first press will always only reload the current layout, each consecutive press works as expected (according to Events).

    No transition picked.

    EDIT: Nevermind. It seems that had to do with the MouseKeyboard Object being global and checking on each Layout at the same time for some reason? I don't know, still weird actually.

    But the reason I say that, is because when I changed the Button in one of the Events to another, it worked right away.

    But shouldn't the Events of a Layout only be checked, if it is the current Layout? And not because there is a global Object inside an Event?

    Still it doesn't make sense, because even when I made a new MouseKeyboard Object for each Layout, it behaved like this.

    2nd EDIT: Okay, here's what I found out now. It has nothing to do with the MouseKeyboard Object being global. It is indeed the Layout Switch making trouble. The first time You make a layout switch after application start, it will in fact read switch to the other Layout AND continue reading the Events of the new Layout in the SAME Tick. It will add the Events of the new Layout to the current Tick.

    The next time You switch Layouts, it works as expected.

    You can check this by switching the layout upon a button press, and increase a global variable by one.

    Now on the second Layout, for the same button press, You switch the layout back to the first, and increase the same variable by one.

    If You now press the button the first time, the variable will increase by 2, after that each consecutive press will just increase by one.

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