Wait for key input script?

So I was on a roll in my game until I hit a roadblock. Due to the way I'm displaying images (making text fade like the intro to Final Fantasy 1) I'm unable to "event" this with any luck...

What should have been simple has stumped me all week. I would like to request a script that pauses the event and waits for key input to continue. Such as:

Displays image

[Waits for input]

Displays another image

If there is a way to event this I'm all ears, but I think a script would be simpler for the developer (going to have a bunch of these events) and the developer wouldn't have to guess the users reading speed with timing. 
You could just display the image and then immediately afterwards call up a blank, transparent text box. Once the player closes the text box, then you can erase the first image and show the next.
try to make a loop with an conditional inside which checks for input and if there was break out of the loop
There is a script written by Tsukihime which can do exactly this.


It operates with a script call which checks if any key was pressed or not.


You can find it easily here, just search for Tsukihime's topics.


Or if you want a specific key trigger, you don't need a script for that one.


Make your event, show the picture, than make a loop command.


Inside the loop command, make a conditional branch with a script call.


The script call looks like this:

Input.trigger?🙂C)This specific script call returns true if the player presses the confirm button, else it returns false.
So, in the 'true' part, you need to make a 'break loop' command.


In the 'else' part, you add a simple 'wait' command with 1 frame.


Any command(s) below the loop command will execute only if the player presses the confirm button.


You can change ':C' to any valid button input symbol if you want a different button trigger, of course.


And these should be the basics of eventing a "waiting for button press" thing.


Basically, it is just a loop command and a conditional check.


This looks the same with Tsukihime's script, except you use the new script call which is provided with that script. That would make it so the event continues with any button press, not only with a specific one.
try to make a loop with an conditional inside which checks for input and if there was break out of the loop
Problem with that is the fade affect repeats until I press sumthin'...

You could just display the image and then immediately afterwards call up a blank, transparent text box. Once the player closes the text box, then you can erase the first image and show the next.
That is the next alternative (will probably use this if I can't find a script) problem with that is it leave the window skin system icon, also waits for any key to be pressed, I'm looking for a specific key, or just one key. But like I said, I'll prolly end up using this hackish method. 

EDIT: Interesting Sixth, I'll try that. 😀
Which fade effect?

I ment exactly the same as Sixth and there is no need to use Input.trigger?🙂C) in the conditional.

There is an option for button press just above the script command in the conditional window.
It's an effect that loads the text through images that gives the effect of "fading". Example below.

tumblr_inline_mpf1h8TEyS1qz4rgp.gif


I read the loop and event tutorials (nice read) but that only loops the fading effect like above, I'm more looking for the even to wait or pause until a button or trigger is pressed. That or I'm just not good enough at eventing. Hmmm
That default button press checker is faulty, sometimes registers, sometimes not and sometimes it registers twice of more times. I never use that.


And with that one, you can't make custom input trigger checkers, only the default inputs are included.


Another reason why I don't use that, but I guess it depends if someone uses a custom input script or not.


And yeah, the event will simply wait until the button is pressed.


Nothing executes before that.
Perhaps you could spend a few moments of your valuable time Sixth to show me in the event window? I simply can't figure it out, I'd greatly appreciate it. loop inside of a loop with conditional branching still sounds cumbersome heh but I'll take whatever I can get.
Sorry, went to code a bit. 😀


Actually it is easier than you would think. 😛


Having a looping image sequence running in the meantime complicates it a bit, but it is still manageable without scripts.


But I have no idea if this is a good solution, because I don't know how many times and with how many different image sequences would you do this.


Anyway, here is how I did quite a few quick-time events in my project:


First, you need a common event with a parallel process. Parallel process events are looping by default, so we don't need a loop command there.


Here is a simple animation with pictures made with a parallel common event:


loopend2.PNG


When you made your common event, you can use it in actual events like this:


loopend1.PNG


Here is what this event will do:


1. Just a text showing that our event started.


2. Turns ON the switch needed for the above made common event.


3. Enters the loop section after this.


4. Waits for the player to press the confirm button.


5. While the event waits for the button press, the pictures would still play on the screen effectively making an animation.


6. When the player press the confirm button, it turns OFF the switch needed for our parallel common event which stops the common event and exits the loop.


7. Erases the last (and only) picture on the screen.


8. A text message appears after to inform us that the event continues to execute the commands below the loop immediately after the player pressed the confirm button.


This works like a charm.


If you are planning to make a whole message system with looping pictures, I can't recommend this method, because it would either take hell of a lot common events (1 for each message), or an extremely long common event, possibly even more of them, because I suppose there is a limit of lines for every common or regular event. You can reduce the common events needed with conditional check in the common events for each message, but that would still take a lot of common event.


But if you are showing these messages only a few times (well, let's say not more than 100 different image sequence), than I would go with this method.
The "proper" way to wait for input is to make a script call like this

Fiber.yield until Input.trigger?🙂C)Or something like that. The reason why using a show text command works is because it will simply yield until you press B or C buttons.
You can't rely on a conditional branch because it doesn't wait for you.
Thanks for the reply, its cool take your time can't complain when your trying to help. That just loops the same animation, making it consistently fade in and out, I want to only fade out when a button is pressed (or switch to another image)

Here maybe this can better illustrate what I'm trying to do...

Screenshot_1.png
You can't rely on a conditional branch because it doesn't wait for you.
It does wait if you put a wait command in the 'else' part in the loop.
But that script call should also do the trick, yeah.


So, you want to show an image sequence, stop in the middle (or somewhere), wait for the player, than do another image sequence, rinse and repeat multiple times if needed?


You don't even need a common event for that. 😀


I thought you wanted to loop the images too.


So, just make your fade in image sequence and after that enter the loop with the conditional check in the event command list.


After the loop, make your fade out animation.


If you want to start another fade in effect, put it after the fade out effect, than the looping conditional check again, and the fade out effect, rinse repeat.


Basically, you just need to put the looping conditional check between the fade in and fade out effects where your transparent text messages are now).


Or you can simply put the script call Tsukihime wrote instead of the looping conditional check method between them, both will do the same.

Original thread: https://forums.rpgmakerweb.com/threads/wait-for-key-input-script.34820/