A downloadable plugin

A plugin that activates a switch/self-switch when an event is close to the player. The user can designate line of sight obstacles with region IDs and/or terrain tags.

Who is this for?

Games with real-time enemies (like horror games), stealth sequences, or puzzles. Also useful for hit detection and triggering events from afar.

Made for RPG Maker MZ.

Updates

v1.1 - Added "Facing in a Line"

v1.2 - Switches now toggle; improved compatibility

Terms of Use

Free for commercial and non-commercial use. Please credit me if you found it helpful.

Updated 7 days ago
StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(3 total ratings)
Authorreflector88
Tagsline-of-sight, RPG Maker MZ, script

Download

Download
r88_ProximitySensor.js 9 kB

Install instructions

1. Put the .js file in your project's js/plugins/ folder.

2. In RMMZ, open the Plugin Manager through the Toolbar.

3. Double click an empty line, then use the "Name:" box to select "r88_ProximitySensor".

Development log

Comments

Log in with itch.io to leave a comment.

hey,. this has... fixed video games. thank you


(I was using a much more limited plugin designed for MV and encountering Issues. this is exactly what I was looking for, fixed the issue I was dealing with, and honestly caused me to neaten up my code a bit while reorganizing things to get it all working nicely. my eternal thanks to you and your work)

Just what I was looking for, thank you so much! Is it possible to make it activate when it's facing the player in a straight line? So a combination of Facing and Orthogonal. 

Roku, I've updated the plugin and added a "Facing in a Line" option.

Oh man, can't believe you did it and so fast, thanks so much!

Very cool!

Does this work with NPCs that follow a set movement path or is it for stationary only?

Davey,

It works with moving things as well. Note that the sensor only checks once (you have to set the event as a parallel process if you want it to check continuously), so I recommend you put your custom route in the sidebar instead of using the "Set Movement Route" event command.