Introduction
This little script calculate the distance between an event and the player and the volume for a sound that can be played by that event.
Features
- Friendly little helper
How to Use
Simple put a call script command in your event.
In my example I use a cat as an event that randomly plays a "meow" every five seconds with a probability of 25%.
The maximum volume is 50 and the maximum distance the sound is played is 20.
Author's Note
Free for use in commercial/noncommercial games.
Credits are welcome.
Script
Spoiler#------------------------------------------------------------------------------
# weilhalt scripts
# peter.guettinger@gmail.com
#------------------------------------------------------------------------------
#
#------------------------------------------------------------------------------
# Title : Sound Volume
# Author : Peter Guettinger
# Version 1.01# Date : Nov 15, 2013
#------------------------------------------------------------------------------
# Parameters:
# eventID : ID of the event that produces the SE
# md : maximum distance up to which you can hear the SE
# mv : maximum volume of the SE
# return : actual volume depending on the actual distance
#
# Example:
# RPG::SE.new("Cat", volume(@event_id,20,50), 100).play
#------------------------------------------------------------------------------