Easy Volume Control
By: FamilyGamer7
By: FamilyGamer7
Introduction
Features
Screenshot(s)
Script
Ruby:
#==============================================================================
# Title: Easy Volume Control
# Author: FamilyGamer7 (FG7)
# Version: 1.0
# Engine: RPG Maker VX Ace
#==============================================================================
# ** Change Log |
# ---------------
# 1.0 => Created Script
#==============================================================================
# ** Description |
# ----------------
# The easiest way to implement a game volume control to control via script calls.
#==============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * Feel free to modify and improve the script. Credit is still required.
# * Credit FamilyGamer7
#==============================================================================
# ** Usage |
# ---------
# By default the game volume will be set at value of "100", which is normal
# game sound volume. Below are script calls to easily change the volume.
#
# Script calls:
#
# To set the game volume at 100% - Normal
# Ex: $game_system.game_volume_control = 100
#
# To set the game volume at 50% - Half Volume
# Ex: $game_system.game_volume_control = 50
#
# To set the game volume at 0% - No Sound
# Ex: $game_system.game_volume_control = 0
#
# You can also set the game volume to an odd value number like 73 (73%)
# Ex: $game_system.game_volume_control = 73
#
# -----------------------------------------------------------------------------
#
# *Note: ALL of the game sound volume is changed together. There is no specific
# way to individually change Background vs Sound Effects for example,
# unless you modify the script itself.
#==============================================================================
#==============================================================================
# ** Module: FG7::Easy_Volume_Control
#------------------------------------------------------------------------------
# This modules creates a static variable to be used within the script.
#==============================================================================
module FG7
module Easy_Volume_Control
# Sets value on the $game_variable to control help control game volume
Game_Variable_EVC = 22
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# New Method: game_volume_control (Used to control Game Volume)
#--------------------------------------------------------------------------
def game_volume_control=(value)
@game_volume_control = value
$game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] = @game_volume_control
end
end
#==============================================================================
# ** RPG::BGM
#------------------------------------------------------------------------------
# Default sound for BGM
#==============================================================================
class RPG::BGM < RPG::AudioFile
#--------------------------------------------------------------------------
# * Override Method: play
#--------------------------------------------------------------------------
def play(pos = 0)
$game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] = 100 if $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] == 0
Audio.bgm_play('Audio/BGM/' + @name, $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC], @pitch, pos) if [email protected]?
end
end
#==============================================================================
# ** RPG::ME
#------------------------------------------------------------------------------
# Default sound for ME
#==============================================================================
class RPG::ME < RPG::AudioFile
#--------------------------------------------------------------------------
# * Override Method: play
#--------------------------------------------------------------------------
def play
$game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] = 100 if $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] == 0
Audio.me_play('Audio/ME/' + @name, $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC], @pitch) if [email protected]?
end
end
#==============================================================================
# ** RPG::BGS
#------------------------------------------------------------------------------
# Default sound for BGS
#==============================================================================
class RPG::BGS < RPG::AudioFile
#--------------------------------------------------------------------------
# * Override Method: play
#--------------------------------------------------------------------------
def play(pos = 0)
$game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] = 100 if $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] == 0
Audio.bgs_play('Audio/BGS/' + @name, $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC], @pitch, pos) if [email protected]?
end
end
#==============================================================================
# ** RPG::SE
#------------------------------------------------------------------------------
# Default sound for SE
#==============================================================================
class RPG::SE < RPG::AudioFile
#--------------------------------------------------------------------------
# * Override Method: play
#--------------------------------------------------------------------------
def play
$game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] = 100 if $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC] == 0
Audio.se_play('Audio/SE/' + @name, $game_variables[FG7::Easy_Volume_Control::Game_Variable_EVC], @pitch) if [email protected]?
end
end
How to Use
Terms of Use