How to "hold" an event until a condition is met?

0 favourites
  • 6 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • I am returning to Construct 2 after some months away, busy with work. Getting back into it is easy and a testament to how user friendly it is. I even fixed a problem I'd gotten stuck on six months ago! Then I got stuck again.

    I recall seeing a tutorial about an Action to "hold" (or pause or wait or some similar verbiage) an Event as active until a certain condition or conditions are met (X amount of time passed, velocity == 0 etc).

    Can anyone steer me towards that functionality? Either a tutorial, example or manual entry?

  • I'd have to see an example of the event in question, but generally you add conditions to the event in question until you've got all of the requirements covered. Just right click on the event you want to add conditions and select "add another condition".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use the "wait" action (System -> Wait), but it only works for time.

    What you are asking for sounds more like a sub-event, though.

    For instance, here:

    <img src="http://i.imgur.com/3TEPyMG.png" border="0" />

    It checks the selected item variable, and if the player is falling. THEN, if these conditions are met, he checks to see if the player is pressing Z.

  • Thanks for the quick replies! I guess wait isn't actually what I need. Here is the state machine so far:

    The states:

    <img src="http://i1068.photobucket.com/albums/u442/AnimationMerc/StateMachine_01.png" border="0" />

    The conditions:

    <img src="http://i1068.photobucket.com/albums/u442/AnimationMerc/StateMachine_02.png" border="0" />

    The problem is this:

    I am trying to get State 6 (sliding) to lock in until velocity = 0, (hence the "start ignoring Platform user input" action.

    All of this works and the slide completes as desired before restoring player control, but if I release the Down arrow during the slide it returns to State 1 (Running), even as it slides to a stop. I am hoping to lock the state machine into state 6 (sliding) until it reaches zero velocity.

  • Add a variable isSliding. Set it when you start State 6, remove it once State 6 is finished. Add a Not isSliding to the event that sets State 1. (if that made sense)

  • Yes, that not only made sense; it worked like a charm! I added the IsSliding variable and defined it's action as "Set PlayerState to 6" and it works exactly as intended. Thank you very much!

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