Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Game silenced mode

This script is for people that have certains OS that cant silence programs manually
or if you thing that this system is better. Using this script you can use rpg maker
while listening music, for example.

Note that im open to feedback, suggestions and corrections.

Code:
#==============================================================================

# Game silenced mode

# By gerkrt/gerrtunk

# Version: 1

# License: MIT, credits

# Date: 10/04/2012

# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this

# script check here: [url=http://usuarios.multimania.es/kisap/english_list.html]http://usuarios.multimania.es/kisap/english_list.html[/url] or my

# pastebin here: [url=http://pastebin.com/u/gerkrt]http://pastebin.com/u/gerkrt[/url]

#==============================================================================

 

=begin

------- INTRODUCTION ----------

This script is for people that have certains OS that cant silence programs manually 

or if you thing that this system is better. Using this script you can use rpg maker

while listening music, for example.

 

Note that im open to feedback, suggestions and corrections.

 

------ USE ---------

Is very simple to use. Just put the option Silenced_game to = true and the game will

skip all the music. And = false for the oposite.

 

Note that you can erase this script for final or public versions as it isnt used

for normal players.

 

=end

 

module Wep

  Silenced_game = false

end

 

#==============================================================================

# ** Game_System

#------------------------------------------------------------------------------

#  Esta clase almacena las variables sobre datos y comandos del sistema, como

#  la reproducción de música y sonido, el windowskin, temporizador, etc

#  Llama a $game_system para acceder a las variables incluidas aquí.

#==============================================================================

 

class Game_System

  

  #--------------------------------------------------------------------------

  # * Reproducción de Sonidos

  #   A partir de aquí están las métodos que incluyen los datos sobre la

  #   reproducción de todo tipo de sonido(música, ambiente, efecto sonoro, etc)

  #   Para que los comandos de reproducción funcionen corréctamente la variable

  #   que contiene el archivo de sonido debe ser la clase RPG::AudioFile

  #   y contener en su método de inicio (nombre, volúmen, tono)

  #   Puedes llamar a esta clase con el siguiente método:

  #   RPG::AudioFile.new(nombre, volúmen, tono)

  #   Los valores por defecto son ("", 100, 100)

  #--------------------------------------------------------------------------

  # * Reproducir Música

  #     "bgm" es la variable que incluye el archivo que se reproduce

  #--------------------------------------------------------------------------

  alias wep_gs_bgm_play bgm_play

  def bgm_play(bgm)

    if Wep::Silenced_game

      return

    end

    

    wep_gs_bgm_play(bgm)

  end

  

  #--------------------------------------------------------------------------

  # * Reproducir Sonido de Fondo

  #     "bgs" es la variable que incluye el archivo que se reproduce

  #--------------------------------------------------------------------------

  alias wep_gs_bgs_play bgs_play

  def bgs_play(bgs)

    if Wep::Silenced_game

      return

    end

    

     wep_gs_bgs_play(bgs)

  end

  

  #--------------------------------------------------------------------------

  # * Reproducir Efecto Musical

  #     "me" es ña variable que incluye el archivo que se reproducirá

  #--------------------------------------------------------------------------

  alias wep_gs_me_play me_play

  def me_play(me)

    if Wep::Silenced_game

      return

    end

    

     wep_gs_me_play(me)

  end

  

  #--------------------------------------------------------------------------

  # * Reproducir Efecto Sonoro

  #     "se" es el archivo que se reproducirá

  #--------------------------------------------------------------------------

  alias wep_gs_se_play se_play

  def se_play(se)

    if Wep::Silenced_game

      return

    end

    

    wep_gs_se_play(se)

  end

 

end

 

 

module Wep

  Scripts_list = [] unless defined? Scripts_list

  Scripts_list.push ('Game silenced mode')

end  

 
 
I know that you can simply doing it by pressing F1 and turning sound off. What OS does that not work on?
I'm just curious because to my knowledge that works on all versions of Windows from XP and after. I haven't tried any volume control on any Linux distros, but I assume that Wine shouldn't have any problems handling that.

On another note, it would be wiser to alias the Audio module since this script would miss audio that is not called through Game_System.
 
xDDD, i write to tell that for me the script is usable even with that, i have bugs with that f1 sound options, sometimes they dont stop music at all, so they are turned off and the sound works also...

I know is a very strange situation but the script is helping me a lot with the options bugs + windows Xp.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top