Event triggered by another event?

I don't know if this is the right place to ask! I just want to know how to make one event get triggered by another event I e a boulder event touching a barrel making it explode. Is there a easy way to make this happen?
Tutorials is where people post tutorials, not ask support questions.

I've moved this thread to MV Support. Thank you.

@septimius
no, there is no way to do this at all in default - but it is usually not needed either.

If it is part of a cutscene, then the controlling event should just give the command to the barrel event at the appropiate time
If it is part of a puzzle or so, then it becomes a bit more complex - you'll need a third event checking both event's positions in a parallel process.

If it is part of map action and needs to be checked for dozens of cases, then you'll probably have to look for a plugin that handles such cases.
well it's a part of a puzzle, is there any comprehensive guides for this?
Hello,

I would create 'barrel' event like this:

1st page should be parallel and have 10 - 20 frames wait time and following script:
var ev1 = $gameMap.events()[10]; // This should be 'barrel' event (it's usually eventId - 1)
var ev2 = $gameMap.events()[9]; // This should be 'boulder' event (it's usually eventId - 1)
if (ev1.x == ev2.x && ev1.y == ev2.y) $gameSelfSwitches.setValue([$gameMap.mapId(), ev1._eventId, 'A'], true);


Setup page to 'barrel' event which is triggered by self switch 'A'

And finally to page triggered by self switch 'A':
Create 'explode' logic and then 'Erase event' (or self switch 'B' with nothing on it) depending if you want it to be permanently 'deleted'

I hope this made any sense...

Edit: But if 'barrel' event must have triggered by 'Action button' page then we need to put above logics to 3rd event as @Andar already mentioned.
You don't need a parallel process event, because you know exactly when the barrel could explode - after you move the boulder, and you have an event that tells the boulder to move (the boulder event). So you just check, after you move the boulder, whether it's been moved to the same tile as the barrel.

How many barrels do you have? Only one? Easy.

Draw with a region where the barrel is.
On the boulder event, after it moves away from player, use Control Variables to get the boulder's X and Y locations. Then use Get Location Info to put the region id of that X and Y location (using the variables) into another variable.
Then do a test to see if that variable contains the region number that you drew under the barrel. If it does, play the explosion animation on the barrel and turn on a switch. The barrel will have 2 pages - one with no conditions, with the barrel sprite, and the second will be conditioned by the switch you just turned on, and will have no sprite.

You might have to muck around a bit to get the boulder event to actually go onto the barrel event, because normally events won't move onto a tile with other events, even if they're different priorities, unless one of them is set to Through.
You don't need a parallel process event, because you know exactly when the barrel could explode - after you move the boulder, and you have an event that tells the boulder to move (the boulder event). So you just check, after you move the boulder, whether it's been moved to the same tile as the barrel.

How many barrels do you have? Only one? Easy.

Draw with a region where the barrel is.
On the boulder event, after it moves away from player, use Control Variables to get the boulder's X and Y locations. Then use Get Location Info to put the region id of that X and Y location (using the variables) into another variable.
Then do a test to see if that variable contains the region number that you drew under the barrel. If it does, play the explosion animation on the barrel and turn on a switch. The barrel will have 2 pages - one with no conditions, with the barrel sprite, and the second will be conditioned by the switch you just turned on, and will have no sprite.

You might have to muck around a bit to get the boulder event to actually go onto the barrel event, because normally events won't move onto a tile with other events, even if they're different priorities, unless one of them is set to Through.

Yea this will work if 'boulder' is pushed 1 tile at a time. Parallel processing is only needed if boulder moves several tiles at a time (might have even complex route).

Original thread: https://forums.rpgmakerweb.com/threads/event-triggered-by-another-event.109052/