Skip Wait Command via Switch

I need a script which would skip any [wait] command if a certain switch is on.
I've been looking for it on google and other places but I didn't find any script like this.
Can you tell us what you need this for?

Because the wait command works in a specific way - the wait command basically tells the main game loop "skip this event from processing for X frames". That is the reason why a wait improves performance of a parallel process - it forces the process to be skipped.
So what you're proposing needs a change in the game loop itself, not in an event command - and that should be handled with care.

So a bit more details on what you want to use this for will be really helpfull to whatever scripter tries this.
Enter this snippet right at the top of your custom script list:

Spoiler: Snippet
Code:
class Game_Interpreter

  def wait(duration)
    return if $game_switches[200]
    duration.times do
      break if $game_switches[200]
      Fiber.yield
    end
  end
 
end

Change the switch ID to what you want (the number 200 in the snippet).
Note that this will only skip the default "Wait" event commands. If a wait command is executed by other means (custom scripts, script calls), this will not work.

The "Wait" command is processed in the interpreter itself.
Each event has it's own interpreter, but only one can be run at a time, unless the event is a parallel process, in which case it will always be run until it's stopped.
When you use a "Wait" command, you will halt the processing of the event's interpreter, not the processing of the whole game.
Just for clarification. 😛
Enter this snippet right at the top of your custom script list:

Spoiler: Snippet
Code:
class Game_Interpreter

  def wait(duration)
    return if $game_switches[200]
    duration.times do
      break if $game_switches[200]
      Fiber.yield
    end
  end
 
end

Change the switch ID to what you want (the number 200 in the snippet).
Note that this will only skip the default "Wait" event commands. If a wait command is executed by other means (custom scripts, script calls), this will not work.

The "Wait" command is processed in the interpreter itself.
Each event has it's own interpreter, but only one can be run at a time, unless the event is a parallel process, in which case it will always be run until it's stopped.
When you use a "Wait" command, you will halt the processing of the event's interpreter, not the processing of the whole game.
Just for clarification. 😛

Thank you. It worked.

Original thread: https://forums.rpgmakerweb.com/threads/skip-wait-command-via-switch.74486/