Basically in my game you have one event (event 1) that is chasing you and another event (event 2) that is moving slowly at random. Basically the goal is to make event 1 collide with event 2 to activate a switch. However, I don't know how to make this happen. I've tried using variables by setting up x and y for both events and having the region id for both of them. But that ways not working, is there any way to do what I want to do? Thank you in advance.
How to make two events touching activate a switch?
RPG Maker VXAce SupportYou can't. Events don't trigger other events. You would have to have a parallel processing event that continually checks the x and y positions of each of those events, and turn on the switch when they collide.
However, "when they collide" will be tricky to determine. Since they're both moving events, I'm assuming you mean when one bumps into the other, rather than when they occupy the same space. If you DO want them to occupy the same space, you could have one set to Below Characters and the other Same As Characters (that means your PC would also be able to go over the one set to Below Characters, which might not be what you want).
To determine if one bumps into the other, you would have to get the x, y and direction of both of them. Then look at the tile in front of each one, and see if that's where the other event is.
However, "when they collide" will be tricky to determine. Since they're both moving events, I'm assuming you mean when one bumps into the other, rather than when they occupy the same space. If you DO want them to occupy the same space, you could have one set to Below Characters and the other Same As Characters (that means your PC would also be able to go over the one set to Below Characters, which might not be what you want).
To determine if one bumps into the other, you would have to get the x, y and direction of both of them. Then look at the tile in front of each one, and see if that's where the other event is.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-two-events-touching-activate-a-switch.25731/