Keep running sub-event when parent becomes untrue

0 favourites
  • 7 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Hi!

    Is it possible to have a subevent run it's course even after the triggering parent event is no longer true?

    I'm asking because have gotten myself into a situation like this:

    When a player clicks on the "reset game" text, I check that the text of the text object is indeed "reset game" (because I use one universal text object for all texts).

    However, before actually resetting, I would like to change the text to "Resetting..." in a subevent to indicate a change (so that the player gets visual feedback that the click registered).

    The problem is that now the parent event condition is no longer true (text is no longer "reset game" but instead "resetting") and it seems like also the child event stops executing additional steps.

    I know there would be other ways to solve this, but I'm interested in understanding Construct better. So is there any way of changing the text while still keeping the subevent running?

  • An event will not run if it's conditions are not true..

    but at the moment you click the text, the conditions are true, so adding a wait action before the reset would solve this..

    It would be no problem to show the text resetting.. during the wait..

    (Instead of wait, you could also use a timer, ofcourse)

  • Hmmm can't seem to figure that one out..

    Here's the structure with which I'm trying to follow your suggestion:

    -Touch on touched textUniversal

    --textUniversal text is "Reset game" -->system -wait 1 seconds

    ----------------------------------------------------->textUniversal -set text to "resetting"

    ----------------------------------------------------->system -go to firstLayout

    With this structure the text no longer changes, but the system doesn't change layouts either. I also tried other arrangements of events and subevents but so far I haven't come up with the right cocktail :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • put the wait between the setting of the text and the goto layout..

    the way you have it now setting the text and going to layout are done the same tick..

  • Tried it like that now too, but then the new layout never loads.. Maybe what I'm trying is simply too difficult and I should switch my entire approach.

  • It shouldn't be difficult, if the text is exactly what you wrote (no extra spaces, no capital G) and the layout you are trying to goto exists, that is..

    I usually give textobjects an instance variable function to distinguish them from eachother..

  • You are right, I made a simplified version of the project with only the necessary elements and it worked! I have to look for other causes of the problem in my main project. Thanks for your help!

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