[SOLVED] How do I run action after sub event?

0 favourites
  • 5 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Does an action in event run after sub event? If not, how do I run action after sub event?

    For example:

    1) Event - checks if value is greater than 0

    2) If value is greater than 0, do sub event

    3) Sub Event - checks if value is odd, if odd do something

    4) Sub Event - Else value is even, if even do something

    5) After SubEvent set boolean isFinished = true

    I'm wondering if I have to set isFinished at the end of each path or if there is an easier place to set it just once when everything is complete.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well.. you can set the variable isfinished = true in the main event..

    because doesn't matter if the value is odd or even, you will always set true to the boolean..

    So, if the main event is true, it always will be isfinished = true.. does it matter if sets before or after?

    Even if you have another event comparing if isfinished = true, as I undestand, it will always finish the main event and subevents before trigger other main event.

    Edit: or you can just have a last blank sub event, parent of the main event with action set isfinished = true.. it will always run but last

  • klabundee is right, in your example it doesn't matter when you set the boolean variable, you can set it in the main event.

    But in situations when you need to run an action after previous sub-events are finished, you have to do it like this:

  • Thank you, I will set my example up this way.

  • Well.. you can set the variable isfinished = true in the main event..

    because doesn't matter if the value is odd or even, you will always set true to the boolean..

    So, if the main event is true, it always will be isfinished = true.. does it matter if sets before or after?

    Even if you have another event comparing if isfinished = true, as I undestand, it will always finish the main event and subevents before trigger other main event.

    Edit: or you can just have a last blank sub event, parent of the main event with action set isfinished = true.. it will always run but last

    Thank you, I will try both of these.

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