Switching Layouts Bug - Cap Collection

For questions about using Classic.

Post » Wed Feb 08, 2012 12:41 pm

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
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Feb 08, 2012 1:31 pm

thanks tulamide. apparently there is more than one problem with the layout changing then. Because there are still crashes without transitions on certain caps.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Feb 09, 2012 2:52 am

@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?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Feb 09, 2012 3:33 pm

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.

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

Are these bugs in the new version of CC and not present in the old one?
B
6
S
1
Posts: 21
Reputation: 617

Post » Thu Feb 09, 2012 5:13 pm

Seems like removing the MOD music from the layout stopped the crashing when switching to the menu layout.
B
6
S
1
Posts: 21
Reputation: 617

Post » Sun Feb 12, 2012 2:19 am

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.

Shindoh2012-02-12 09:41:39
B
3
G
1
Posts: 70
Reputation: 615


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests