MV Stealth in one line

I am working on a project, and I want to add a little stealth section. I am using Yanfly's EventChasePlayer plugin to get the enemies to only react when my player is in their line of sight. However, they don't just look right ahead of them, but also to the side (I think they have a line of sight of 180 degrees). I want the enemies to only notice the player when they are in a straight line in front of them.

Any ideas on how to accomplish that?
Something like this springs to my mind: (Note that you need five variables for this)
Code:
Control Variables : #0001 Player X = Map X of Player
Control Variables : #0002 Player Y = Map Y of Player
Control Variables : #0003 Event X = Map X of This Event
Control Variables : #0004 Event Y = Map Y of This Event
Control Variables : #0005 Event Direction = Direction of This Event

If : Event Direction = 2
  Comment: Event facing South
  If : Player X = Event X
    Comment: Same X coordinate
    Set Movement Route : This Event
      :<>Script: this._chaseRange = 4
  End
End

If : Event Direction = 4
  Comment: Event facing West
  If : Player Y = Event Y
    Comment: Same Y coordinate
    Set Movement Route : This Event
      :<>Script: this._chaseRange = 4
  End
End

If : Event Direction = 6
  Comment: Event facing East
  If : Player Y = Event Y
    Comment: Same Y coordinate
    Set Movement Route : This Event
      :<>Script: this._chaseRange = 4
  End
End

If : Event Direction = 8
  Comment: Event facing North
  If : Player X = Event X
    Comment: Same X coordinate
    Set Movement Route : This Event
      :<>Script: this._chaseRange = 4
  End
End

I can't test it right now, but it should work. Someone might have a prettier approach though.
Thanks! I'll try it out
It doesn't seem to be working. I tried putting the event on parallel, but that also doesn't work. I pretty much copied exactly what you suggested, as you can see in the attachments. Also, I would like walls to block the line of sight of the event.
Do you have any ideas on that?
Hmm, after finding the time to try this out, it indeed seems the plugin forces a 90 degree field of view. I think changing that requires fiddling with the plugin code, but my first attempts at that did not help.

I'm afraid I cannot be of any more help here. Hopefully somebody else will be able to step in.

For reference, I *think* that changing the function Game_Event.prototype.updateChaseDistance might have the answer you're looking for, but as I said, I did not manage to do it. Sorry.

I think the best way to have walls block line of sight might be to use the extension plugin Event Chase Stealth and to fiddle with it's settings, but seeing as it is a paid plugin, you might want to try another approach.

Original thread: https://forums.rpgmakerweb.com/threads/stealth-in-one-line.132474/