Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> <Sound Test Script>, For listen music
badnomis
post Feb 18 2009, 04:28 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Sound Test Script
Version 1.4
by badnomis (me)
Release Date: 19/03/2009

Exclusive Script at RPG RPG Revolution

Introduction
It's my first script and I hope that you will like. If you have comments or suggestions, let me know.

Features

Version 1.4
- The Sound List Data Base make automatically
- Fix the saves bug

Version 1.2
- You can display all sounds (Without having to hear sounds)

Version 1.1
- The possibility to know if the actors has all sounds (with a conditions)

Screenshots


Script VX
CODE

#==============================================================================
# [VX] < Sound Test > by badnomis
#------------------------------------------------------------------------------
# ◦ by badnomis [badnomis@hotmail.com]
# ◦ Released on: 19/03/2009 (D-M-Y)
# ◦ Version: 1.4
#---------------------------------------------------------------------------
#+++ [FEATURES] ++++
# - Reintegrates bgm and bgs memorize function from RPGXP (not used for the vehicles)
# + Audio.bgm_memorize (for memorize BGM)
# + Audio.bgs_memorize (for memorize BGS)
# + Audio.bgm_and_bgs_memorize (for memorize BGM and BGS)
# + Audio.play_music_memorize (for play memorize music)
# - Automatically adds the music in the database as soon as the music is played
# - Compatible with a different size screen
# - The possibility to know if the actors has all sounds (with a conditions)
# - You can display all sounds (Without having to hear sounds)
# - Automatically puts the music in the database (No Sound List Data Base in Script)
#------------------------------------------------------------------------------
#### Instruction ####
# Go to line 115 and change the path of your rgss directory!
# For call Sound Test script, write in event, Event Commands, third page,
# Script... (in Advanced) :
# $scene = Scene_SoundTest.new
# You can display all sounds, you need write this
# $scene = Scene_SoundTest.new(true)
#
# For put a condition for know if you have all sounds or not, #have_all_sounds?
# 1. Go on event
# 2. Put a condition branch where you want it
# 3. In condion, go to page 4 and check script box
# 4. Write in box :
# have_all_sounds?
# 5. The first branch => if you have all sounds
# The second branch => if you not have all sounds
#
# -The buttons in Sound Test-
# + Space © : To choose music
# + Shift (A) : To stop music
# + ESC : To quit Sound Test
#------------------------------------------------------------------------------
#==============================================================================<
# If you want the music of the RGSS, write true. If not, write false
#==============================================================================
module SOUNDTESTOPT
RGSS_MUSIC = true
end
#==============================================================================
# ** Audio
#------------------------------------------------------------------------------
# This module add audio functions and modifies existing functions.
#------------------------------------------------------------------------------
# (-) = Modified Function
# (+) = New Function
#==============================================================================

module Audio
#--------------------------------------------------------------------------
# * Memorize BGM (+)
#--------------------------------------------------------------------------
def self.bgm_memorize
@memorized_bgm = @playing_bgm
end

#--------------------------------------------------------------------------
# * Memorize BGS (+)
#--------------------------------------------------------------------------
def self.bgs_memorize
@memorized_bgs = @playing_bgs
end

#--------------------------------------------------------------------------
# * Memorize BGM and BGS (+)
#--------------------------------------------------------------------------
def self.bgm_and_bgs_memorize
self.bgm_memorize
self.bgs_memorize
end

#--------------------------------------------------------------------------
# * Play Memorize BGM (+)
#--------------------------------------------------------------------------
def self.play_music_memorize
Audio.bgm_play(@memorized_bgm.name, @memorized_bgm.volume,
@memorized_bgm.pitch) if @memorized_bgm != nil
Audio.bgs_play(@memorized_bgs.name, @memorized_bgs.volume,
@memorized_bgs.pitch) if @memorized_bgs != nil
end

#--------------------------------------------------------------------------
# * Return Playing BGM (+)
#--------------------------------------------------------------------------
def self.playing_bgm
return @playing_bgm
end

#--------------------------------------------------------------------------
# * Erase the extansion Audio Files (+)
#--------------------------------------------------------------------------
def self.erase_extansion_file(sound)
string = sound.gsub(/\.mp3/) {""} if sound.include?(".mp3")
string = sound.gsub(/\.wav/) {""} if sound.include?(".wav")
string = sound.gsub(/\.mid/) {""} if sound.include?(".mid")
string = sound.gsub(/\.ogg/) {""} if sound.include?(".ogg")
return string
end

#--------------------------------------------------------------------------
# * Explore Folder (+) By Krosk
#--------------------------------------------------------------------------
def self.explore(folder = "Audio/BGM/")
if not(FileTest.exist?(folder))
return ["Nil"]
end
rgssfolder = ENV['ProgramFiles'] + '\Common Files\Enterbrain\RGSS2\RPGVX\Audio\BGM\\'
command = []
dir = []
if FileTest.exist?(rgssfolder) and SOUNDTESTOPT::RGSS_MUSIC
d = Dir.open(rgssfolder)
d = d.sort - [".", ".."]
d.each {|file|
command.push(file)
dir.push(false)}
end
d = Dir.open(folder)
d = d.sort - [".", ".."]
d.each {|file|
command.push(file)
dir.push(false)}
temp = []
for i in 0..command.length-1
if dir[i]
command[i] += "/"
temp.push(command[i])
end
end
dir.delete(true)
for element in temp
command.delete(element)
end
temp.reverse!
for element in temp
dir.unshift(true)
command.unshift(element)
end
return [command, dir]
end

#--------------------------------------------------------------------------
# * Play Memorize BGM (-)
#--------------------------------------------------------------------------
# Module to class
class << self
# Fix a Stack Level too deep problems
if @Audio.nil?
# Renames bgm and bgs functions
alias bgm_play_alias bgm_play
alias bgm_stop_alias bgm_stop
alias bgm_fade_alias bgm_fade
alias bgs_play_alias bgs_play
alias bgs_stop_alias bgs_stop
alias bgs_fade_alias bgs_fade
@Audio = true
end
#-----------BGM-----------
# Defines a new bgm_play
def Audio.bgm_play(*arg)
# Run the basic method
bgm_play_alias(*arg)
@playing_bgm = RPG::AudioFile.new(*arg)
if not $scene.is_a?(Scene_SoundTest)
name = @playing_bgm.name.gsub(/Audio\/BGM\//) {""}
$game_party.played_bgm = {} if $game_party.played_bgm == nil
$game_party.played_bgm[name] = true
end
end
# Defines a new bgm_stop
def Audio.bgm_stop
# Run the basic method
bgm_stop_alias
@playing_bgm = nil
end
# Defines a new bgm_fade
def Audio.bgm_fade(arg)
# Run the basic method
bgm_fade_alias(arg)
@playing_bgm = nil
end
#-----------BGS-----------
def Audio.bgs_play(*arg)
# Run the basic method
bgs_play_alias(*arg)
@playing_bgs = RPG::AudioFile.new(*arg)
end
# Defines a new bgm_stop
def Audio.bgs_stop
# Run the basic method
bgs_stop_alias
@playing_bgs = nil
end
# Defines a new bgm_fade
def Audio.bgs_fade(arg)
# Run the basic method
bgs_fade_alias(arg)
@playing_bgs = nil
end

end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
attr_accessor :played_bgm
alias initialize_game_party_alias initialize
def initialize
initialize_game_party_alias
@played_bgm = {}
end
end


#==============================================================================
# ** Game_Interpreter
#==============================================================================
class Game_Interpreter
def have_all_sounds?
list = Audio.explore
@data = list[0]
@item_max = @data.size
pc_complete = 0
$game_party.played_bgm = {} if $game_party.played_bgm == nil
for i in 0...@item_max
sound = @data[i]
stext = Audio.erase_extansion_file(sound)
pc_complete += 1 if $game_party.played_bgm[stext]
end
return true if pc_complete == @item_max
return false if pc_complete != @item_max
return
end
end
#==============================================================================
# ** Window_SoundTest
#------------------------------------------------------------------------------
#  This window displays a list of sounds
#==============================================================================

class Window_SoundTest < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height, allsongs)
super(x, y, width, height)
@column_max = 1
@width = width
@allsongs = allsongs
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Sound
#--------------------------------------------------------------------------
def sound
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Get %
#--------------------------------------------------------------------------
def pcomplete(condition = false)
pc_complete = 0
$game_party.played_bgm = {} if $game_party.played_bgm == nil
for i in 0...@item_max
sound = @data[i]
stext = Audio.erase_extansion_file(sound)
pc_complete += 1 if $game_party.played_bgm[stext]
end
text = pc_complete * 100 / @item_max if @item_max != 0
text = "Complete: " + text.to_s + "%"
return text if condition == false
return true if pc_complete == @item_max and condition == true
return false if pc_complete != @item_max and condition == true
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
list = Audio.explore
@data = list[0]
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Sound
# index : sound number
#--------------------------------------------------------------------------
def draw_item(index)
sound = @data[index]
rect = item_rect(index)
text = Audio.erase_extansion_file(sound)
$game_party.played_bgm = {} if $game_party.played_bgm == nil
if $game_party.played_bgm[text] or @allsongs
self.contents.font.color = normal_color
self.contents.draw_text(rect, text, 1)
else
self.contents.font.color = text_color(7)
self.contents.draw_text(rect, "? ? ? ? ? ? ? ?", 1)
end
end
end

#==============================================================================
# ** Scene_SoundTest
#------------------------------------------------------------------------------
# SoundTest Scene
#==============================================================================

class Scene_SoundTest < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(allsongs = false)
@allsongs = allsongs
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
Audio.bgm_and_bgs_memorize
Audio.bgm_stop
Audio.bgs_stop
create_menu_background
@help_window = Window_Base.new(Graphics.width/2, 0, Graphics.width/2, 24+32)
@help_window.contents = Bitmap.new(Graphics.width/2-32, 24)
set_text(@help_window, "- None -", 1)
@complete_window = Window_Base.new(Graphics.width/2,
Graphics.height - (24+32), Graphics.width/2, 24+32)
@complete_window.contents = Bitmap.new(Graphics.width/2-32, 24)
@complete_window.visible = false if @allsongs
@pi = 3.14159265
@cd = Sprite.new
@cd.bitmap = Cache.picture("CD")
@cd.ox = @cd.bitmap.width/2
@cd.oy = @cd.bitmap.height/2
@cd.zoom_x = 0
@cd.y = Graphics.height/2 - @cd.bitmap.height/2 + 120
@zoom_cd = 0
@turn_cd = 0
@cd_play = false
@sound_window = Window_SoundTest.new(0, 0, Graphics.width/2, Graphics.height, @allsongs)
set_text(@complete_window, @sound_window.pcomplete, 1)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@help_window.dispose
@complete_window.dispose
@cd.dispose
@sound_window.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Set_text
#--------------------------------------------------------------------------
def set_text(window, text, align = 0)
window.contents.clear
window.contents.draw_text(0,0, window.width - 32, 24, text, align)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@complete_window.update
@cd.update
@zoom_cd += 1
if @cd_play == true
@turn_cd += 14
@cd.zoom_x = 1
@cd.angle = @turn_cd
else
@cd.angle = 0
@turn_cd = 0
@cd.zoom_x = (1 * Math.sin(@zoom_cd/120.0*@pi)).abs
@cd.x = (Graphics.width/1.33) - @cd.bitmap.width/2 * (Math.sin(@zoom_cd/@cd.bitmap.width/2*@pi).abs)
end
@sound_window.update
# If input B
if Input.trigger?(Input::B)
Sound.play_cancel
Audio.bgm_stop
Audio.play_music_memorize
return_scene
end
# If input A
if Input.trigger?(Input::A)
# Play SE (Decision)
Sound.play_decision
# Stop BGM
Audio.bgm_stop
@cd_play = false
set_text(@help_window, "- None -", 1)
end
# If input C
if Input.trigger?(Input::C)
sound = @sound_window.sound
# If not playing
stext = Audio.erase_extansion_file(sound)
if !$game_party.played_bgm[stext] and @allsongs == false
# SE play (Buzzer)
Sound.play_buzzer
return
end
Graphics.update
# Play SE (Decision)
Sound.play_decision
# Play BGM
Audio.bgm_play("Audio/BGM/" + sound, 100, 100)
@cd_play = true
text = sprintf("%02d", @sound_window.index + 1) + ":" + stext
set_text(@help_window, text, 1)
return
end
end
end


