How to make two events touching activate a switch?

This is what I'm trying to make happen:

I have two events, one called "Rock" and the other called "Button", I have made it so that the player can push the rock around. But what I want to happen is for the rock to be able to go on top of the "Button" and then activate a switch. But I cannot figure out how to do this. I have looked it up so many times on the internet but I can't find a tutorial that makes any sense.

Basically, I want to do what this guy's trying to do: http://www.rpgmakervxace.net/topic/12266-help-using-an-event-to-trigger-another-event/

However, the people who responded to that thread don't make any sense to me.

Please help.
there is no default trigger for events touching each other, you'll have to do it in another way.

For example, you can check the coordinates in event that controls the movement of the rock - if he is on the coordinates with a tile where the button is places, then switch.

This will work because you will not check for another event, but for coordinates.

If your game is too variable and contains too much random positions, then you'll need a script to add more trigger types that don't exist in default.

The are a very few scripts that do this, but I don't know if there is a script that adds event-to-event triggers, you'll have to check the master script list yourself for them.
Unfortunately that won't work because my game has a lot of randomly placed switches, but thanks anyway.
define randomly placed? you mean they are automatically placed in random position and does not exist in the map while editing? or they are already in the map during editing and you simple relocate them randomly?

if it's the 2nd, you can still do the position check method... just have two sets of X,Y variables one will be used to store the coordinates of the rock, and the other will store the coordinates of the switches (you check them 1 by 1, so you only need 1 set for them)
By randomly placed I mean they are already in the map while editing and you can move any of the rocks onto them. If I used the position check method how would I change the picture of the switch to be looking pressed down?

Also, what is the position check method and how do I use it? I can't find it under conditional branch.
Also, what is the position check method and how do I use it? I can't find it under conditional branch.
A lot of the more advanced checks require a combination of two commands:

1) control variable to get the selected game data stored into a variable of your choice

2) conditional branch to check the new content of the variable.

As for your changing sprite, there are two options:

1) use a general switch and condition the event of the button to that switch (changing sprite when condition switch is ON)

2) use move route command to change the sprite of the button event with a command placed in the rock command
position check: basically you check if the position of 1 object is the same as the position of another object...


In RM we do it via saving the X and Y coordinates of the two objects into variables (1 variable for each coordinate, so we need foursince we have two X coordinates and 2 Y coordinates (1 pair for each object)), then compare them to see if the positions collide
Thank you both for helping me but I'm struggling to understand this.

So what I need to do is set up four variables with each of the positions in them. In my game the rock is at position 006,007 and the button is at position 0010,007. So I have to set up variables with the positions 6x, 7y and 10x. How do I do that? I can't find the option for that in the variables.
to get each coordinate:


Choose Control Variables


Make sure the setting is on SET


Choose Game Data


Choose Character


Find the event on the drop down list


On the next drop down choose Map X/Y


Basically, you'll do this 4 times


1 for the rock's X


1 for the rock's Y


1 for the button's X


1 for the button's Y


then if you want to check other buttons during the same event, you simply need to set the variables for the button, no need to redo the one for the rock
I set up two four variables. I have "Rock's Map X" and "Rock's Map Y" and "Button's Map X" and "Button's Map Y". In the Button event I made two conditional branches, one that says "Rocks map x" must be equal to "buttons map x" and the other conditional branch says "rocks map y" must be equal to "buttons map y." Then I set for the switch to happen. But this doesn't work. The switch is already activated before the rock even moves. What am I doing wrong?
Show us the event...


You do the settings of the variable in a parallel process event or do it when you move the rock...
This is what I've got inside the Button event. What changes to I need to make?

(Also, I renamed "Button" Switch and "Rock" "Ball"

Eventprocessing_zpsa83f3437.png
We need to see where you set those variables too
We need to see where you set those variables too
I don't understand. Do I have to set them to a certain place? How do I do that?
I already outlined a few posts back how to set them to the correct values and as I said, do it on a parallel process event... NAMING A VARIABLE DOESN'T PUT A VALUE ON IT... that's why your button becomes pushed already, because all those variables are equal to 0...

If you don't even know how to set variables, you should really read beginner tutorials first and practice the simpler things that the maker can do instead of these things...
I already outlined a few posts back how to set them to the correct values... NAMING A VARIABLE DOESN'T PUT A VALUE ON IT...

If you don't even know how to set variables, you should really read beginner tutorials first and practice the simpler things that the maker can do instead of these things...
I know how to do most of the more advanced stuff but I just don't know variables because I've never used them before. I did set a value but I only set the value to x and y. So for example, "Balls Map X" I just set the value to map x. Do I need to put a specific number like 007,010? If so, how can I do that?

Sorry, I'm just not very good at understanding these things.
As I said, show me the event where you set those values... We're not psychics here, we cannot know what you have done unless you show it...
I would just use custom event triggers and set it as a event_to_event trigger


http://himeworks.wordpress.com/2013/04/05/custom-event-triggers/
Well yeah, that's faster... but really, he should learn how to use variables...


anyway, the choice is yours... XD
This is a picture of the Ball Map X variable:

variable_zpscf6f2367.png


Is it missing something? Am I supposed to add numbers in?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-two-events-touching-activate-a-switch.19861/