MZ Line of Sight

Hello everyone, how are you?
Firstly I would like to apologize if I posted in the wrong place, I'm still understanding how it works here. I'm new, I've always browsed Brazilian forums, but this in this one is my first time.

I'm looking for a way to build a very simple system, however, I have no experience with plugins and very little experience with script calls.

I'm looking for a system in which an event detects the player within a range. For example:
A player is passing at X distance, the event/enemy notices him and a battle begins.

My intention is to use the tactical battle system to have battles take place on the map as the player explores.
You can google 'line of sight plugin for rpg maker mz' and see if any of those work with your 'tactical battle system' (is that a plugin?). I know VisuStella Encounter Effects has line of sight.

You could also event it, by keeping your monster events parallel (or running scripts in the move route?). Check monster direction, monster position and player position and then check the distance.
You can google 'line of sight plugin for rpg maker mz' and see if any of those work with your 'tactical battle system' (is that a plugin?). I know VisuStella Encounter Effects has line of sight.
Yes, it is a plugin. I'm using the SRPG Gear MZ - Tactical Battle system, but it's more like 'Fire Emblem' in which the battle takes place on a specific map with victory conditions, etc. And I wanted something more dynamic, where the player could explore the map and when he entered the enemy's line of sight the battle would start right there. And so I thought about trying to modify the system myself, since from what I understand, it is possible to do this via events with the right plugin commands and scripts.
You could also event it, by keeping your monster events parallel (or running scripts in the move route?). Check monster direction, monster position and player position and then check the distance.

I was thinking about in how to make checking the X and Y position work, I confess that I hadn't thought about taking the event position and the player position and storing it in a variable, I immediately started thinking about Script Call. But maybe you gave me an idea. I'll test it and as I go I'll edit this comment and post the progress of this, but if anyone else has an idea on how to do it, I'd gladly accept help.

Original thread: https://forums.rpgmakerweb.com/threads/line-of-sight.168289/