Trigger Once and ELSE

  • Hi,

    How do you use Trigger Once in conjonction of checking if an instance variable is TRUE do something, ELSE do something ?

    Is that the way to do it ?

    + Condition

    + Trigger Once

         o Actions...

    + Else

    + Trigger Once

        o Actions...

         

    Thanks!

  • Interesting solution! the idea is to simulate the trigger once on an entity then.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes because trigger once is a system condition and it does not pick instances as I learned the hard way!

  • Umm.. i don't know fully the problem you had but i know Trigger Once doesn't pick instances. all it do is actually trigger your actions once the conditions become true or false.

    I tried another solution which seem to work (based on a post from Arima)

    Pick Xyz where IsEnabled = 1

       Trigger Once

              (change animation)

    Else

       Trigger Once

              (change animation)

    This variation actually work very well too. Trigger Once can act alone cause no condition mean true basically.. so if it turn out to be true it won't be executed again. But i wonder if this is safer than..

    Pick Xyz where IsEnabled <> 1

    Trigger Once

         (change animation)

    Pick Xyz where IsEnabled = 1

    Trigger Once

         (change animation)

    For sure both doesn't do the same thing but you know that IsEnabled can be TRUE or FALSE so an ELSE might not be needed in my case. I found ELSE to be useful in toggle scenario between 2 actions.

  • Afterall the best solution was with a instance property. Pick is really different from ForEach. Sometime we are more looking for a ForEach than a Pick.

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