"Trigger ounce while true" Issues

0 favourites
  • 6 posts
  • What I want is simple. I want to get an event like "Is overlapping" and turn it into an event like "On collision" (i.e. make it only trigger for one tick.) without using trigger ounce while true. I don't want to use trigger ounce while true, because if one object is overlapping already, and another object collides as well; it will not trigger a second time. Any ideas?

    -Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • instance variable ( call it overlap ). If overlaping set to 1, in not set to 0. Then do whatever you want when it's one way or the other

  • I have used this technique before, and while it is effective, it is inconvenient when you have hundreds of events.

  • You could use an array, and store the uid of overlapping objects. And check if the uid are in the array or not. If they aren't overlapping, remove uid from array.

    So if overlapping and uid isnt in array, then perform the actions and add uid to the array. If it isn't overlapping, and uid is in array, remove uid.

  • Prominent I am not having the problem specifically with overlapping objects. Just with trigger ounce events in general. For example, I might want to trigger an event only when a boolean first becomes true.

  • Well, in that case..

    One way or another you need to record when the first case occurs. So you have to store that information somehow. Construct isn't going to do that for you. It's not going to record every time something happens for the first time, because that could be hundreds of thousands of possible things. You have to create the logic yourself to discern when that happens.

    So you can use variables to store the data that will signify when the first occurrence has happened.

    You can use a group, with a local variable inside and set it to Static, and then put the events inside the group that set the variable. If it is 0, it is first occurrence, if 1 then the first occurrence has already happened.

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