MV Event Detectors

FEATURES
Adds basic functionality to check if events are within a certain distance of the player and if the player is in 180 degree line of sight.
In addition, behaviors can be set up for events to automatically act differently when detecting and not detecting, such as guards chasing when detecting the player and returning to their start location when they lose sight of them (this uses default pathfinding code so does not do long distances well).

VERSION 1.2 – RPG Maker MV
Download Plugin file
Download Demo

44 thoughts on “MV Event Detectors

  1. Freezegazer says:

    Woah! It’s cool! Thank You for interesting scripts.
    I’m really a fan of You.

    Cvrtis.

  2. Galaxyglow says:

    Ah sweet! I love sneaking in games, but Yanfly’s version was incompatible with your diagonal movement plugin. When it came between the two I chose yours. With this plugin I can do both!!

  3. Black Noise says:

    Nice plugin!
    I just tried this after Yanfly’s Event Encounter Aid and Event Chase Player plugins but I couldn’t find a way to get events to wander randomly before chasing the player and yours seems to fill that gap with a bit of tweaking here and there.

    Although I really want my events to play a sound effect every time they detect the player. Perhaps you could add that feature to individual behaviors in a future update?

    Thanks.

  4. Chandler Rounsley says:

    This plugin is awesome but I’ve encountered a bit of a bug when the chasing event gets stuck. It causes the game to drop to like 1 fps. The events get stuck if I use dev commands to walk through walls, or even if a different even gets in its way while it walks back to its start position.

    I don’t know if this is an error with my version or the whole plugin but I figured I’d let you know.

    • Galv says:

      Unfortunately it uses the default RPG Maker pathfinding which I have heard drops FPS at times when used on slower machines and I have no way to test this as I don’t have a machine that can replicate it unfortunately :(

      Not sure what you mean about walking through walls thing. I would need a project setup to look at what you’ve done before I can help any.

  5. Galv says:

    Ahh, if you are testing using this plugin then I wouldn’t advise using that debug through movement. I don’t plan to look into that particular issue

    • Chandler Rounsley says:

      That’s what I figured I’d do (stop using that) but then another event blocked the path back to the start point and the fps dropped in the same way.

      • Galv says:

        As in completely blocked the path? So the event couldn’t possible walk back to the start?
        I didn’t think of that, I think you might need to design your map to make that not possible to do perhaps.

  6. Superdude says:

    Is there any way to make the LOS a straight line? i.e. The NPC is looking straight at you with nothing in the way. The 180-degree arc complicates my game a bit too much.

  7. nick says:

    Awesome plugin. I was wondering if there was a way to invert the line of sight so it spreads outwards? Currently it creates a cone that is large near the event and gets smaller as it goes further away, can this be reversed so it operates more like the line of sight in a Metal Gear Solid style game?

  8. Adam says:

    This plugin is awesome! Is there a way to make the event store its original x and y once at the start of the game or set it somewhere manually? Having trouble making events go through doors as their “original” x y changes on teleport.

    • Galv says:

      Might have to add that in, but unfortunately I am very busy at the moment and can’t look into it right now. You could try asking in a forum to see if someone else can help in the meantime :)

      • Adam says:

        Thanks. I’ve tried asking in the forum but no one seems to be willing to help. How hard would it be to fix? Would you be able to direct me to what would need changing? Or is this something that’s quite complex.

      • Galv says:

        Not sure how hard it would be, but in order to tell you how to do it, I would first need to do it myself which I cannot at this time, sorry :(

      • Adam says:

        Got it to work. What I had to do is put the following code within the very last part of your plugin. Then put a comment in the event such as . It will then use that x and y as its go to point.

        for (var i = 0; i < page.list.length; i++) {
        if (page.list[i].code == 108 && page.list[i].parameters[0].contains("<post:")) {
        var myRegex = //;
        var matches = page.list[i].parameters[0].match(myRegex);
        this._origMovement.x = matches[1]; //the first number
        this._origMovement.y = matches[2]; //the second number
        break;
        }
        };

        The only thing that it’s missing is a way to pathfind through the doors. I reckon it would work if there was a way to create an invisible path leading from door to door through the walls and black parts. I reckon if you could specify regions that it will “ignore” much like you can specify regions that block LOS in the plugin.

  9. Mike says:

    Not compatible with HIME_CustomPageConditions :(

  10. Sean says:

    Great piece of work! But will this plugin count in walls and corners blocking line of sight, such that event won’t see the player if the player is on the other side of the wall?

  11. Alex says:

    Is there any possiblity to change a switch when the detection triggered?

    • Galv says:

      You could use a parallel process with ‘Conditional Branch SCRIPT’ to do anything when event detects. Read that section of the documentation for details.

  12. Boro Bro says:

    Really great plugin. But it seems like it’s poorly optimized. I got serious FPS drops every time I click on any event with “Action Button” trigger. I guess, the path finding gets harder for RPG Maker to process with this plugin on.

  13. Peter Snayde says:

    Hello Galv!
    It’s very nice script, but it’s missing something. Can I pay You for adding some functionality to this plugin, or to make additional plugin? I really need it, and Your plugin so far is the better solution for my need. I would glab to discuss it.

  14. Powerstranger says:

    Hi, is there a way to have the event follow its custom move route as a movebefore/moveafter? Thank you!

  15. Sarry says:

    Hi, Is there a way to put some light or whatever thing to let the player know the line of sight? Like if the Los is 3 there like a circle of 180 around the event to show it concretly. Thanks.

  16. Jack says:

    This is a very cool plugin, and I am trying to figure out how to make npc follow a certain route (patrolling) until it sees a player. When it sees a player it will try to catch you and if it misses you it will return to the original place and continue to patrol. Could you help me with that? Thank you in advance.

  17. Alex says:

    Hello!

    I have difficulties to realize how LOS look like? I’ts rectangle or semicircle/triangle? May someone provide picture for distance 3 for example with obstacles?

  18. InvictaNova says:

    Your plugin is really good and works fine and is very easy to use. But how do you combine your plugin detection functionality with a NPC that has custom movement? I mean instead of using the rand moveType. Basically, what I am planning to do is to have an event that is initially moving on a given custom route, when the event detects the player the even will “search” and when no longer detected will return to the original location, but will also re-continue on with the initial custom movement.

  19. cakragamedev says:

    Mr. Galv, It’s Possible that we can make the obstacles like walls, trees, barrels, pillars, etc. affect the npc’s 180 degrees Line Of Sight? And is there a way to make NPC unable to see player in specific regions including shadowy corners?

  20. GoatBoy says:

    Hi Galv,

    Would you consider porting this plugin to MZ?

    Regardless I love your plugins and appreciate all your hard work!

Leave a comment