Title Screen Music problems.

Not sure if this is the right place to ask for help with this, but I have these two scripts that I'm using and they work well enough for what I need them. The problem seems to be when they're used together, as it stops the Title Screen music from playing.

 

Another problem is with the Press Title script, it only lets the music play when you load the game up the first time. If you go into a game and then exit back out to the Title Screen it doesn't play the Title Screen's music like it would without the script.

 

Is there a way to fix this?

 

Here's the scripts:

 


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

# XS - Press Title

# Author: Nicke

# Created: 04/11/2012

# Edited: 05/11/2012

# Version: 1.0

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

# Instructions

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

# To install this script, open up your script editor and copy/paste this script

# to an open slot below ? Materials but above ? Main. Remember to save.

#

# Press start title script.

# This will enables a "Press Start" text before the actual title scene.

# Like oldschool RPGs had.

#

# *** Only for RPG Maker VX Ace. ***

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

($imported ||= {})["XAIL-PRESS-TITLE"] = true

 

module XAIL

module PRESS_TITLE

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

# * Settings

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

# FONT = [name, size, color, bold, shadow]

FONT = [["Verdana"], 32, Color.new(255,255,255), true, true]

 

# Setup the text here.

# TEXT = [name, x, y]

TEXT = ["-PRESS START-", 154, 90]

 

# The button to enter the title scene.

# BUTTON = :symbol

BUTTON = :C

 

# Goto scene.

SCENE = Scene_Title

 

# Blink delay.

# BLINK = [blink_in, blink_out]

BLINK = [40, 40]

 

# Skip this scene?

# SKIP = true/false

SKIP = false

 

end

end

# *** Don't edit below unless you know what you are doing. ***

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

# ** SceneManager

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

class << SceneManager

 

alias xail_press_title_scenemanager_first_scene_class first_scene_class

def first_scene_class(*args, &block)

# // Method for first scene class.

return xail_press_title_scenemanager_first_scene_class(*args, &block) if XAIL:😛RESS_TITLE::SKIP

$BTEST ? Scene_Battle : Scene_Press_Title

end

 

end

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

# ** Scene_Press_Title

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

class Scene_Press_Title < Scene_Base

 

def initialize

# // Method to initialize the scene.

play_title_music

create_background

display_text

end

 

def update

# // Method to update the scene.

super

goto_scene

end

 

def delay?(amount)

# // Method to delay.

return if Input.trigger?(XAIL:😛RESS_TITLE::BUTTON)

if amount.nil?

loop do

update_basic

break if Input.trigger?(XAIL:😛RESS_TITLE::BUTTON)

end

else

amount.times do

update_basic

break if Input.trigger?(XAIL:😛RESS_TITLE::BUTTON)

end

end

end

 

def center_sprite(sprite)

# // Method to center a sprite.

sprite.ox = sprite.bitmap.width / 2

sprite.oy = sprite.bitmap.height / 2

sprite.x = Graphics.width / 2

sprite.y = Graphics.height / 2

end

 

def create_background

# // Method to create the title background.

@sprite1 = Sprite.new

@sprite1.bitmap = Cache.title1($data_system.title1_name)

@sprite2 = Sprite.new

@sprite2.bitmap = Cache.title2($data_system.title2_name)

center_sprite(@sprite1)

center_sprite(@sprite2)

end

 

def display_text

# // Method to display the "press enter" text.

text = XAIL:😛RESS_TITLE::TEXT

t = Sprite.new

t.z = 5000

t.bitmap = Bitmap.new(Graphics.width, Graphics.height)

t.bitmap.font.name = XAIL:😛RESS_TITLE::FONT[0]

t.bitmap.font.size = XAIL:😛RESS_TITLE::FONT[1]

t.bitmap.font.color = XAIL:😛RESS_TITLE::FONT[2]

t.bitmap.font.bold = XAIL:😛RESS_TITLE::FONT[3]

t.bitmap.font.shadow = XAIL:😛RESS_TITLE::FONT[4]

t.bitmap.draw_text(text[1], text[2], Graphics.width, Graphics.height, text[0])

loop do

break if Input.trigger?(XAIL:😛RESS_TITLE::BUTTON)

update_basic

t.opacity = 255

delay?(XAIL:😛RESS_TITLE::BLINK[0])

t.opacity = 0

delay?(XAIL:😛RESS_TITLE::BLINK[1])

end

t = nil, t.dispose unless t.nil?

end

 

def goto_scene

# // Method to go to specified scene.

SceneManager.goto(XAIL:😛RESS_TITLE::SCENE)

end

 

def play_title_music

# // Method to play the title music.

$data_system.title_bgm.play

RPG::BGS.stop

RPG::ME.stop

end

 

end

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

# ** Scene_Title

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

class Scene_Title < Scene_Base

 

def play_title_music

# // Override title music for original scene.

end

 

end # END OF FILE

 

#=*==========================================================================*=#

# ** END OF FILE

#=*==========================================================================*=#



 


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

# SIMPLE SPLASH SCREENS

# V 1.0

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

# Author: Shaz

# Date: June 17, 2013

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

# Instructions:

# Place into a new slot below other scripts

# Adjust values in FADE_TIME, HOLD_TIME and CLICKTHROUGH as necessar

# Create a Graphics/Splash folder

# Add images to Graphics/Splash folder with a name of Splash#.*

# where # is a number and * is the file type

# eg: Splash1.png Splash2.jpg

# When distributing, copy and remove Graphics/Splash folder during compression

# and add it back in after extracting the compressed file - this allows

# distributors to add and resequence splash screens to meet their own

# requirements

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

 

module Cache

def self.splash(filename)

load_bitmap("Graphics/Splash/", filename)

end

end

 

module SceneManager

def self.first_scene_class

$BTEST ? Scene_Battle : $TEST ? Scene_Title : Scene_Splash

end

end

 

class Scene_Splash < Scene_Base

# fade/hold times in seconds

FADE_TIME = 0.5

HOLD_TIME = 3

# allow space bar to skip waiting

CLICKTHROUGH = true

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

# * Start Processing

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

def start

super

Graphics.fadeout(0)

 

# Create list of splash screens

@splashes = Dir.entries("Graphics/Splash").select {|name| name =~ /splash/i}.sort

 

# Display splash screens

@splashes.each do |splash|

show_splash(splash)

end

 

# Go to title

SceneManager.goto(Scene_Title)

end

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

# * Show Splash Screen

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

def show_splash(splash)

# display splash screen

@splash = Sprite.new

@splash.bitmap = Cache.splash(splash)

 

# fade in

Graphics.fadein(FADE_TIME * Graphics.frame_rate)

Graphics.wait(FADE_TIME * Graphics.frame_rate)

 

# pause

(HOLD_TIME * Graphics.frame_rate).times do

# break if skippable

Graphics.update

Input.update

break if CLICKTHROUGH && Input.trigger?🙂C)

end

 

# fade out and dispose

Graphics.fadeout(FADE_TIME * Graphics.frame_rate)

Graphics.wait(FADE_TIME * Graphics.frame_rate)

@splash.bitmap.dispose

@splash.dispose

end

 

end

Original thread: https://forums.rpgmakerweb.com/threads/title-screen-music-problems.24554/