Automatically turn stepping animation off

Does anyone have/know a script/method to automatically turn all stepping animation off in all events (in map the player is) every time dialogue starts, and resume once dialogue ends?
Code:
class Game_Event < Game_Character
  alias amn_evstep_gameevent_update update
  def update
    amn_evstep_gameevent_update
    return unless @page
    @step_anime = $game_message.busy? ? false : @page.step_anime
  end
end
Paste that as a new script under Materials and above Main.

It may not work if you've set stepping animation on using a move route.
@A-Moonless-Night
Thanks, it works, except the player character that has his stepping animation set up through a move route by a pararell process event. Do you know of any other way to set player's stepping animation except through move routes? Maybe there is some way to make the game ''pause'' while dialogue starts, like when the menu opens everything ''freezes''?

Edit: Also, another thing, is it possible for the bgm to automatically based on what character is the first in the party line-up, BUT only change for one(or more) particular map(s)? For example, in the village, regardless of the line-up, the music remains the same, but in the world map, if X is first in the line-up, the music changes to X, but if Y is the first, the music returns to normal.
Everything "freezes" when the menu opens because you're not actually on the map anymore. It took a picture of the map prior to opening the menu and is showing that picture as the menu background. You couldn't do that with messages because even though you might be able to show a picture behind the message window, all the events on the map are still moving, so when you remove the picture, some events will snap to different places (where they'd moved to while the message was visible).

Your Edit question is completely unrelated to your original question, so you should post that in its own thread.
@Shad
Alright, but is there a way to set player's stepping animation except through move routes?

Also, I posted the Edit question here bcz I thought it's a minor/simple thing that didn't deserve its own thread.
In that case, you could probably do this instead:
Code:
class Game_Character
  def update_anime_pattern
    return if $game_message.busy? && !@move_route_forcing
    super
  end
end

class Game_Player < Game_Character
  alias amn_evstep_gameplayer_movebyinput move_by_input
  def move_by_input
    return if $game_message.busy?
    amn_evstep_gameplayer_movebyinput
  end
end

class Game_Event < Game_Character
  alias amn_evstep_gameevent_updateselfmovement update_self_movement
  def update_self_movement
    return if $game_message.busy? && !@move_route_forcing
    amn_evstep_gameevent_updateselfmovement
  end
end

This will stop events and the player from moving or having their stepping animation on while a message is displayed.
@A-Moonless-Night
Thank you, it works perfectly for what I need! 🙂
If you really want everything to be frozen during messages, you only need this:
Spoiler
Code:
class Scene_Map < Scene_Base

  alias freeze_screen9992 update
  def update
    if $game_message.busy?
      super
    else
      freeze_screen9992
    end
  end
 
end
This will stop every other processing, literally, so all map graphics will freeze until the message box is gone.
@Sixth, thanks, I tried your version and it's pretty much the same as Moonless-Night's, haven't noticed any huge different.

In any way, case solved, mod can close this thread.

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/automatically-turn-stepping-animation-off.102773/