Input Trigger Delay

I was wondering if anyone could help me make my custom menu pop up instantly after pressing the X key. I have to press the key several times to get the menu sometimes and other times it pops up right away. I will attach my event page that calls the custom menu.

Input Trigger Delay 1.PNG
Input.trigger? checks for a key being pressed down, not being held down. You'd be looking for Input.repeat?


Why do you have Change Menu Access: Disable in a parallel process event? That could be influencing it as well.
That is caused by a bug in the RTP scripts (the default scripts). Grab the fix!
Couldn't this be handled by the conditional branch button is being pressed default?
Couldn't this be handled by the conditional branch button is being pressed default?
The "Button is Being Pressed" doesn't work like "trigger?", it would evaluate to true more times than desired. The bug I mentioned would still be present though, so it is a good idea to grab the fix.
Actually, I thought that's what the OP WAS using.


You just need to add a Wait in there (when the condition is true) so it's not checking on every frame.
Actually, I thought that's what the OP WAS using.
Why? I thought you saw the "Input.trigger?" call since you said:

Input.trigger? checks for a key being pressed down, not being held down. You'd be looking for Input.repeat?
The problem is not because of a missing wait command or eventing error, it is a bug from the RTP scripts. (That's why I linked to the fix)

You just need to add a Wait in there (when the condition is true) so it's not checking on every frame.
No. Using a Wait command wouldn't fix the problem the OP is having because the event itself is not being processed every frame, as it should.

Here's the fix and explanation of the problem.
I did see Input.trigger? - I still thought it was just the "Button X is being pressed" in the Conditional Branch. It didn't click that it was a script command. What I SHOULD have said is to use the "Button X is being pressed" condition, not Input.repeat?, which I believe does the same thing.


The event IS being processed, but because the button is not being HIT every frame (as opposed to hit once and held down), the condition is not evaluating to true on every frame. There's only a single frame when it will actually detect it. Hence the need to press several times.
The event IS being processed, but because the button is not being HIT every frame (as opposed to hit once and held down), the condition is not evaluating to true on every frame. There's only a single frame when it will actually detect it. Hence the need to press several times.
No. Parallel Process events are not processed every frame due to a bug in RPG Maker VX Ace's default scripts.

Here's some of the topic where the problem is explained and a solution is provided:

How to corroborate the problem?

 

The easier way is to make a Parallel Process event report the game's frame count. To do that, simply create a Parallel Process event and add a Call Script command on it with the following:

Code:
p Graphics.frame_count
What causes the bug?​

 

Event "update" method setups the interpreter only if it is not "running":

 

Code:
 def update   super   check_event_trigger_auto   return unless @interpreter   @interpreter.setup(@list, @event.id) unless @interpreter.running?   @interpreter.update end

 

"running?" is defined as the following in Game_Interpreter:

 

Code:
 def running?   @fiber != nil end

 

and the "run" method for the interpreter is the following:

 

Code:
 def run   wait_for_message   while @list[@index] do     execute_command     @index += 1   end   Fiber.yield   @fiber = nil end
 

The problem is that the control is passed back to the caller before the "@fiber = nil" line is executed, so by the time of the next Event update cycle, the Interpreter is still "running" and won't setup again, making it skip one update cycle because when the Fiber gains back control, it will execute the pending "@fiber = nil" line, and the condition for the Interpreter update won't be met:

 

Code:
 def update   @fiber.resume if @fiber end

How to fix the problem?​
 

The solution is simple:

 

Code:
# Parallel Process Events Execution Bug Fix.# Version 1.0.0# 09/02/15 - DD/MM/YY# www.rpgmakersource.com# forums.rpgmakersource.comclass Game_Interpreter  # Overwrites default method with the fixed version.  def run    wait_for_message    while @list[@index] do      execute_command      @index += 1    end    @fiber = nil    Fiber.yield  endend

Pasting the above code right below the default scripts, or anywhere below Game_Interpreter and above any custom script, will fix the problem.
No. Parallel Process events are not processed every frame due to a bug in RPG Maker VX Ace's default scripts.

Here's some of the topic where the problem is explained and a solution is provided:

How to corroborate the problem?

 

The easier way is to make a Parallel Process event report the game's frame count. To do that, simply create a Parallel Process event and add a Call Script command on it with the following:

p Graphics.frame_count
What causes the bug?​
Spoiler
 

Event "update" method setups the interpreter only if it is not "running":

 

Code:
 def update   super   check_event_trigger_auto   return unless @interpreter   @interpreter.setup(@list, @event.id) unless @interpreter.running?   @interpreter.update end

 

"running?" is defined as the following in Game_Interpreter:

 

Code:
 def running?   @fiber != nil end

 

and the "run" method for the interpreter is the following:

 

Code:
 def run   wait_for_message   while @list[@index] do     execute_command     @index += 1   end   Fiber.yield   @fiber = nil end
 

The problem is that the control is passed back to the caller before the "@fiber = nil" line is executed, so by the time of the next Event update cycle, the Interpreter is still "running" and won't setup again, making it skip one update cycle because when the Fiber gains back control, it will execute the pending "@fiber = nil" line, and the condition for the Interpreter update won't be met:

 

Code:
 def update   @fiber.resume if @fiber end

How to fix the problem?​
 

The solution is simple:

 

Code:
# Parallel Process Events Execution Bug Fix.# Version 1.0.0# 09/02/15 - DD/MM/YY# www.rpgmakersource.com# forums.rpgmakersource.comclass Game_Interpreter  # Overwrites default method with the fixed version.  def run    wait_for_message    while @list[@index] do      execute_command      @index += 1    end    @fiber = nil    Fiber.yield  endend

Pasting the above code right below the default scripts, or anywhere below Game_Interpreter and above any custom script, will fix the problem.
Thanks you code snippet worked like a charm thanks a lot. I will close this topic now.
Thanks you code snippet worked like a charm thanks a lot. I will close this topic now.
Great! You're welcome :3 (You might want to post in the topic I linked so it comes up again and more people see it, since it seems it is an unkown/ignored problem.)
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/input-trigger-delay.40162/