Trigger events once each time condition applies

0 favourites
  • 6 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hello there ,

    I'm looking for someway to trigger a list of actions (for that instance) each time a condition applies to that instance but only once

    Here's what I got ...

    I have a Block Object , and a (imaginary) grid where the block snaps ... and each time an instance snaps ( I have the snapping condition , I need to trigger some events for that instance( once )

    So , Bigger explanation

    I need to trigger some actions (for that instance) once each time an instance meets a condition , taking note that I already have that condition

    <img src="https://dl.dropboxusercontent.com/u/89532891/Everything/Images/Example.png" border="0" />

    Distance_to_snap = 0.3

    unfortunately , it only works when all instances move and snap

    So Briefly,

    When an instance snaps , I need to pick it and trigger some events (ONCE) for that instance , what conditions could do the trick ?

    Cheers !

  • Fixed !

  • Hey, I'm working on something similar.

    What would be the solution? :)

    Basically, trying to set up a repeating flag (global variable) trip every X pixels to trigger a set of events once.

    Problem is I'm not a math whiz.

    It would work off scrollx.

    So basically every X pixels scrollx rolls right for example, the same flag goes off.

    Think it could be done with Trigger Once, then resetting the global variable flag trip to off at the end.

    Just having trouble conceptualizing the math/formula.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I used a boolean

    Setting it to true and resetting it to false when the events triggered

  • The original solution des not work because the 'System -> Compare two variables' condition does not pick any objects, thus any actions affect all of them.

  • vee41 ,

    You are right , so I made a boolean that picks objects that are moving and thus instances that will snap soon , and made it a condition for that event , and woosh , problem solved

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