This one could have saved me a ton of time today as I had to write a custom script to do what I wanted. It would also save a ton of Event duplication for everyone. What I needed was a Trigger condition that fired when the player came within a certain distance of an event. It's essentially a Player Touch Trigger but with a specified radius. I tried to use two different plugins (EventChasePlayer and EventTouchRadius) but each one was focused towards something other than what I was trying to do and ended up not not working for me.
Then I got to thinking. How many times have I copied and pasted the same Event because I needed to cover a 3-5 width hallway? I mean, who wants to unnaturally bottleneck the players every time you need to fire off an Event? I've only been using RPG Maker for a month and I've run into this many times. So here's my suggestion. It's not drop-dead simple but I managed to parse through the scripts and get it hacked in, in less than a day, so I think it's doable. First, add extra options to the Player Touch and Event Touch Triggers that allow you to specify an X-Range and/or a Y-Range. If you specify an X-Range, it goes that many tiles in each direction on the x-axis. Same thing for Y accordingly. If you specify both, you get a touch radius, not just straight lines. If you leave them both at the default zero, the event only triggers if you touch that square as it does today. The image below represents the radius for these three conditions.
1. Player Touch: X-Range = 0, Y-Range = 1
2. Player Touch: X-Range = 2, Y-Range = 0
3. Player Touch: X-Range = 2, Y-Range = 2

If you want to make this easier, separate out the radius option in some way so you don't have to deal with elliptical ranges. I can see that possibly being a pain to deal with. As long as I could specify a line in either direction in order to cover a hallway with a single Event and also make a "You're within n squares of event" Trigger, I think that would be an extremely useful addition to the RPG Maker product for both developer and resource management.
Thanks for hearing me out!
Code
Here's the code that handles Player Touch.
https://forums.rpgmakerweb.com/index.php?threads/frogboy-trigger-distance.88311/#post-804275
Then I got to thinking. How many times have I copied and pasted the same Event because I needed to cover a 3-5 width hallway? I mean, who wants to unnaturally bottleneck the players every time you need to fire off an Event? I've only been using RPG Maker for a month and I've run into this many times. So here's my suggestion. It's not drop-dead simple but I managed to parse through the scripts and get it hacked in, in less than a day, so I think it's doable. First, add extra options to the Player Touch and Event Touch Triggers that allow you to specify an X-Range and/or a Y-Range. If you specify an X-Range, it goes that many tiles in each direction on the x-axis. Same thing for Y accordingly. If you specify both, you get a touch radius, not just straight lines. If you leave them both at the default zero, the event only triggers if you touch that square as it does today. The image below represents the radius for these three conditions.
1. Player Touch: X-Range = 0, Y-Range = 1
2. Player Touch: X-Range = 2, Y-Range = 0
3. Player Touch: X-Range = 2, Y-Range = 2

If you want to make this easier, separate out the radius option in some way so you don't have to deal with elliptical ranges. I can see that possibly being a pain to deal with. As long as I could specify a line in either direction in order to cover a hallway with a single Event and also make a "You're within n squares of event" Trigger, I think that would be an extremely useful addition to the RPG Maker product for both developer and resource management.
Thanks for hearing me out!
Code
Here's the code that handles Player Touch.
https://forums.rpgmakerweb.com/index.php?threads/frogboy-trigger-distance.88311/#post-804275
Last edited:
