[R71] trigger an event at included sheet

0 favourites
  • 3 posts
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • Hi,

    In this post, Kiyoshi find a bug in my function plugin.

    In this case, user include 2 event sheets.

    1. In 1st included event sheet, user use action to trigger the event.

    2. After step 1, the 2nd included event sheet can not run.

    I trace the execution flow in firebug. I guess -

    1. the action to trigger event will scan all events in the sheet, include "include" sheets.

    --> And mark the sheet.hasTriggered = true

    2. now turn to normal execution, engine try to execute the next included sheet. but the

    sheet.hasTriggered == true

    in eveng.js, line 1453

    if (sheet.hasTriggered)
        return false; 

    So engine skip this sheet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, so is this a trigger calling another trigger? So runtime.trigger() is being called recursively?

    I didn't write it to support that yet, so if that's the problem I can try and correct that...

  • Humm... The first part is correct -- using a action to trigger another event.

    The second part -- runtime.trigger() is being called recursively, I'm not sure. From my trace, "runtime.trigger()" seems to change the value of "sheet.hasTriggered". It might cause a bug with "include event sheet".

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