Improved Touch Trigger Conditions

Would you like this feature?

  • Yes

    Votes: 11 84.6%
  • No

    Votes: 0 0.0%
  • Yes but not important

    Votes: 2 15.4%

  • Total voters
    13

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
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
 
Last edited:

Tyruswoo

Game Designer
Veteran
Joined
Jul 13, 2014
Messages
96
Reaction score
68
First Language
English
Primarily Uses
RMMV
This is a great idea!  I would suggest a different implementation that uses a condition, but no need for additional triggers:  A condition that reads "Within x [Default 0] and y [Default 0] of [Player/Event 1/Event 2/etc]."

  • Example: To accomplish what you are suggesting, we can set the x range and y range and set the target to Player, and then set the trigger to Autorun.  Thus, when the player steps within the event's range, the page's conditions are met, and something autoruns.  Self switches can be used to keep this under control so it doesn't keep repeating the event.  Using this method, an enemy may approach when the player gets near, but when a hit points variable gets low, the enemy may flee, or when the player gets very close, the enemy may say "you caught me!" and get captured, etc, allowing for different experiences with different ranges of distance from the player.
  • Example: We can also use this to make the events interact with each other!  Set the target to [Other Event], and when the target event gets close, the event will have different behavior!  This can open up a world of possibilities, and yet is easy to implement, because instead of having to create special switches for each event interaction, or instead of using plugins, we could then specify the way events interact with each other!
  • Example: We can also use this the way you were suggesting, so that we no longer need to copy and paste so many identical events!  We can have a single event affect a whole area.  I imagine that when the player selects an event in the editor, the editor could even show a translucent overlay to indicate the range of an event page, and if several event pages have ranges, then the overlays would stack or overlap, so that areas affected by multiple ranges would be shaded in a little darker.

Another great similar idea would be a different condition as follows:  "Within x [Default 0] and y [Default 0] of event with tag [Empty].

  • Example: The event would interact with other events, based on that event's tag, instead of its ID number.  This would allow us to have events that always interact a certain way with other events of a given type!  That way, we don't have to create a separate event page for each instance of a target event on the map, if each target event should be interacted with identically.

I hope this idea of extending the ranges of events gets added!  Rectangular would be fine in my opinion, but either way would be awesome!
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
Added the code that handles Player Touch just in case having the code increases the likelihood that this feature will get the green light.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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