Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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.
Avatar art by Nowis-337
 
Last edited:

autodidact

Regular
Regular
Joined
Nov 13, 2020
Messages
82
Reaction score
65
First Language
English
Primarily Uses
RMMV

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
Thank you! I appreciate the heads up!

It's developed for MZ so it probably won't work for MV.
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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.
 

Locke05

Villager
Member
Joined
Jan 15, 2022
Messages
13
Reaction score
3
First Language
english
Primarily Uses
RMMV
Is there something like this for MV?
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
Not that I'm aware of, but I did do a tutorial showing how you can do proximity sounds with events in MV.
 

Locke05

Villager
Member
Joined
Jan 15, 2022
Messages
13
Reaction score
3
First Language
english
Primarily Uses
RMMV
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.
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
Thank you for the compliment! :LZSjoy:
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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:
 

Zer0Morph

Regular
Regular
Joined
Sep 8, 2022
Messages
83
Reaction score
41
First Language
English
Primarily Uses
RMMZ
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.
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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.
 

Zer0Morph

Regular
Regular
Joined
Sep 8, 2022
Messages
83
Reaction score
41
First Language
English
Primarily Uses
RMMZ
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
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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:
 

Zer0Morph

Regular
Regular
Joined
Sep 8, 2022
Messages
83
Reaction score
41
First Language
English
Primarily Uses
RMMZ
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.
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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.
 

Zer0Morph

Regular
Regular
Joined
Sep 8, 2022
Messages
83
Reaction score
41
First Language
English
Primarily Uses
RMMZ
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.
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
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.
 

Zer0Morph

Regular
Regular
Joined
Sep 8, 2022
Messages
83
Reaction score
41
First Language
English
Primarily Uses
RMMZ
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!
 

Tea++

I'm human
Staff member
Admin
Joined
Mar 28, 2017
Messages
1,353
Reaction score
3,423
First Language
English
Primarily Uses
RMMZ
You can fade it before the transition to the next map too :LZSsmile::p
 

Latest Threads

Latest Posts

Latest Profile Posts

I HATE SEOs! I do not want to add Reddit to every single search in order to find helpful content posted by actual humans.
bandicam 2023-10-02 09-53-18-106.png
Yanka is one of my dearly loved characters. And not only because she can perform the look of "puss in boots")))) Spy, infiltrator, kind-hearted with a soft spot for one Crimson Knight.
Just completed another cutscene. Huge one for the story. I'm so enthusiastic about where this game is going.
Man, the enemies in the new Sonic Frontiers update are totally roided up. I wanted a little more difficulty myself, but Sonic Team turned the dial a bit too far.

At least the new tracks for roaming Ouranos Island as Amy, Knuckles, and Tails slap hard.
mz_quest_victory_scene.gif


This battle victory screen has been pretty fun to work on. Not only can party members set new personal records for their contributions to the fight, but when they do, the party remarks on the accomplishment!

Forum statistics

Threads
134,981
Messages
1,252,596
Members
177,873
Latest member
romoromoromo
Top