eventsheets

Discussion and feedback on Construct 2

Post » Sun Feb 10, 2013 12:03 pm

Hi all, I'm new to construct 2 and am still learning some basics. Could anyone tell me if when a layout is loaded does it load the corresponding eventsheet(s) only or does it load them all?

B
14
S
4
G
3
Posts: 77
Reputation: 4,011

Post » Sun Feb 10, 2013 12:11 pm

B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Thu Feb 14, 2013 5:17 pm

I've look but cant find the answer, thanks though
B
14
S
4
G
3
Posts: 77
Reputation: 4,011

Post » Thu Feb 14, 2013 5:31 pm

When a layout is loaded it also loads/executes the associated event sheet in the "Event sheet" property of the layout (and only this event sheet).

If this event sheet contains "Includes" (explained in the link vee41 posted above) those event sheets will be executed too, as "child" of the primary executed event sheet.

Example capxKyatric2013-02-14 17:35:18
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Feb 16, 2013 1:59 pm

Is there a way to change which event sheet has to be loaded first?

To better explain, bigger my project became, more I need order; for this reason I've created more event sheets, each one including another. Then I've told myself: why not creating an event sheet called "Include" and there I put all the include to other event sheets... unfortunately this has been possible only inserting an "include SheetInclude" in the firs event sheet, and this disturbs mine maniacal order :)

So, is there a way to create a new event sheet and declare it to be the first one to be loaded?
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
29
S
12
G
4
Posts: 130
Reputation: 4,735

Post » Sat Feb 16, 2013 3:19 pm

I'm not sure why it is of any concern to anyone what order the event sheets are loaded in. The order of loading has no effect on anything.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Feb 16, 2013 3:38 pm

@Jeff Skyrunner: The sheets will load in the order you include them and finaly the including sheet will be loaded last.

@Ashley: Actually it has an impact if you're using several "On start of layout" events, spread in the included sheets.
You have to make sure you're logical in what you make happen first, and/or about the values you might set to certain variables.
Example. According to where/when you're setting the value and/or adding to it, you may have some unexpected result to someone not aware the included sheet is loaded first.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Feb 16, 2013 3:49 pm

That's nothing to do with the order event sheets are loaded, it's only to do with the order of execution of triggers when includes are used. Triggers always run in an included event sheet first, and in this case a 'start of layout' trigger is used. I don't think we can change this since it could potentially break a lot of projects (and is the kind of subtle thing you don't really want a setting for). You can probably work around it using your own initialisation events instead of 'start of layout'.Ashley2013-02-16 15:49:43
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Feb 18, 2013 10:02 am

@Ashley in my case it's just for the sake of a "clean" workspace... since this is my first project with Construct I cannot imagine how it could become complex to read and undestand, so I decided to add more event sheets when a big part of the code was already written. Now that I know it's not possible (at the moment, at least) do decide which event sheet is the first one, I will start future projects with the "include" event sheets and then prepare the others.

Thanks
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
29
S
12
G
4
Posts: 130
Reputation: 4,735


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests