> It is true that functions cannot be referenced from an event sheet that does not include the relevant sheet containing the function itself. However, event sheets cannot be included conditionally.
> You will notice that when you include an event sheet, the INCLUDE statement is always placed at the top of the event sheet.
> A conditional include would look something like this:
> IF X == TRUE THEN INCLUDE EVENTSHEET1
> ELSE INCLUDE EVENTSHEET2
> You're right about that. As a software engineer by trade, Construct is a way for me to wind-down at the end of the day. It's definitely my favorite RAD tool for games.
an include can be a subevent, thus conditionnal, C2 may place the include at the top, but you can move it freely.
Aphrodite It doesn't matter. The include statements are not processed at a run-time conditional level. All event sheets are bundled into the final JS code of a project irrespective of whether they are explicitly included. So you can move the INCLUDE blocks around wherever you want, but it makes no difference.
Here's a capx demonstrating it and the associated code.