How do I disable buttons or action while actions are playing

0 favourites
  • 3 posts
From the Asset Store
This Student Workbook uses both Construct 3 & 2 encoding. It supplies client-side & php "back-end" encoding.
  • Hello all! I have a beginner question. I can't get this to work properly. Basically I want a black UI and text to show up when the player presses a button. I want it to stay on screen for a few seconds while the text comes up typewriter style. I have these parts working (well, still working on the typewriter effect but I'm working on it) but I don't want the player to be able to spam the select button making the text/UI visible and invisible after the code runs once. I want the text and UI to display for the appropriate amount and for the player to not be able to press or activate this action again until it finishes playing. Here's my code.

    I also have another, more complicated question related to this. I want to create a number of different texts or dialogues that would show up whenever the player presses Select or R. Kind of like a Metal Gear Solid codec system. I know how I would go about making the game say the same specific text/sentence over and over but how would I go about playing 20 different short sentences each time you press select? I'm still new to this and it's hard wrapping my head around arrays and families. That what I need to use, right? Thanks everyone!

  • You've got the right idea, just backwards. You need to Deactivate the group when the button is pressed, and Activate it after the Wait.

    For the array, just use a global variable for the index, and increment it each time it's used. Check against the end of the array to loop it back to zero.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your help blackhornet! Did what you suggested and got it working! Simplified the code too! I had no idea about that I could specifically deactivate different "systems" or code if I put them into groups. Seems like it could be very useful. Here's the bit of code for posterity's sake. Now I'm going to try and get this array working.

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