event running order

Get help using Construct 2

Post » Thu Jul 28, 2016 2:46 pm

Whoops. Looks like the event that should be sub-event wasn't sub-evented so to say.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Thu Jul 28, 2016 3:05 pm

helena wrote:Ok thank you all for the replies.

@backendfreak
I wonder, the groups. I use groups but just for the cosmetic reason, to make it look better in the events page.
I do not have any runtime actions about groups. So the events inside group should simply be run top to bottom, right?


If you're not toggling the groups then your code runs top > bottom all the time. Active groups do not affect anything, no worries :).
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Thu Jul 28, 2016 4:17 pm

@BackendFreak Good to know. Now I have solved the bug anyway so onward to the other bugs! ;)
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Fri Jul 29, 2016 2:19 am

BackendFreak wrote:But if you use groups then there's a different story. Unlike triggering the function, toggling a group takes one tick. So if you activate a particular group, code which is under this group will be triggered next tick.


That's not exactly correct. Toggling a group is instant, so if you activate a group before the group in the event sheet it will run the same tick, but if you activate it after the group in the event sheet the group won't run until the next tick.
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,744

Post » Fri Jul 29, 2016 10:57 am

Yes, that's precise. Thanks @Arima. Also worth to mention that it is the same with toggling groups placed in separate event sheets. If you include event sheet below "toggle action" it will take effect in the same frame, if above then next tick. It's common that event sheets are always included at the top (then toggling always takes effect next frame), but it actually matters where you include them.

Not sure which one is respected if you include the same event sheet multiple times in various places but I guess it's the first one.
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Previous

Return to How do I....?

Who is online

Users browsing this forum: NN81, TsubaRu and 9 guests