RPG Maker Forums

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


snap.PNG


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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top