Play waterfall sound with volume depending on distance to the waterfall

Ok so what I'm looking for is a script that will play the background sound for a waterfall.  The catch is that the waterfall sound should play at a volume proportional to the players distance from the waterfall.  perhaps 6% volume for each step away, maxing out at 60%.  The sound should be audible from 10 steps away.  I have events set up for animations of the waterfalls, so ideally the script could just be called in that event.  I know some about scripting, so if some other things would have to be put in the event, then that would be fine.


Thanks
This is what you need!




Have fun!
Tsukihime's custom event triggers script http://himeworks.com/2013/04/custom-event-triggers/ makes this easy to event. (I've done this exact thing using the region_enter commands and surrounding the waterfall/river/whatever with multiple regions as the player gets closer or further from the source.)


@taarna23That's a nice looking plugin, but does it have an RGSS3 equivalent somewhere?
Aw dang. I didn't see it was Ace! My bad.


Alex's suggestion is probably the better one to consider. Unless you switch to MV, then I'm safe! Haha. 😉
Modern Algebra got a script for this. It is called "Sound Emitting Events".

Original thread: https://forums.rpgmakerweb.com/threads/play-waterfall-sound-with-volume-depending-on-distance-to-the-waterfall.56286/