eventsheets

0 favourites
  • 9 posts
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've look but cant find the answer, thanks though <img src="smileys/smiley1.gif" border="0" align="middle" />

  • 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 capx

  • 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 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.

  • 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.

  • 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'.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)