Please describe what you want and I'll see if i can help. Let me see how you are trying to set this up with some screen shots and maybe a more detailed description of what you want to accomplish.
[FROG] Trigger Distance - Fire touch events at a distance
JS Plugin Releases (RMMV)Please describe what you want and I'll see if i can help. Let me see how you are trying to set this up with some screen shots and maybe a more detailed description of what you want to accomplish.
My rpg maker is in french, but I made this picture to explain you in detail, I hope it's not confusing ☺️
Cheers
What you are wanting to do is something that RPG Maker has no support for. Player Touch trigger fires when the player either steps on or bumps into that event. An Event Touch fires when an event bumps into the player. There's no trigger type coded into RPG Maker that activates a trigger if one event steps on or bumps into a other event. Because this doesn't exist, there no way to extend this functionality to cover a range.
I can see why this was never added. Most map will have a bunch of events. Many of them will probably be decorative. An Event touching another event is likely to happen a lot and there aren't many use cases for this situation to fire a trigger every time this happens without some way of limiting when it does and does not fire.
In order for this to work, a whole new trigger type would have to be developed. In order to do this currently, you have to run a parallel process to see if certain events have the same x, y coordinates as some other events. If you want to do this in a way that covers a range like this plugin works, you'd need a plugin that tests the distance between two events or perform the calculations manually. Sorry, I know this isn't the answer that you want to hear but my plugin doesn't create this new type of event-to-event trigger that you are looking for.
I can see why this was never added. Most map will have a bunch of events. Many of them will probably be decorative. An Event touching another event is likely to happen a lot and there aren't many use cases for this situation to fire a trigger every time this happens without some way of limiting when it does and does not fire.
In order for this to work, a whole new trigger type would have to be developed. In order to do this currently, you have to run a parallel process to see if certain events have the same x, y coordinates as some other events. If you want to do this in a way that covers a range like this plugin works, you'd need a plugin that tests the distance between two events or perform the calculations manually. Sorry, I know this isn't the answer that you want to hear but my plugin doesn't create this new type of event-to-event trigger that you are looking for.
Too much complicated, I suspected it 😀
Anyway, your plugin is great, full of possibility with it 🙂👍
Thanks for taking time to answer me ☺️
Anyway, your plugin is great, full of possibility with it 🙂👍
Thanks for taking time to answer me ☺️
Once again, great plugin!
I've been wondering if there is a way to check if the player has left the event via code in the event itself?
I've been wondering if there is a way to check if the player has left the event via code in the event itself?
@eXalted
Hmm, I'm not sure. All this plugin does is fire the trigger of an event if you step within the defined range. It doesn't track whether you've entered before or if you are leaving it's range. To be honest, I really only designed this to save myself time in the editor and not so much as some kind of aura mechanic. That would probably be tricky as just about every modification I've made to this one has been thus far.
Maybe you can describe what you're trying to accomplish in more detail. I might be able to create a new area type that only covers the edges. Then you could stack two of these on top of each other where the "leaving" event is one larger and circles the perimeter. Or maybe you could do the same thing now but figure out a way to not execute the "leaving" event if you're still inside the main event?
Hmm, I'm not sure. All this plugin does is fire the trigger of an event if you step within the defined range. It doesn't track whether you've entered before or if you are leaving it's range. To be honest, I really only designed this to save myself time in the editor and not so much as some kind of aura mechanic. That would probably be tricky as just about every modification I've made to this one has been thus far.
Maybe you can describe what you're trying to accomplish in more detail. I might be able to create a new area type that only covers the edges. Then you could stack two of these on top of each other where the "leaving" event is one larger and circles the perimeter. Or maybe you could do the same thing now but figure out a way to not execute the "leaving" event if you're still inside the main event?
I have an event in the middle of a room that consists of big 10x10 black picture that is over the map and player - it's purpose is to hide a room. When the player enters the room, he triggers the event via your plugin and the black picture is removed, revealing the room. I want to make the black picture appear again when the player leaves the room.
@eXalted
What size is the entrance/exit? You might only need a couple smaller events at the door to hide and show the picture in question.
What size is the entrance/exit? You might only need a couple smaller events at the door to hide and show the picture in question.
Yeah, that's what I went with. Thought I will be a smart one and do it with one trigger.
@eXalted
I think I might have figured out a way of implementing this. My Switch-binding feature isn't really useful any longer. It's only there because the original, unreleased version of this plugin used the Note box instead of event page comments and I needed a way to disable to trigger in certain situations. I could repurpose this to toggle either a default switch or the specified one to let you know if you're on the edge of the trigger area. Then a simple conditional would allow you to hide the picture if you're on the edge and show it if you're inside the outer edge. This should be pretty easy to implement.
I think I might have figured out a way of implementing this. My Switch-binding feature isn't really useful any longer. It's only there because the original, unreleased version of this plugin used the Note box instead of event page comments and I needed a way to disable to trigger in certain situations. I could repurpose this to toggle either a default switch or the specified one to let you know if you're on the edge of the trigger area. Then a simple conditional would allow you to hide the picture if you're on the edge and show it if you're inside the outer edge. This should be pretty easy to implement.
This sounds really good and useful!
BTW I found what I think is a bug. Having an unpassable event just on the edge of the trigger and bumping into it, triggers the distant event.
Here on this graphic, if you are walking from left to right, reach where the blue triangle is and press to walk right (so you can bump into the event, not activate it), it will fire the distant one.
This actually isn't a bug but might be something I need to create a disable for. Touch events trigger in two ways. You either step on it or, if it's solid, you try to step on it and are blocked. So that's what's happening here. You are trying to step on a square with a touch event on it but are getting blocked so it's registering it as "bumped into".
This default functionality is needed for a few reasons. Most notably, you might actually want to cover a solid object like a house or a wall with a Trigger Distance event and do something if the player bumps into it (not just steps in the square next to it).
This default functionality is needed for a few reasons. Most notably, you might actually want to cover a solid object like a house or a wall with a Trigger Distance event and do something if the player bumps into it (not just steps in the square next to it).
Oh, yeah, you are absolutely right. I worked around that. Thank you for the prompt replies and explanations!
Great plugin. Might I suggest some functionality (correct me if this is already possible)?
- Have the trigger region only go to one side. So if there's an NPC looking to the left, then it'd only trigger if I stepped into the region on the left. If I passed him on the right side of the screen (where his back is turned against), then it wouldn't trigger.
- Have a variable for the comment code, which tells the event to only trigger if the event and the player are both on screen. That way you're not ambushed by events that you can't see yet.
@Leaufai
Thank you and thanks for the suggestions!
Thank you and thanks for the suggestions!
- I'm not sure if I want to go down this path but I have compromise that I think might work. Perhaps this plugin can be assigned some variables to store the X and Y of the player's current location relative to the event that fired it. This information would allow devs to process it however they needed. Most people that want the kind of functionality you're looking for will probably just use Yanfly's Event Chase instead anyway.
- Not sure how easy it would be to figure out what's on or off the screen. I'd have to look into that.
Thanks for considering my suggestions.
The problem with Yanfly Event Chase is that it uses a 180 degree field of view. What I'm looking for is more of a 1 tile wide field of view that stretches out in front of the event, like trainers have in Pokémon games.
The problem with Yanfly Event Chase is that it uses a 180 degree field of view. What I'm looking for is more of a 1 tile wide field of view that stretches out in front of the event, like trainers have in Pokémon games.
@Leaufai
That's precisely why I don't want to program in these calculations. One dev will want 180, another will want a cone shape (of varying degrees), another a line, maybe have obstacles block sight. It would be very difficult turning this into that kind of system while appeasing everyone. The relational coordinate data should allow these calculations to be made in the event however the dev needs though and shouldn't be too difficult to add.
That's precisely why I don't want to program in these calculations. One dev will want 180, another will want a cone shape (of varying degrees), another a line, maybe have obstacles block sight. It would be very difficult turning this into that kind of system while appeasing everyone. The relational coordinate data should allow these calculations to be made in the event however the dev needs though and shouldn't be too difficult to add.
Makes sense.
Sorry for my confusion, but is this currently possible in the plugin? It would be very helpful for my project.
@MOA
Not yet. I plan to get back to this plugin shortly to implement these last two requests. The tough part is going to be figuring out how to handle the fact that multiple event areas can overlap which makes using normal variables a bit unsuitable as they will end up overwriting each other and causing weird and unwanted effects when this happens. I need to implement a way to store this info with the event itself and accessible only with that event's pages.
Not yet. I plan to get back to this plugin shortly to implement these last two requests. The tough part is going to be figuring out how to handle the fact that multiple event areas can overlap which makes using normal variables a bit unsuitable as they will end up overwriting each other and causing weird and unwanted effects when this happens. I need to implement a way to store this info with the event itself and accessible only with that event's pages.
Original thread: https://forums.rpgmakerweb.com/threads/frog-trigger-distance-fire-touch-events-at-a-distance.88311/