Jump to content
Zerbu

Zerbu Engine - Random Title BGM

Recommended Posts

Random Title BGM

 

Introduction

This script allows you to specify multiple BGMs to play on the title screen. A random one from the list is played each time the title screen is displayed.

 

Instructions

Edit the option near the top of the script to set the BGMs that can play.

 

Script

 

 

#============================================================================
# Zerbu Engine - Random Title BGM
#----------------------------------------------------------------------------
# This script allows you to specify multiple BGMs to play on the title
# screen. A random one from the list is played each time the title screen
# is displayed.
#============================================================================

#============================================================================
# (module) ZE_Random_Title_BGM
#============================================================================
module ZE_Random_Title_BGM
 ZE_RTBGM = {
   #------------------------------------------------------------------------
   # Options
   #------------------------------------------------------------------------
   # This is the list of BGMs that can play on the title screen. The format
   # to use is: ["Name", volume, pitch]
   #------------------------------------------------------------------------
   :RANDOMIZE => [
     ["Theme2", 100, 100],
     ["Theme3", 100, 100],
     ["Theme4", 100, 100],
     ["Theme5", 100, 100],
   ]
 }
end

#============================================================================
# Scene_Title
#============================================================================
class Scene_Title
 include ZE_Random_Title_BGM
 #--------------------------------------------------------------------------
 # overwrite method: play_title_music
 #--------------------------------------------------------------------------
 def play_title_music
   #---
   bgm = ZE_RTBGM[:RANDOMIZE][rand(ZE_RTBGM[:RANDOMIZE].size)]
   RPG::BGM.new(bgm[0], bgm[1], bgm[2]).play
   RPG::BGS.stop
   RPG::ME.stop
   #---
 end
end

 

 

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted