XP Freeze event when player can't move

To put it simply, I want to find a way to force specific events to stop when the player is stopped by a text message, wait command and similar things that make the player lose control of the character.
I have an event that chases down the player and gives them a game over if they're caught. However, if a player runs into, for instance, an item or a locked door, the text will show up, and while the player will be stopped, the event won't, resulting in an unfair death if the event ends up catching them.
I want to find a way to force that event to stop moving if that happens, but no other event to be affected. I have been looking for a possible switch in the code that determinates whenever the player is allowed to control the character, but I had no luck in it.
Have each locked door and item turn on a switch that activates page 2 of the chasing event that is set to no movement and turn it off after?
Have each locked door and item turn on a switch that activates page 2 of the chasing event that is set to no movement and turn it off after?
It's far too inefficient, since chases are a reocurring part of the game. Manually putting down switches would be a complete hassle, so finding an universal solution is what I'd like to try first
Not sure how a mechanic that happens exactly at the point it needs to happen could possibly be less efficient than a blanket solution that needs to happen every frame, but good luck with that then.
If that is too inefficient, then you will need a script of some sorts that does it for you. And not sure such one exists for XP. So you may have to do it the way Mr Orc said or do without the feature. Or learn to code it.
It's far too inefficient, since chases are a reocurring part of the game.
While there may be a solution someone else can provide, I am going to tell you now that this is unfortunately a poor attitude to have for game development. Sometimes we have to do tedious things to make our games better.

In a similar way, midway through my own game's development, I realized I needed something somewhat similar to yours - requiring that I run a common event at the start and end of every cutscene in the game. At this point in development, that was a lot of cutscenes.
You know what I did?
I put on some kick ass tunes and spent an evening copy-pasting a cutscene common event across all of my cutscenes.

By spending that time back then, I have by far made up in efficiency elsewhere, because the number of times I have needed to adjust the start or end of a cutscene has been inumerable, but because I went back and added that cutscene common event to every cutscene, it's made those changes much easier going into the future.

My suggestion: Wait and see if someone who is proficient with XP can offer an easy solution, however, start making a playlist because if no one replies, get ready to grind.
Hmm, I think the Ruby 'Window_Message' script/code that is called when you open a 'normal' text window in RMXP. So you should be able to use a flag or put a condition in your 'front end' in editor event that starts the chase process. Then switch that condition 'Off' from the Ruby code scripting event when a text window opens. Not something I've ever needed to do. But I don't see why it wouldn't work... Off the top of my head, without looking into it!

I don't have time to look into it just now and probably won't be back home to test something like this until the end of the week (hopefully). To be honest I'm not sure why your 'chaser' is still moving when the text box comes up. I did something similar a while ago and can't remember having that issue.
If you are looking for a scripted solution you could try something like this (it should skip all movement updates if you set up your event, although I have not tested it due to not having XP installed):
Ruby:
# ===========================================================================
# Put this script below Scene_Debug, but above other added scripts if possible.
# Put this script below other scripts that stop this script from functioning.
#
# Pause Event Movement during Cutscenes:
# 
#   EVENT.freeze_during_cutscenes = true   # <- Halt all Movement in Cutscenes
#   EVENT.freeze_during_cutscenes = false  # <- Resume all Movement in Cutscenes
#
# Replace EVENT with:
# 
#   self                 # <- In a Move Route (targets the moving event)
#   $game_map.events[ID] # <- Event (replace ID with event ID, no leading zeroes)
#   $game_player         # <- The player character
#
# For events this setting will reset when the player leaves the map.
# ===========================================================================

class Game_Character
 
  attr_accessor :freeze_during_cutscenes

  alias_method(:update_outside_cutscene_frozen_movement, :update)
  def update
    if @freeze_during_cutscenes &&
    ($game_system.map_interpreter.running? || $game_temp.message_window_showing)
      return
    end
    update_outside_cutscene_frozen_movement
  end
end

Outside of scripts, another convenient way to stop an event from moving would be giving it an empty, repeating move route that cannot be finished. To make the event move again, give it an empty, non-repeating one.
(Either way, this won't stop the event from finishing its current move)

I also definitely agree with TheAM-Dols approach. Having to add an extra common event call everywhere can be an annoying limitation of the event system, but it can also be a really effective tool.
While there may be a solution someone else can provide, I am going to tell you now that this is unfortunately a poor attitude to have for game development. Sometimes we have to do tedious things to make our games better.

In a similar way, midway through my own game's development, I realized I needed something somewhat similar to yours - requiring that I run a common event at the start and end of every cutscene in the game. At this point in development, that was a lot of cutscenes.
You know what I did?
I put on some kick ass tunes and spent an evening copy-pasting a cutscene common event across all of my cutscenes.

By spending that time back then, I have by far made up in efficiency elsewhere, because the number of times I have needed to adjust the start or end of a cutscene has been inumerable, but because I went back and added that cutscene common event to every cutscene, it's made those changes much easier going into the future.

My suggestion: Wait and see if someone who is proficient with XP can offer an easy solution, however, start making a playlist because if no one replies, get ready to grind.
Yes, I understand...what I'm doing right now IS going back and updating a system that covers a lot of maps as well, which I had to do a lot across the development of the game. Still, I want to try seeing if I can do anything else before trying the tedious solution
If you are looking for a scripted solution you could try something like this (it should skip all movement updates if you set up your event, although I have not tested it due to not having XP installed):
Ruby:
# ===========================================================================
# Put this script below Scene_Debug, but above other added scripts if possible.
# Put this script below other scripts that stop this script from functioning.
#
# Pause Event Movement during Cutscenes:
#
#   EVENT.freeze_during_cutscenes = true   # <- Halt all Movement in Cutscenes
#   EVENT.freeze_during_cutscenes = false  # <- Resume all Movement in Cutscenes
#
# Replace EVENT with:
#
#   self                 # <- In a Move Route (targets the moving event)
#   $game_map.events[ID] # <- Event (replace ID with event ID, no leading zeroes)
#   $game_player         # <- The player character
#
# For events this setting will reset when the player leaves the map.
# ===========================================================================

class Game_Character
 
  attr_accessor :freeze_during_cutscenes

  alias_method(:update_outside_cutscene_frozen_movement, :update)
  def update
    if @freeze_during_cutscenes &&
    ($game_system.map_interpreter.running? || $game_temp.message_window_showing)
      return
    end
    update_outside_cutscene_frozen_movement
  end
end

Outside of scripts, another convenient way to stop an event from moving would be giving it an empty, repeating move route that cannot be finished. To make the event move again, give it an empty, non-repeating one.
(Either way, this won't stop the event from finishing its current move)

I also definitely agree with TheAM-Dols approach. Having to add an extra common event call everywhere can be an annoying limitation of the event system, but it can also be a really effective tool.

It worked out perfectly! Thank you a lot!

Original thread: https://forums.rpgmakerweb.com/threads/freeze-event-when-player-cant-move.181453/