Need help with Button-Pressing mechanics

So I'm quite new to RPG Maker MV and slowly learning the basics of it, but I'm trying to make a mini game where the character is moving in a fixed path while the player has to press certain buttons that will cause an animation on another character before making them disappear. The problem I'm facing is that when I press the button, all characters on the entire map go off at once, rather than just the one on the screen. Sadly I haven't been able to find anything in this forum on that (I might not be using the right combination of words in the search bar) but is there anyone who can help me figure out how to set the animation to only go off on one character at a time?

Also, is there a way for me to set it so that the player can just click on another character on the map to set it off as an event, while also not being able to control their movement or be directly next to the other character?
Your first problem has an easy solution.
Variable 1 = Hero: X coordinate
Variable 2 = Hero: Y coordinate
Variable 3 = Event 1: X coordinate
Variable 4 = Event 1: Y cordinate
Variable 5 = Event 2: X coordinate
Variable 6 = Event 2: Y coordinate
etc.
Variable 3 = Subtract V[1]
Variable 4 = Subtract V[2]
if v[3]>=0:
-----if v[3] <= 15
----------if v[4]>=0:
---------------if v[4] <= 10:
----------else: if v[4]>-10:
--------------move it with arrows
else: if v[3] > -15:
-----if v[4]>=0:
----------if v[4] <= 10:
-----else: if v[4]>-10:
----------move it with arrows

repeat this with every event's appropriate variables. And don't forget to edit the 15 and 10 to your needs, these are just demonstrative numbers. The key with them is to determine if the event is on the screen.
And yes, there is a way to set events off while not being next to them, but that requires some scripting knowledge. You need to use:
2 variables for mouse click position (you can get it by scripting)
2 variables for event's position
And now create a parallel process event that checks if mouse is being pressed. If yes, it turns on the Mouse click switch. If not, it turns off the mouse click switch.
Then the events you want to have activated by mouse have this setting:
Activation conditions: Switch: Mouse click is ON
And they are parallel events.
Now simply check if the event map coordinates equal mouse click coordinates and if they match, then simply process the event functions you want to process.
You can find out more about storing how to do the mouse thing here:
https://forums.rpgmakerweb.com/inde...ouse-coordinate-xy-in-variables-solved.46956/
You're a genius and my savior! I greatly appreciate your help, not only did this work once I figured it out entirely, but it taught me quite a bit about what one can do with variables in this game. I've got a lot of learning to do, but this has definitely furthered me to that end, and I thank you for that! <3
You're welcome 🙂
And no, I'm by no means a genius. Once you get the hang of it, you'll see it yourself.
I only have 3 years of experience with RM2k3. There are no scripts, so we had to do everything through eventing... And trust me... The potential of switches and variables is much, much more than this. This is, compared to what you can do, quite elementary 🙂. With rpg maker mv you also have scripts and plugins for custom systems, while if we wanted a custom battle system, we had to event it fully by ourselves. Which is a pain, frankly put 🙂 But it taught me lots of stuff.
But still, the RPG maker 2k3 still remains my favorite due to its' simplicity. With windows 10 I just cannot use it anymore 🙁
I haven't given any other RPG Makers much a try. There was one I had on playstation 2 when I was about 12 years old, and I had NO CLUE what I was doing then. So naturally, I almost peed myself when I find, fourteen years later, that they're still making RPG Maker. Sadly I'm currently script-illiterate, but MV is making me want to learn pretty badly.

Also, don't sell yourself short! Genius is measured in many ways, and teaching people something they don't know is one of those ways in my book! Therefore, Poryg = Genius ^_^
I gotcha, the first thing I did when I bought the MV was learn javascript 😀 I used sololearn.com, they have a pretty simple course... Not too comprehensive, but considering it's free, it's quite enough for starters. The rest is just experience from playing with javascript, reading plugins and tutorials found on youtube 🙂 But I've still got a long way to go.

It's getting off topic though, so I'll better stop here before I attract mods' attention :#

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-button-pressing-mechanics.78712/