Including Event Sheets - Event priority

Discussion and feedback on Construct 2

Post » Thu Jun 26, 2014 1:13 pm

Hello!

I've a quick question to ask you guys about the priority of events when using Event Sheets : )

Let's say I have my Main Layout, and Main Layout uses Main Sheet.
Now, I have another Event Sheet called ANOTHER.

This is how the Main Sheet looks:
Image

This is how ANOTHER event sheet looks:
Image

My question is: how will the Score variable behave?

In my opinion it should go:
0 - initialization
999 - Include: ANOTHER -> On start of layout
0 - Main Sheet -> On start of layout

Am I right? Will events from ANOTHER complete before events from Main sheet do?
B
6
G
1
Posts: 28
Reputation: 458

Post » Thu Jun 26, 2014 1:18 pm

In normal events, the main event sheet is read from top to bottom, if an event sheet is in the way, the event sheet is read (all is normal)

However, with triggers like on start of layout, further testing showed included event sheets will trigger always before the main event sheet, this is only for trigger events AFAIK

In your exemple, Score should be 0 I think (the debbuger could help you see the value it takes at the end of the tick too)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Jun 26, 2014 1:21 pm

So basically my conclusion was right : ).
B
6
G
1
Posts: 28
Reputation: 458

Post » Thu Jun 26, 2014 1:23 pm

@itzathis

Yes, but if include:ANOTHER was at the bottom of the event sheet instead of the top, the result would not have changed, where logically it should have I think (since this is how triggers seems to work with includes).

My suggestion is to have the main event sheet have only includes and non trigger conditions, that way, no weird trigger order relative to the main event sheet has to be done. main event sheet from top to bottom, without anything else
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Jun 26, 2014 1:39 pm

It's easy to test this yourself with events and see how it works. But yes, the engine fires triggers from the most-deeply-included sheet first, firing on the top level event sheet last. Other events are read normally in top-to-bottom order, and includes are run where they appear in the event sheet.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests