Dynamic Sound

Hey guys.


I've made a rather large (200X200) town, and in one area of it, there is a Knight's Academy. In front of this academy, I've placed some trainees, slashing away at some training dummies. The problem I have is that the sound of the trainees attacking the dummies can be heard all over the town, which I don't want, because that gets annoying really quickly. So I was wondering if there is some way to have the sound of the trainees' attacks only play when the player is close to them, but not when they're in the other end of the town?


I know there is a way of doing it in VX Ace using regions, conditional modifiers and a script line ( $game_player.region_id == n ). But that script line doesn't work with MV. Is there a way to do this in MV? Or will I have to resort to something else?
you don't need that script line to check for a region ID. there is a similiar command with the new syntax in MV, but instead of waiting until someone posts that you can also use the get location info to load the region ID (or other data) of any point (including player position) into a variable and then check that variable's value with a regular conditional branch.


It's a few event command lines more than the single script line, but works the same.
Another possible way would be with Events which detect the range towards the player.


Early Example would be:

Audiodistance.PNG
@Jindo5$gamePlayer.regionId() === x is the script you need for that.

Original thread: https://forums.rpgmakerweb.com/threads/dynamic-sound.62317/