Script XP
CODE

#==============================================================================
# [XP] < Sound Test > by badnomis
#------------------------------------------------------------------------------
# ◦ by badnomis [badnomis@hotmail.com]
# ◦ Released on: 17/02/2009 (D-M-Y)
# ◦ Version: 1.4
#---------------------------------------------------------------------------
#+++ [FEATURES] ++++
# - Automatically adds the music in the database as soon as the music is played
# - The possibility to know if the actors has all sounds (with a conditions)
# - You can display all sounds (Without having to hear sounds)
# - Automatically puts the music in the database (No Sound List Data Base in Script)
#------------------------------------------------------------------------------
#### Instruction ####
# For call Sound Test script, write in event, Event Commands, third page,
# Script... (in Advanced) :
# $scene = Scene_SoundTest.new
# You can display all sounds, you need write this
# $scene = Scene_SoundTest.new(true)
#
# For put a condition for know if you have all sounds or not, #have_all_sounds?
# 1. Go on event
# 2. Put a condition branch where you want it
# 3. In condion, go to page 4 and check script box
# 4. Write in box :
# have_all_sounds?
# 5. The first branch => if you have all sounds
# The second branch => if you not have all sounds
#
# -The buttons in Sound Test-
# + Space © : To choose music
# + Shift (A) : To stop music
# + ESC : To quit Sound Test
#------------------------------------------------------------------------------
#==============================================================================<
# If you want the music of the RGSS, write true. If not, write false
#==============================================================================
module SOUNDTESTOPT
RGSS_MUSIC = true
end
#==============================================================================
# ** Audio
#------------------------------------------------------------------------------
# This module add audio functions and modifies existing functions.
#------------------------------------------------------------------------------
# (-) = Modified Function
# (+) = New Function
#==============================================================================

module Audio
#--------------------------------------------------------------------------
# * Memorize BGM (+)
#--------------------------------------------------------------------------
def self.bgm_memorize
@memorized_bgm = @playing_bgm
end

#--------------------------------------------------------------------------
# * Memorize BGS (+)
#--------------------------------------------------------------------------
def self.bgs_memorize
@memorized_bgs = @playing_bgs
end

#--------------------------------------------------------------------------
# * Memorize BGM and BGS (+)
#--------------------------------------------------------------------------
def self.bgm_and_bgs_memorize
self.bgm_memorize
self.bgs_memorize
end

#--------------------------------------------------------------------------
# * Play Memorize BGM (+)
#--------------------------------------------------------------------------
def self.play_music_memorize
Audio.bgm_play(@memorized_bgm.name, @memorized_bgm.volume,
@memorized_bgm.pitch) if @memorized_bgm != nil
Audio.bgs_play(@memorized_bgs.name, @memorized_bgs.volume,
@memorized_bgs.pitch) if @memorized_bgs != nil
end

#--------------------------------------------------------------------------
# * Return Playing BGM (+)
#--------------------------------------------------------------------------
def self.playing_bgm
return @playing_bgm
end

#--------------------------------------------------------------------------
# * Erase the extansion Audio Files (+)
#--------------------------------------------------------------------------
def self.erase_extansion_file(sound)
string = sound.gsub(/\.mp3/) {""} if sound.include?(".mp3")
string = sound.gsub(/\.wav/) {""} if sound.include?(".wav")
string = sound.gsub(/\.mid/) {""} if sound.include?(".mid")
string = sound.gsub(/\.ogg/) {""} if sound.include?(".ogg")
return string
end

#--------------------------------------------------------------------------
# * Explore Folder (+) By Krosk
#--------------------------------------------------------------------------
def self.explore(folder = "Audio/BGM/")
if not(FileTest.exist?(folder))
return ["Nil"]
end
rgssfolder = ENV['ProgramFiles'] + '\Common Files\Enterbrain\RGSS\Standard\Audio\BGM\\'
command = []
dir = []
if FileTest.exist?(rgssfolder) and SOUNDTESTOPT::RGSS_MUSIC
d = Dir.open(rgssfolder)
d = d.sort - [".", ".."]
d.each {|file|
command.push(file)
dir.push(false)}
end
d = Dir.open(folder)
d = d.sort - [".", ".."]
d.each {|file|
command.push(file)
dir.push(false)}
temp = []
for i in 0..command.length-1
if dir[i]
command[i] += "/"
temp.push(command[i])
end
end
dir.delete(true)
for element in temp
command.delete(element)
end
temp.reverse!
for element in temp
dir.unshift(true)
command.unshift(element)
end
return [command, dir]
end

#--------------------------------------------------------------------------
# * Play Memorize BGM (-)
#--------------------------------------------------------------------------
# Module to class
class << self
# Fix a Stack Level too deep problems
if @Audio.nil?
# Renames bgm and bgs functions
alias bgm_play_alias bgm_play
alias bgm_stop_alias bgm_stop
alias bgm_fade_alias bgm_fade
alias bgs_play_alias bgs_play
alias bgs_stop_alias bgs_stop
alias bgs_fade_alias bgs_fade
@Audio = true
end
#-----------BGM-----------
# Defines a new bgm_play
def Audio.bgm_play(*arg)
# Run the basic method
bgm_play_alias(*arg)
@playing_bgm = RPG::AudioFile.new(*arg)
if not $scene.is_a?(Scene_SoundTest)
name = @playing_bgm.name.gsub(/Audio\/BGM\//) {""}
if $game_party != nil
$game_party.played_bgm = {} if $game_party.played_bgm == nil
$game_party.played_bgm[name] = true
end
end
end
# Defines a new bgm_stop
def Audio.bgm_stop
# Run the basic method
bgm_stop_alias
@playing_bgm = nil
end
# Defines a new bgm_fade
def Audio.bgm_fade(arg)
# Run the basic method
bgm_fade_alias(arg)
@playing_bgm = nil
end
#-----------BGS-----------
def Audio.bgs_play(*arg)
# Run the basic method
bgs_play_alias(*arg)
@playing_bgs = RPG::AudioFile.new(*arg)
end
# Defines a new bgm_stop
def Audio.bgs_stop
# Run the basic method
bgs_stop_alias
@playing_bgs = nil
end
# Defines a new bgm_fade
def Audio.bgs_fade(arg)
# Run the basic method
bgs_fade_alias(arg)
@playing_bgs = nil
end

end
end

#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
alias command_new_game_alias command_new_game
def command_new_game
command_new_game_alias
$game_party.played_bgm = {} if $game_party.played_bgm == nil
$game_party.played_bgm[$data_system.title_bgm.name] = true
end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
attr_accessor :played_bgm
alias initialize_game_party_alias initialize
def initialize
initialize_game_party_alias
@played_bgm = {}
end
end

#==============================================================================
# ** Interpreter
#==============================================================================
class Interpreter
def have_all_sounds?
list = Audio.explore
@data = list[0]
@item_max = @data.size
pc_complete = 0
$game_party.played_bgm = {} if $game_party.played_bgm == nil
for i in 0...@item_max
sound = @data[i]
stext = Audio.erase_extansion_file(sound)
pc_complete += 1 if $game_party.played_bgm[stext]
end
return true if pc_complete == @item_max
return false if pc_complete != @item_max
return
end
end
#==============================================================================
# ** Window_SoundTest
#------------------------------------------------------------------------------
#  This window displays a list of sounds
#==============================================================================

class Window_SoundTest < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height, allsongs)
super(x, y, width, height)
@column_max = 1
@width = width
@allsongs = allsongs
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Sound
#--------------------------------------------------------------------------
def sound
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Get %
#--------------------------------------------------------------------------
def pcomplete(condition = false)
pc_complete = 0
$game_party.played_bgm = {} if $game_party.played_bgm == nil
for i in 0...@item_max
sound = @data[i]
stext = Audio.erase_extansion_file(sound)
pc_complete += 1 if $game_party.played_bgm[stext]
end
text = pc_complete * 100 / @item_max
text = "Complete: " + text.to_s + "%"
return text if condition == false
return true if pc_complete == @item_max and condition == true
return false if pc_complete != @item_max and condition == true
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
list = Audio.explore
@data = list[0]
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Sound
# index : sound number
#--------------------------------------------------------------------------
def draw_item(index)
sound = @data[index]
x = index % @column_max * (288 + 32)
y = index / @column_max * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
text = Audio.erase_extansion_file(sound)
$game_party.played_bgm = {} if $game_party.played_bgm == nil
if $game_party.played_bgm[text] or @allsongs
self.contents.font.color = normal_color
self.contents.draw_text(rect, text, 1)
else
self.contents.font.color = text_color(7)
self.contents.draw_text(rect, "? ? ? ? ? ? ? ?", 1)
end
end
end

#==============================================================================
# ** Scene_SoundTest
#------------------------------------------------------------------------------
# SoundTest Scene
#==============================================================================

class Scene_SoundTest
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(allsongs = false)
@allsongs = allsongs
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def main
#super
Audio.bgm_and_bgs_memorize
Audio.bgm_stop
Audio.bgs_stop
@help_window = Window_Base.new(640/2, 0, 640/2, 24+32)
@help_window.contents = Bitmap.new(640/2-32, 24)
set_text(@help_window, "- None -", 1, true)
@complete_window = Window_Base.new(640/2,
480 - (24+32), 640/2, 24+32)
@complete_window.contents = Bitmap.new(640/2-32, 24)
@complete_window.visible = false if @allsongs
@pi = 3.14159265
@cd = Sprite.new
@cd.bitmap = RPG::Cache.picture("CD")
@cd.ox = @cd.bitmap.width/2
@cd.oy = @cd.bitmap.height/2
@cd.zoom_x = 0
@cd.y = 480/2 - @cd.bitmap.height/2 + 120
@zoom_cd = 0
@turn_cd = 0
@cd_play = false
@sound_window = Window_SoundTest.new(0, 0, 640/2, 480, @allsongs)
set_text(@complete_window, @sound_window.pcomplete, 1, true)
# Run transition
Graphics.transition
# Main loop
loop do
# Update the game screen
Graphics.update
# Update input information
Input.update
# Update frame
update
# When screen is switched, interrupt loop
if $scene != self
break
end
end
# Prepare Transition
Graphics.freeze
# Free the window
@help_window.dispose
@complete_window.dispose
@cd.dispose
@sound_window.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Set_text
#--------------------------------------------------------------------------
def set_text(window, text, align = 0, make = false)
if make
window.contents.font.name = $fontface
window.contents.font.size = $fontsize
window.contents.font.color = window.normal_color
end
window.contents.clear
window.contents.draw_text(0,0, window.width - 32, 24, text, align)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@help_window.update
@complete_window.update
@cd.update
@zoom_cd += 1
if @cd_play == true
@turn_cd += 16
@cd.zoom_x = 1
@cd.angle = @turn_cd
else
@cd.angle = 0
@turn_cd = 0
@cd.zoom_x = (1 * Math.sin(@zoom_cd/90.0*@pi)).abs
@cd.x = (640/1.33) - @cd.bitmap.width/2 * (Math.sin(@zoom_cd/@cd.bitmap.width/2*@pi).abs)
end
@sound_window.update
# If input B
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Audio.bgm_stop
Audio.play_music_memorize
return_scene
end
# If input A
if Input.trigger?(Input::A)
# Play SE (Decision)
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
@cd_play = false
set_text(@help_window, "- None -", 1)
end
# If input C
if Input.trigger?(Input::C)
sound = @sound_window.sound
# If not playing
stext = Audio.erase_extansion_file(sound)
if !$game_party.played_bgm[stext] and @allsongs == false
# SE play (Buzzer)
$game_system.se_play($data_system.buzzer_se)
return
end
Graphics.update
# Play SE (Decision)
$game_system.se_play($data_system.decision_se)
# Play BGM
Audio.bgm_play("Audio/BGM/" + sound, 100, 100)
@cd_play = true
text = sprintf("%02d", @sound_window.index + 1) + ":" + stext
set_text(@help_window, text, 1)
return
end
end
end


Demo VX
Here (1.1)

Instruction
Put the script in materials and rename it SoundTest.
The other instruction to setup script is included in the script.

Image need



Rename the picture :
CD.png
And put it in the pictures folder.

Terms and Conditions
-Please, credit me.

This post has been edited by badnomis: Jun 1 2010, 07:43 PM


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
3 Pages V   1 2 3 >  
Start new topic
Replies (1 - 19)
tofuman
post Feb 18 2009, 06:20 PM
Post #2


Level 2
Group Icon

Group: Member
Posts: 18
Type: None
RM Skill: Beginner




WOW!! THIS IS EXACTLY WHAT I WANTED!!!
DEFINITELY GONNA USE IT!! thumbsup.gif
Go to the top of the page
 
+Quote Post
   
Paulcell x
post Feb 18 2009, 06:43 PM
Post #3


Level 1
Group Icon

Group: Member
Posts: 11
Type: Artist
RM Skill: Skilled




Exelent!!!
I am defenely using this script!
Go to the top of the page
 
+Quote Post
   
SuperMega
post Feb 18 2009, 07:09 PM
Post #4


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




This is awesome, I was just thinking about something like this today. Great job!


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 18 2009, 07:19 PM
Post #5


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Thank you for these comments.


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
SuperMega
post Feb 18 2009, 07:41 PM
Post #6


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Hm, I seem to be getting an error when I load up my game:

Any idea how to fix this?

EDIT: This only seems to happen when I load my game up on a project. Otherwise, its fine.

This post has been edited by SuperMega: Feb 18 2009, 07:43 PM


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 18 2009, 07:54 PM
Post #7


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




I put demo on my post. Try the demo.


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 18 2009, 08:14 PM
Post #8


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




It is perhaps is incompatible with other script. As you other script in your project?


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 18 2009, 08:35 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Well, I think have find the problem and I will try fix it. You can do it yourself by following these instructions:
  1. Go on script list
  2. Go to Game_Party (In Game Objects)
  3. Write this on line 21 (only the bold text)
    QUOTE
    attr_accessor :last_target_index # for cursor memory: Target
    attr_accessor :played_bgm # played BGM
    #--------------------------------------------------------------------------
  4. Write this on line 36 (only the bold text)
    QUOTE
    @armors = {} # Inventory item hash (armor ID)
    @played_bgm = {}
    end
  5. Now it should work


This post has been edited by badnomis: Feb 18 2009, 08:56 PM


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
SuperMega
post Feb 18 2009, 08:36 PM
Post #10


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Yeah that fixed it for me, thanks.


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 18 2009, 09:09 PM
Post #11


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Well, the real problem it a saved game. If you save game before you put the script, it's probably bug but i will fix it soon

This post has been edited by badnomis: Feb 18 2009, 09:11 PM


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
Ziosin
post Feb 18 2009, 09:53 PM
Post #12


Doesn't ever stop believin'
Group Icon

Group: Revolutionary
Posts: 758
Type: Writer
RM Skill: Skilled




This script works absolutely perfectly for me. Thanks smile.gif


__________________________
Ziosin's signature, V3.0



Colossus Reborn

Project has been abandoned. I'm gonna keep around the kickass logo, though.
Go to the top of the page
 
+Quote Post
   
TalesOf_Fantasy
post Feb 18 2009, 10:46 PM
Post #13


Level 3
Group Icon

Group: Member
Posts: 42
Type: Artist
RM Skill: Skilled




Cooool Dude! thumbsup.gif


__________________________



MZ Multimedia Studios current projcts:

Divine Fantasy
Entusia 'The Unlimited Sky'
Go to the top of the page
 
+Quote Post
   
SojaBird
post Feb 19 2009, 02:43 AM
Post #14


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




A pretty neat script wink.gif
Good job.


Greatzz,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.

Thanks in advance.


Hey there,

Well I don't make battle neither though I can still teach you some things :)...
The way I've learned to script is by reading other scripts for the most part.
I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!!
The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script.
You also need to feel the competition that's around in the scripting-community.
Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P
So that's an other thing...
You also don't need to be afraid to learn from others or helpfiles.
When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember.
Then, you must be calm, cause you need to try the script a lot of times.
When I write a script, I test it after almost every changes.
First I set up the major structure.
Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base
def initialize(x,y,width,height)
super(x,y,width,height)
refresh
end

def refresh
self.contents.clear
draw_contents
end

def draw_contents
draw_something(with, some, parameters)
end

def update
refresh if @something != @what_it_should_be
end
end
So that's also very important.
Then, the biggest thing I learned scripting from is TRIAL AND ERROR.
That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.

So that's it how I did it.
Now it's up to you.
Do some requests (if I didn't do it allready :P) and learn from them.

Hope that helped you out a little.
If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials.
Perhaps they're going to be usefull for you one day ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
TakamiDaisuke
post Feb 19 2009, 04:15 AM
Post #15


Level 2
Group Icon

Group: Member
Posts: 29
Type: Artist
RM Skill: Beginner




i was using space not far's sound test script, but your script is better than it!Thank u to upload!
And.... I'd like to make event when complete sound list. How can I make it? Even as "when you complete list, one character give you a item, but if you don't complete that character doesn't give you anything"

This post has been edited by TakamiDaisuke: Feb 19 2009, 04:22 AM
Go to the top of the page
 
+Quote Post
   
SuperMega
post Feb 19 2009, 10:19 AM
Post #16


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




QUOTE (badnomis @ Feb 18 2009, 10:09 PM) *
Well, the real problem it a saved game. If you save game before you put the script, it's probably bug but i will fix it soon

Yes, that is what I did wrong. Its perfect now though, and I am having no trouble using it. Thanks for the awesome script!


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
badnomis
post Feb 19 2009, 06:52 PM
Post #17


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Thanks you for these comments thanks.gif
I will try to make others scripts

This post has been edited by badnomis: Feb 19 2009, 06:53 PM


__________________________
List of my script
Go to the top of the page
 
+Quote Post
   
buny
post Feb 20 2009, 06:25 AM
Post #18


Level 15
Group Icon

Group: Revolutionary
Posts: 294
Type: Developer
RM Skill: Intermediate




I hope you can make it in form of I-Pod~


__________________________







Topic'Z

VLAD REQUIEM IS UPDATE! to ~8~
The TopicszZ


@~Action Battle System~@


[Show/Hide] Action Battle System
Bored Battle System Like This
[Show/Hide] Normal Style


So Do you liem MMORPG style?or Zelda?
if yes you'll need this...
style~>
[Show/Hide] Requiem SABS


Join Here ABS


@###@@@###@#
@####@##@##@##
@@#@@@##@@


[Show/Hide] good again
[Show/Hide] NEVER GIVE UP
[Show/Hide] DONT WASTE MY TIME AGAIN!!!!!!!!!!!!!!!!!!!!
[Show/Hide] LASSSSTTTTT ONE
clever you are the 99999999 visitors who open this get outta here!!!!!
Go to the top of the page
 
+Quote Post
   
SuperMega
post Feb 20 2009, 10:18 AM
Post #19


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




QUOTE (buny @ Feb 20 2009, 06:25 AM) *
I hope you can make it in form of I-Pod~

You can always save an Ipod pic that is the same size as the CD here and it will work. Except, it will spin when music plays just like the CD. You just have to name it CD.Png

This post has been edited by SuperMega: Feb 20 2009, 10:18 AM


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
Arcanamagek
post Feb 21 2009, 06:56 AM
Post #20



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Skilled




Is it possible to add all songs at once? Because in my game theres an option on the Title Screen called extra. There you can learn the game and play minigames but I also want it so that theres a place where you can listen to the music of the game.
Go to the top of the page
 
+Quote Post
   

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 07:20 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker