Play Audio when Player Collides with an Event

I am trying to create a event (say, a moving car with a custom move route) in which, whenever the player bumps with the car or when the car bumps into the player and then an audio plays (horn).

How can I do this?

Edit: Can anyone recommend a plugin to achieve this, or is it achievable with pure eventing only?
use event touch to play the audio (I hope you're using autonomous movement and didn't use parallel process trigger for set mov route command?)
use event touch to play the audio (I hope you're using autonomous movement and didn't use parallel process trigger for set mov route command?)
Spoiler
q84h7gg.png

Unfortunately, I am using a Parallel process to trigger the movement. Here is what I've come up with so far, the car can move to a location and will stop when it collides with the player. Only problem is, I don't know how can I play a horn sound when it bumps into the player. 🙁

edit: once the car reaches it's end destination, after 180 frames it will return to it's starting position and run again (indefinitely.)
I would probably make it self switch, autorun play sound, turn self switch off so it goes back to normal page. I would start there anyway. Maybe there is a better way.

It would be cooler if it exploded on impact though.
you should move that to autonomous movement for a lot of reasons - to be able to use event touch trigger is only one of them, reducing lag another.
nothing in that parallel process that couldn't be done by autonomous movement either.
As Andar mentioned above, the best way to handle such is with Autonomous Movement.

The main reason is to take advantage of the trigger "Event Touch" which does exactly as you need. I've made a demo for you.

Demo: Click Here to View

In the demo a cart uses Autonomous Movement to move on a looped route (repeated).
When the event touches the player the event turns on a couple switches and plays the horn.
The first switch activates a parallel common event that will add 1 to a variable to space out the time of how long between activating the page (pressing the horn again).
See common Event #1

The second switch activates page 2 which has a fixed move route (non-moving).
This get's turned off after the Game Variable #1 reaches 150.
See Common Event #1

Ideally the first switch would then be turned off once the player is out of the way but I'm not sure how to do that.
you should move that to autonomous movement for a lot of reasons - to be able to use event touch trigger is only one of them, reducing lag another.
nothing in that parallel process that couldn't be done by autonomous movement either.

As Andar mentioned above, the best way to handle such is with Autonomous Movement.

The main reason is to take advantage of the trigger "Event Touch" which does exactly as you need. I've made a demo for you.

Demo: Click Here to View

Wow, thanks a lot guys, that's exactly the solution I was hoping for.
I can now report this thread as problem solved.
Wow, thanks a lot guys, that's exactly the solution I was hoping for.
I can now report this thread as problem solved.
No prob. Happy to help. 🙂👍
You could even turn off switch one once you leave the map with the cart too to save on lag.

Edit:
Hmm... on second testing I think there still might be issues...
...The cart does seem to go off it's route sometimes if interrupted by the player....
@Andar Any how would I fix that problem?

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/play-audio-when-player-collides-with-an-event.102600/