bernease's Forum Posts

  • 4 posts
  • Sorry for the false alarm.

  • Thanks! Looks like things are working fine on a simple project, so there must have been something else suppressing my logs or unsubscribing to the event.

    The ILayer in the post was just a typo.

  • Hi all,

    First off, thanks for all of the support on the forums! I'll note that I searched forum posts and documentation and still having questions.

    I'm having a little trouble understanding and coming up with an elegant solution for a scripting way to trigger an event at the start of the layout when the layout is loaded multiple times in a cyclic pattern. The existing "beforelayoutstart" event in ILayer empirically only run the first time the layout is started, but not if I go in the following pattern:

    MenuLayout -> LevelLayout (event works here) -> ScoreLayout -> LevelLayout (event does *not* work here)

    It's not very clear from the description in the ILayer documentation, which counterintuitively (unless I'm doing something wrong here) that "beforelayoutstart" event is *"Fired when the layout starts. "beforelayoutstart" fires just before On start of layout, and "afterlayoutstart" fires just after"* especially since the event sheet On start of layout does fire when I load LevelLayout a second time. It'd be nice to have documentation clarify either way.

    Assuming only firing once before the *first* start of the layout is how it's intended (and I'm just not grossly misunderstanding events), I looked for other solutions:

    1. [Doesn't work] Calling functions concerning objects on LevelLayout in the same function as my move to layout call. This doesn't work because the move to layout is performed at the end of the tick after all other code. Unless I'm missing something here too.

    2. [Seems very inefficient] Storing a "layoutLastTick" variable and any functionality to be run on next layout, comparing current to previous layout every tick to decide whether or not to run.

    3. [Went with this, but ugly] Using the event sheet solely for an actual "On start of layout" and then calling script inside. I imagine this is in reality as inefficient as solution two since the sheet runs each tick.

    Anyone else come up with better solutions? Am I just misunderstanding the use of "beforelayoutstart" event or alternatives?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While using Git as version control on the files, I sometimes see a mass of changes for `filepath:Zone.Identifier` for each file in the project.

    I'm having trouble identifying what this file does. I don't see any documentation about it anywhere nor does there seem to be anything inside the file itself.

    Right now, it'll help me know whether or not I can safely .gitignore these files.

  • 4 posts