Trigger Once bug with Group Deactivation?

0 favourites
  • 8 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • Link to .capx file (required!):

    https://dl.dropboxusercontent.com/u/142089028/TriggerOnceExample/TriggerOnceExample.capx

    Steps to reproduce:

    1. Left click the yellow box

    2. Middle click the yellow box

    3. Right click the yellow box

    Observed result:

    The black box flashes after step 3.

    Expected result:

    The black box should never flash again after the initial left click.

    Browsers affected:

    Chrome: yes

    Operating system & service pack:

    Windows 8

    Construct 2 version:

    150

  • Closing as by design. The 'trigger once' condition is working correctly; the problem is you were expecting the wrong result.

  • Thank you for the quick reply, ASHLEY. Perhaps that could be added to the manual for Trigger Once and/or Groups? In the manual for Groups, there is a tip that deactivation can be used to pause the game, but if many conditions exist that you wouldn't expect to trigger again when the game is unpaused, there can be some mayhem :)

    I was afraid this was by design, so I've already reworked my groups to account for it. Thanks again!

  • Why would you use 'trigger once' in a group other than with the intent for the event to run once whenever the group was activated? That's what it means and that's what you'd use it for. What were you expecting to happen instead?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's possible we're misusing or at least overusing Trigger Once. We have some state variables and we want to trigger actions when the state changes, but not every tick.

    For example, a story book where the user can pop back and forth between a page in the book and the main menu where they can choose different books. Our code had been tracking "inStory" as a state variable and when it was equal to 1 we would note the page number and spawn art assets on the page. inStory was set to 0 when the user was on the main menu, and 1 when in any story. We had this controlled with a Trigger Once which was working fine until we decided to better organize our code into Groups and implement a help system that deactivated certain groups while a pop up was generated.

    Naturally, we were surprised to discover that after exiting the help pop up and reactivating groups, we now had twice as many assets on our page :)

    So, to directly answer your question, I was operating under the assumption that Trigger Once would only allow the actions to be executed when the trigger variable changed, and under no other circumstances. I'm not saying that's necessarily the right way, but that was the reason behind my bug report.

    Since the time of my post we have restructured and are hopefully using better practices now. It's been a wild ride these past 8 months coming from total noob status to somewhat decent C2 user, but we're discovering every couple weeks that some of our practices are not the best way to do things!

    Thanks for your time as always ASHLEY.

  • Good to know it's by design, was going to post the same thing in in the bug thread =O

    but I agree with clrammer. this is not as intuitive and obvious as ashley claims.

    the manual should say that the events will reset their events when disable and enabled again.

    although, when i think about it, it kinda makes sense. good to know though.

  • Good to know it's by design, was going to post the same thing in in the bug thread =O

    but I agree with clrammer. this is not as intuitive and obvious as ashley claims.

    the manual should say that the events will reset their events when disable and enabled again.

    although, when i think about it, it kinda makes sense. good to know though.

    I think that for a trigger once to trigger, it must have one of it's conditions before it to be false, then all of them to be true.

    A group basically logic-wise works the same way as an "Is Group Active" condition, so when you deactivate it, then reactivate it, the condition chain was broken then relinked so it does this.

  • yup i got that =P

    i actually did change the events that used "trigger once" in events when i found out about this ^^

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