On Start of Layout doesn't work right

Get help using Construct 2

Post » Fri Feb 16, 2018 6:58 pm

Hi.
I've just found out why the "On start of Layout" actions are not triggered in my project. It's because of the In-Game Menu.
I have the "On start of Layout" event at the beginning of the event sheet that is triggered.
I have a group named "Game Engine Pausable" that has lots of other groups with On start of Layout events, too. Only those are not triggered.

https://www.dropbox.com/s/2qwk4y2zcc6dc ... p.jpg?dl=0

Here is how it looks the event sheet for the in-game menu.

https://www.dropbox.com/s/eebmpqcfulwve ... m.jpg?dl=0

I've made some tests and if I don't deactivate the "Game Engine Pausable" when InGameMenu=1it all works fine, but then some object in the scene are moving when they should not when timescale is 0.

Anyone knows a workaround for this ?
B
46
S
11
G
10
Posts: 237
Reputation: 7,877

Post » Sat Feb 17, 2018 1:46 am

The easiest solution would be to simply move all other "On start of layout" events out of the "Game Engine Pausable" group.

Or you can investigate why this group becomes deactivated when layout starts. It's hard to tell by these screenshots, but I'm guessing some event momentarily sets InGameMenu to 1.
Or if you are switching to this layout from some other layout, it's possible that this group is already deactivated when layout starts. Add this to your event #1, it will tell you if the group is active on startup or not:
Is group "Game Engine Pausable" active -> Browser Log "Group Game Engine Pausable IS ACTIVE"
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
156
Posts: 2,209
Reputation: 82,999

Post » Sun Feb 18, 2018 9:08 am

Yes, the easiest solution would be that but the event sheet would look disorganized and I am trying to keep that :) .
The issue is that all the events in that group are working, the only ones that are not are the ones with "On start of layout".
B
46
S
11
G
10
Posts: 237
Reputation: 7,877

Post » Sun Feb 18, 2018 11:01 am

And I gave you two possible reasons why this could be happening. If your entire group is deactivated during the very first tick when layout is opened, then all "On start of layout" events in it will not be triggered.
B
17
S
9
G
156
Posts: 2,209
Reputation: 82,999

Post » Sun Feb 18, 2018 11:20 am

have an on-start of layout event and put this group there, but make cure it's active

then right after that have a sub-event that deactivates it

That way everything should execute before being deactivated
B
36
S
19
G
7
Posts: 142
Reputation: 6,886

Post » Sun Feb 18, 2018 12:12 pm

I've added on start of layout ---> set group active for "game engine pausable" since setting the InGameMenu to 0 and modifying other things wasn't enough.
Thanks guys.
B
46
S
11
G
10
Posts: 237
Reputation: 7,877


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 5 guests