I'm having trouble with events blocking other events.

Right now, I have one friendly NPC set to random. And one hostile NPC set on a patrolling path. And I don't want them to block each other's movement route. But I still want the player to be able to interact with both of them. The hostile NPC will make the player fight it if the NPC runs into the player or the player runs into it. The friendly NPC will only react if the player interacts with it. The friendly NPC can stop the hostile one, and when it moves, the hostile one continues on its path.
Seems to me like the easiest solution would be to block the random route NPC from walking into the path of the patrolling one.

I'm not familiar with the RMVXAce. IIRC in RM2k you could accomplish this by making a little "cage" out of empty events and place the roaming NPC in it. This doesn't work anymore in vanilla RMMV so they obviously got rid of it at some point, but there is a chance it might still in the maker you're using. So I would try to experiment with that.
That would be done with Regions. The hostile NPC parols in a loop so there is nowhere for the friendly NPC to go. I want the player to have to catch the friendly NPC.
Can you show a picture of the map with the patrol route marked on it? I'm unable to visualize this properly.
The 1st is the Hostile NPC patrol path and the friendly one is in the middle of it. There are also 5 other friendly and hostile NPCs that cross paths.
MINER ISSUES.PNG
Through on?
Have you try to turn on Through in Event Option yet?

1691667057567.png
The friendly NPC can stop the hostile one, and when it moves, the hostile one continues on its path.
This implies you want a pause and wait function for when the hostile npc can't move due to the friendly npc blocking the way.
And I don't want them to block each other's movement route.
That could also mean that the hostile npc will move even if the friendly npc is blocking, so they will be on top of one another at one point.

Here is a way to make it so that the patrolling npc will not stop if running into the friendly npc.
Try this - put a comment on the npc that is patrolling. <patrol>
This code will also allow an npc to move over another event that is below characters.
Ruby:
class Game_CharacterBase
  def collide_with_events?(x, y)
    $game_map.events_xy_nt(x, y).any? do |event|
      return false if (self.is_a?(Game_Event) && patrol)
      event.normal_priority?
    end
  end
  def patrol
    self.list.each do |line|
      if line.code == 108
        return true if line.parameters.include?("<patrol>")
      end
    end
    return false
  end
end
Have you try to turn on Through in Event Option yet?

View attachment 272856
Through on?
No 'through on' would prevent the player from interacting with them.
Ruby:
event.normal_priority? || (self.is_a?(Game_Event) && event.normal_priority?)

That condition has an unnecessary redundancy. It turns out that it doesn't matter if the character is the player or any event, using just event.normal_priority? as its conditional statement is more than enough to pass the test.
This implies you want a pause and wait function for when the hostile npc can't move due to the friendly npc blocking the way.

That could also mean that the hostile npc will move even if the friendly npc is blocking, so they will be on top of one another at one point.

Here is a way to make it so that the patrolling npc will not stop if running into the friendly npc.
Try this - put a comment on the npc that is patrolling. <patrol>
This code will also allow an npc to move over another event that is below characters.
Ruby:
class Game_CharacterBase
  def collide_with_events?(x, y)
    $game_map.events_xy_nt(x, y).any? do |event|
      return false if (self.is_a?(Game_Event) && patrol)
      event.normal_priority? || (self.is_a?(Game_Event) && event.normal_priority?)
    end
  end
  def patrol
    self.list.each do |line|
      if line.code == 108
        return true if line.parameters.include?("<patrol>")
      end
    end
    return false
  end
end
It already has a pause wait function. Someone suggested using X and Y coordinates so the friendly NPC would move away from the Hostile NPC. Your way sounds easier.
I just crafted a script that will let you create "sheep" aka friendly NPC that will never go beyond the area with a predefined Region ID.

You can read all the details pertaining to this script of mine here.
I just crafted a script that will let you create "sheep" aka friendly NPC that will never go beyond the area with a predefined Region ID.

You can read all the details pertaining to this script of mine here.

Ruby:
# * EventRegionBox ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-08-11

# The present script allows you to restrain the movements of any given event
# to a very specific region on the map.

# If there are multiple areas on the map with the same Region ID, that event
# will simply stay in its respective area.

# If a given Event's Region ID has never been defined, that Event will move
# randomly and there is no way to know where it may go next.

# * Script Calls * #

# - Set a given Event's Region ID - 2 Options:
# this_event.fixed_region_id = Number
# $game_map.events[EventID].fixed_region_id = Number

# - Set a given Event's Custom Route and add a Script Call there:
# move_same_region

class Game_Event
  def random_direction
    @direction = 2 + rand(4) * 2
  end

  def same_region_next?(nx, ny, d)
    return unless passable?(@x, @y, d) and passable?(nx, ny, d)
    $game_map.region_id(nx, ny) == @fixed_region_id
  end

  def next_x
    $game_map.round_x_with_direction(@x, @direction)
  end

  def next_y
    $game_map.round_y_with_direction(@y, @direction)
  end

  def move_region_next_xy
    @move_succeed = same_region_next?(next_x, next_y, @direction)
  end

  def move_region
    3.times do
      random_direction
      move_region_next_xy
      break if @move_succeed
    end
    if @move_succeed
      @x = next_x
      @y = next_y
      @real_x = $game_map.x_with_direction(@x, reverse_dir(@direction))
      @real_y = $game_map.y_with_direction(@y, reverse_dir(@direction))
      increase_steps
    else
      check_event_trigger_touch_front
    end
  end

  def move_same_region
    @fixed_region_id ? move_region : move_random
  end
  attr_accessor :fixed_region_id
end

class Game_Interpreter
  def this_event
    $game_map.events[@event_id]
  end

  def move_same_region
    this_event.move_same_region
  end
end
Bad news. I already have a script that does that.
That won't make me remove it. 😛
My script has secondary features that makes it easy to handle, guys. 😀
Yes, that's basically Yanfly Engine Ace - Move Restrict Region with the same issue of preventing free-roaming friendly NPC from moving around most of the map. It would be stuck in small areas. And the idea is the player has to catch them. Even now, with it at top speed, it still isn't much of a challenge.
Ruby:
event.normal_priority? || (self.is_a?(Game_Event) && event.normal_priority?)

That condition has an unnecessary redundancy. It turns out that it doesn't matter if the character is the player or any event, using just event.normal_priority? as its conditional statement is more than enough to pass the test.
Tested further and true. This was taken from my project, which I must have something that blocks the normal behavior. When I added that in it worked as expected for normal events.
My EventRegionBox seems to have solved the blocked passage issue for my patroller and my sheep. I don't think my script works in the same way as Yanfly's for mine is mainly focused on the sheep aka ally and just a bit on the patroller aka enemy.

Original thread: https://forums.rpgmakerweb.com/threads/im-having-trouble-with-events-blocking-other-events.160173/