Proximity sound events

teaPlayingGames2.png

TEA_proximitySound
V1.0
​

This plugin allows the user to include events that emit sounds based on the proximity and position of the player.

To use proximity sound:


Add the event command "proximity sound" to a parallel event.

Event ID = Assign the event you want to be the epi center of the sound range
in the first parameter.


Choose a BGS to play from the event specified in parameter 1.

Specify what range you would like each volume to play in the following
parameters. You may skip ranges for a smaller sound radius.


***NOTE*** Sound will play at 100% if player is stepping on the event.

**For example, the default is a 10% decrease in volume for each additional
range of one tile. There are ten total sound ranges so that means the
radius around your event that will play sound will be 10 tiles in all
directions. You can reduce the overall radius by setting some range values
to 0. For example, if you wanted to set a radius of 5, your parameters
might look like this:

Event Id = (event number)
BGS = (BGS of your choice)
Range for BGS vol 100% = 1
Range for BGS vol 90% = 1
Range for BGS vol 80% = 2
Range for BGS vol 70% = 2
Range for BGS vol 60% = 3
Range for BGS vol 50% = 3
Range for BGS vol 40% = 4
Range for BGS vol 30% = 4
Range for BGS vol 20% = 5
Range for BGS vol 10% = 5
Range for BGS to stop = 6**



Choose whether or not you would like dynamic panning turned on.

3D panning takes the players direction into account and will be most
useful in 3D games.(included with the assumption that a 3D plugin will
eventually be made for MZ)


2D panning will work best in 2D games, it simply pans based on which
side of the player the event is on.






Download here:



Free to use for commercial and non commercial.
Editing allowed.
Redistribution prohibited.

Change log:
v1.0 - Release
v1.1 - Fixed a bug where if you entered a map in a location that wasn't specified in your parameters, but in range of the proximity sound event the sound wouldn't play until you stepped on the exact range coordinates specified in the parameters. Now sound will play no matter your coordinates as long as you're in range.
v1.2 - Fixed a bug that would cause the transfer event to run repeatedly instead of once, sometimes causing a stack overflow and game crash.
v1.3 Made the plugin compatible with 8-dir movement
v1.4 Major optimization and functionality updates, 3D panning improvement
Avatar art by Nowis-337
Hi,
This looks really cool!

I wanted to let you know that you have the wrong link up here. It says,

but it links to https://teasjams.itch.io/event-trigger-other-events-plugin

I grabbed the proper link from your YouTube Video. I did notice you are using MZ in the video. Either I don't know what I am doing or it doesn't work with MV.

Anyways, really nice work!
Thank you! I appreciate the heads up!

It's developed for MZ so it probably won't work for MV.
The plugin has been updated to version 1.1, I fixed a bug where if you entered a map in a location that wasn't specified in your parameters, but in range of the proximity sound event the sound wouldn't play until you stepped on the exact range coordinates specified in the parameters. Now sound will play no matter your coordinates as long as you're in range.
Is there something like this for MV?
Not that I'm aware of, but I did do a tutorial showing how you can do proximity sounds with events in MV.
Oh nice! Thanks for sharing Tea!
I'm using parallax mapping on pretty much all my maps and need to use regionID's to allow for player/event movement, and for some reason was thinking I couldn't double dip the numbers, but after looking at it I can add as many as I want to them.

Thank you again, appreciate all you and Drifty do for the community.
Thank you for the compliment! :LZSjoy:
Just a heads up to anyone using this plugin. I identified and fixed a bug that would cause the transfer event to run repeatedly instead of once, sometimes causing a stack overflow and game crash.

Please update the plugin if you're using it. :LZSsmile:
This plugin appears to work but when a BGS from the plugin is running and I change to a new map, the sound continues to play, or if I have a BGS playing that wasn't initiated from this plugin, that sound will also play in other maps.

Is there a way to turn off the BGS channel created by this plugin? That would correct this issue. Or even better, when changing maps, automatically have the BGS created by the plugin turn off.
The plugin turns off the BGS when transferring to another map. It may be that there's a compatibility issue with another plugin you're using. Try putting mine lower in the plugin list or on the bottom to see if that fixes it.
So I placed your plugin at the bottom of my load order, then created a new map. I then put this Autorun Event at the top left of the map and placed my character at the bottom right. I started the game and walked over to the top left and I can't hear anything. I made sure my BGM, BGS, and SE were all turned up.

I did notice that your plugin command mentions something about the ME sound. My game has ME disabled. Are you using the ME channel to play these BGSs?

1685929437560.png
The plugin essentially "listens" to the characters position to determine how loud the sound should be and changes the volume dynamically. You'll have to use a parallel event to use it or it won't work. :LZSsmile:
So I figured out the bug with this plugin. If you have a BGS playing from this plugin and you enter a different map that also has a BGS playing (not from your plugin), then you go back to the first map, the BGS from the second map will continue to play in the first map.

So while your BGS does turn off when you go to another map, this plugin appears to carry any BGS playing from another map back to the first map. You can test it out on your side. Make sure in the second map, you have a BGS playing via event commands, not the default map settings.
That's vanilla RM behavior. If you set a bgs to play in an event it will play until you use the stop bgs command, It has nothing to do with the plugin.
No, if you have a BGS playing in a map via event and then transition to a different map that plays a different BGS via event, the new BGS will play instead.

With your plugin, the first BGS continues playing in the second map ignoring the second BGS.
That's because my plugin enables playing more than one bgs on a map. So it won't interfere with the bgs played from another map. You'll have to manually fade it out with a command in that case.
So I need to event a fade BGS which will not only fade the vanilla BGS playing but also the BGS played by your plugin? Then start a new evented BGS and the plugin's BGS also in the new map? Gotcha, make sense.

Thanks!
You can fade it before the transition to the next map too :LZSsmile:😛
Tea++,

I have been experimenting with your plugin here a bit and have a question.

The BGS volume shifts with this plugin completely restart the BGS on volume change, which is how the engine handles volume shifts by default as well. What happens then, is that certain BGS sound really bad when volume shifts occur, particularly on tiles where shifts take place, as walking back and forth can create some very jarring noise.

My question is, is there a way to change this behavior of the plugin (or the engine for that matter)?

Thank you an have a great week 🙂.

-Niniann

Original thread: https://forums.rpgmakerweb.com/threads/proximity-sound-events.138160/