Two different actions with the same key?

0 favourites
  • 7 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I have a dialogue system that has two states. Either "WaitForInput" = 0, or 1.

    Meaning it has a state when the text is still scrolling by and when the text is finished and awaiting the player's input to continue.

    I want to let the player hit the Enter key to skip the dialogue to the end of the scrollby, as well as use the Enter key to advance the dialogue when it has finished the scroll as well. (As defined by those two separate functions)

    The issue is when the player hits 'Enter', it does skip to the end the first time, but then when Enter is hit another time to advance the dialogue, it automatically skips to the end of that dialogue- negating the scrollby effect. To my understanding- it's because it's functioning like:

    WaitForInput = 1, meaning the dialogue has ended. Player needs to hit Enter to advance the dialogue.

    Player hits Enter.

    Dialogue is advanced and is scrolling by, but because the switch caused WaitForInput to equal = 0 now, at the same instant that Enter is still being pressed, it activates the skip function every time.

    I think there is a fundamental easy step I'm missing to ensure that double-actions don't happen on single key functions, but I'm just not seeing it. I know this has got to be a problem someone else has faced before. Any insights?

  • Invert your logic. Triggers are best placed at the top level, then check WaitForinput=1 Continue... Else Skip... The Else is important as it insures only one condition can be checked at a time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's exactly what fixed it! Thanks!

  • This has bothered me also. Could someone please show an example capx or an image of the code.

  • How to trigger two things into the same key using else?

  • Thanks a lot!

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