Parallel Process to check if the player is in an event’s line of sight?

Hiya, so I want to make a stealth section in my game. Very simple, like the Deku Palace in Majora’s Mask.

I just want an event to play out whenever the player in within an event’s line of sight. So, if the event is facing to the right, every tile in a straight line in front of them would be where the player would get caught.
A simple starting point would be great, because then I can adapt it to match the amount of patrolling events on the map.

If it makes it simpler, it doesn’t matter if the events can see the player through walls.

Thanks in advance to anyone willing to help. 🙂
Using variable operations command (or control variables? Or how it's called), you'd set event and player's x into different variables and then compare them to see if the two variables are the same. Same for their y's.
Hiya, so I want to make a stealth section in my game. Very simple, like the Deku Palace in Majora’s Mask.

I just want an event to play out whenever the player in within an event’s line of sight. So, if the event is facing to the right, every tile in a straight line in front of them would be where the player would get caught.
A simple starting point would be great, because then I can adapt it to match the amount of patrolling events on the map.

If it makes it simpler, it doesn’t matter if the events can see the player through walls.

Thanks in advance to anyone willing to help. 🙂

Here's my theory:
Make multiple lines of events around the "see-r". Give them the same movement route as the "see-r" and make sure they are all set to "event touch" and have "through" checked.

To make sure its within the "see-r's" line of sight (using custom routing), make a switch that activates when the "see-r" turns in that direction, only applying to the direction they are in, and deactivates whenever the turn away, activating the next direction's switch. (I know it's tedious, but bear with me here)

Make it so that switch activates whatever happens when the player is seen.

It's not the best idea, but I tried. (Poryg's idea is probably simpler)

If there's anything I didn't explain enough, let me know.​

By the line does it refer to the X or Y coordinate, wouldn't it be better from a distance, using a simulated radial field of view?I'm not at home to remember how to write it correctly:
Code:
@>Variable[Distance_X] = This event's Map X
@>Variable[Distance_Y] = This event's Map Y
@>Variable[Distance_X] -= Player's Map X
@>Variable[Distance_Y] -= Player's Map Y
@>Conditional: Variable[Distance_X] < 0
    @>Variable[Distance_X] *= -1
 : End
@>Conditional: Variable[Distance_Y] < 0
    @>Variable[Distance_Y] *= -1
 : End
@>Variable[Distance_X] += Variable[Distance_Y]
@>Conditional: Variable[Distance_X] < 10
    @>Comment: Activate what you need here regarding the NPC event, probably a Switch
 : End
But remember, it is not possible to check the existence of walls with this simple method.

I would do a single event to check all the NPCs in sequence, which would avoid loss of frames and more practical control of each NPC's Switch.
Code:
@>Variable[Distance_X] = EV0009's Map X
@>Variable[Distance_Y] = EV0009's Map Y
@>Variable[Distance_X] -= Player's Map X
@>Variable[Distance_Y] -= Player's Map Y
@>Conditional: Variable[Distance_X] < 0
    @>Variable[Distance_X] *= -1
: End
@>Conditional: Variable[Distance_Y] < 0
    @>Variable[Distance_Y] *= -1
: End
@>Variable[Distance_X] += Variable[Distance_Y]
@>Conditional: Variable[Distance_X] < 10
    @>Switch: Soldier 1 turn On
: Else
    @>Switch: Soldier 1 turn Off
: End
@>Variable[Distance_X] = EV0010's Map X
@>Variable[Distance_Y] = EV0010's Map Y
@>Variable[Distance_X] -= Player's Map X
@>Variable[Distance_Y] -= Player's Map Y
@>Conditional: Variable[Distance_X] < 0
    @>Variable[Distance_X] *= -1
: End
@>Conditional: Variable[Distance_Y] < 0
    @>Variable[Distance_Y] *= -1
: End
@>Variable[Distance_X] += Variable[Distance_Y]
@>Conditional: Variable[Distance_X] < 10
    @>Switch: Soldier 2 turn On
: Else
    @>Switch: Soldier 2 turn Off
: End
This is a simple example, I would do it with Call Event to save money, but I would need to explain the use of a variable as a pointer to find the Switch.

Original thread: https://forums.rpgmakerweb.com/threads/parallel-process-to-check-if-the-player-is-in-an-events-line-of-sight.169790/