Next Layout/Go To Layout Bug?

For questions about using Classic.

Post » Sun Feb 12, 2012 2:11 am

Am I doing something wrong, or why does it only go to the next Layout (or Layout of given Number), after pressing a button the second time?

I made a new empty .cap. Just to check for switching between Layouts.
When pressing Space, it should change to the next Layout.
Now what You see is this:

1) Space Pressed - Reloads same Layout
2) Space Pressed - Loads wanted/next Layout
3) 4) 5) ... Space Pressed - Works as expected.

But every time the first press (after running the application) reloads the same Layout.

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:42:33
Posts: 70
Reputation: 615

Post » Sat Mar 03, 2012 4:24 am

Do you use transitions in this project? I've noticed that they are still really buggy as of Construct Classic R1.2
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
Posts: 2,082
Reputation: 14,914

Post » Thu May 10, 2012 6:48 pm

Is there a workaround for this? I'm having the same issue and I have no idea how to fix it.
Posts: 37
Reputation: 549

Post » Tue Jul 09, 2013 11:06 am

Hi there
I have encountered the same problem as you.
And I also have recently found the root of the problem here
It might be too late to answer you but I think that this might help others who encountered the same problem

Here is why that is happening:
It's true that it pressed the same button in the same tick in the targeted layout because the time used in "go to layout" is very little

I assumed this is the problem from mouse & keyboard being bugged

How to get this problem solved is:
add wait time before "go to layout" in the event you pressed the button
I have tried some numbers and found out that wait(100ms) is the best for this problem
Posts: 1
Reputation: 127

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests