Jump to content
Rpg²S Forum

*Jukebox


amivaleo
 Share

Recommended Posts

Jukebox

 

 

Descrizione

 

Visualizza una finestra con l'elenco delle musiche (BGM) presenti nella vostra cartella di gioco, funzionando come un jukebox.

 

 

Autore

 

Ziel van Brand

 

 

Allegati

 

Screen:

http://img413.imageshack.us/img413/6677/immagine2wx8.jpg

 

NOTA:
non fate caso alla mia windowskin. Per diversi motivi ho dovuto renderla così.

 

 

Istruzioni per l'uso

 

Copiate lo script riportato di seguito in una nuova classe sopra il
Main
e chiamatelo "MUSICA".

 

 

#=====================================
# ■ Jukebox
# Ziel van Brand
#=====================================


#=====================================
# ■ Window_Music
# Ziel van Brand
#=====================================
class Window_Music < Window_Selectable
 #--------------------------------------------------------------------------
 def initialize
super(4*32+16, 32+16, 11*32, 9*32)
self.active = true
self.opacity = 160
self.index = 0
@item_max = 27 #!!!#
@column_max = 1
@commands = ["Accept your Faith", "Against the insane", "Anxiety",
							"A Church by Night", "Death behind you", "Fight the sinners",
							"Goodbye Alastor", "I'll always love you", "In the memories of nightmares",
							"Inside the saint's mind", "La Masquerade Infernale", "Memories are breathening",
							"My dear son", "Nightmares from the past", "One prison for my soul",
							"Path of the wandering soul", "Running as fast as the wind", "Sacrifice your own father",
							"Silence", "Since crying is useless", "Since the spirit is dead",
							"The bleeding picture", "This is the end", "This is the truth",
							"Time reigns", "Welcome to Emptyness", "You can only accept it"] #!!!#
self.contents = Bitmap.new(width - 32, row_max*32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
 end
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
for i in 0...@item_max
  draw_item(i)
end
 end
 #--------------------------------------------------------------------------
 def name
return @commands[self.index]
 end
 #--------------------------------------------------------------------------
 def draw_item(index)
self.contents.draw_text(0, index*32, width-32, 32, @commands[index], 1)
 end
 #--------------------------------------------------------------------------
 def update_help
@help_window.set_text(@description[index], 1)
 end
 #--------------------------------------------------------------------------
end


#=====================================
# ■ Scene_Music
# Ziel van Brand
#=====================================
class Scene_Music
 #--------------------------------------------------------------------------
 def main
@background = Spriteset_Map.new
@music_window = Window_Music.new
$game_system.bgm_memorize
Graphics.transition
loop do
  Graphics.update
  Input.update
  update
  if $scene != self
	break
  end
end
Graphics.freeze
@background.dispose
@music_window.dispose
 end
 #--------------------------------------------------------------------------
 def update
$game_map.update
$game_system.update
$game_screen.update
@background.update
@music_window.update
if Input.trigger?(Input::B)
  $game_system.se_play($data_system.cancel_se)
  $game_system.bgm_restore
  $scene = Scene_Map.new
  return
end
if Input.trigger?(Input::C)
  Audio.bgm_play("Audio/BGM/" + @music_window.name, @bgm.volume, 100)
  return
end
 end
 #--------------------------------------------------------------------------
end

 

 

Potete visualizzare la schermata "Musica" inserendo in un evento un "Call Script" con questa stringa:

 

$scene = Scene_Music.new

 

Cercate la stringa:

 

@item_max = 27

 

Il valore 27 sta ad indicare il numero di canzoni contenute nella vostra cartella. Ovviamente modificatelo in base al numero delle
vostre
canzoni.

 

Subito sotto troverete la stringa:

 

@commands = [...]

 

Dovete inserire di seguite il nome dei BGM contenuti nella relativa cartella del gioco. Ogni nome deve essere
IDENTICO
a quello del file a cui si riferisce, comprese maiuscole e minuscole. I nomi vanno quindi inseriti secondo questo schema:

 

["NOME_BGM_1","NOME_BGM_2","NOME_BGM_3"]

 

Fate attenzione alle virgole ( , ) e alle virgolette ( " ).

 

 

Bugs e Conflitti Noti

 

Questo script dovrebbe funzionare a prescindere da qualunque altro script, in quanto non altera alcuna variabile globale nè alcuna funzione definita in altri script.

 

Se usate lo script
scritto da me, sostituire la stringa:

 

Audio.bgm_play("Audio/BGM/" + @music_window.name, @bgm.volume, 100)

 

con:

 

Audio.bgm_play("Audio/BGM/" + @music_window.name, $me_volume, 100)

 

 

Altri Dettagli

Sono disponibile a qualunque modifica dello script in qualunque sua parte anche ad ampliamenti di ogni genere.

Edited by Ziel van Brand
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...