"Load" breaks "Trigger Once"

0 favourites
  • 7 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • I spent some time trying to figure out why "Load" wasn't working the way I expected it too.

    After some head scratching and some forum searching, I realized it was my "Trigger once" commands.

    They had already been triggered before the "Save" happened, but when "Load" happens, they trigger again.

    This was unexpected.

    I wish there was a way to save this state. Maybe, it could be an option/parameter when selecting "Trigger once".

    In the end, I was able to solve it by getting rid of "Trigger once" and creating my own global variable to track it.

    Tagged:

  • I’ve always said that 'Trigger once' is the most harmful feature in Construct. Many people, especially beginners, use it as a universal fix for various issues in their code. And in doing so, they often create new, more serious, and harder-to-detect bugs.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I will heed your warning and not use it again - using a boolean to do the same thing is certainly easy enough. It would be cool though, if it worked as expected.

  • "Trigger once" is a handy feature that lets you do something just one time when certain conditions are met. It's great for things like tutorials.

    The problem is that people often misunderstand how it works.

    Basically, "Trigger once" is true only the first time all other conditions in an event are true. After that, it's false until one of the other conditions becomes false. Then, it can become true again if all conditions are true on the next check.

  • Tutorial in my games looks like:

  • DarkViGaCi You don't really need "trigger once" in your case.

    But your code is fine. Most bugs happen when people use this condition with objects that have multiple instances. Like "Enemy HP=0, Trigger once"

  • Most bugs happen when people use this condition with objects that have multiple instances. Like "Enemy HP=0, Trigger once"

    Hehe, that's part of the natural learning process of C2/3 -> Trigger once for multiple instances -> bug -> learning For Each -> for each related bugs -> and so on...

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