- Joined
- Mar 17, 2012
- Messages
- 825
- Reaction score
- 346
- Primarily Uses
Dynamic Title 1.1
by Racheal
Introduction
This script changes the title screen based on a variable set in-game. This could be used, for example, to add a character to the title screen after you meet them.
Features
- Change the background, foreground, or both.
- Pull the variable from the latest save or the highest from all the saves.
- Use numbers corresponding to the variable for your images or set the names of the files you would like to use
How to Use
Insert the script anywhere in the Materials section above Main.
Script
Code:
#==============================================================================
# Dynamic Title
# by: Racheal
# Version 1.1
# Created: 24/06/2013
# Updated: 27/09/2013
#==============================================================================
# Changes the title screen based on a variable set in-game.
#==============================================================================
# Instructions:
# * Insert in the Materials section
# * Configure to your liking below
#==============================================================================
# Compatibility:
# This script is for RPG Maker VX Ace
# It is unlikely to work with anything that modifies the way the
# title screen is drawn such as an animated title screen
# * Overwrites: Scene_Title: create_background
#==============================================================================
#==============================================================================
# Customization
#==============================================================================
module Racheal_Title
#Set which variable controls the change in the title screen
TITLE_VARIABLE = 5
#Set which parts of the title screen are affected
CHANGE_BACKGROUND = true
CHANGE_FOREGROUND = true
#Set whether to check the highest variable in all the save files or
#just use the most recent save
CHECK_ALL_SAVES = false
#Set whether to use a series of numbers for the filenames (0.png, 1.png, etc)
#or a series of names you define below
USE_FILENAMES = true
BACKGROUND_NAMES = ["Volcano", "Night"]
FOREGROUND_NAMES = ["Gargoyles", ""]
end
#==============================================================================
# End Customization
#==============================================================================
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Create Save Header
#--------------------------------------------------------------------------
class << self; alias dynamic_title_make_save_header make_save_header; end
def self.make_save_header
header = dynamic_title_make_save_header
header[:title] = $game_variables[Racheal_Title::TITLE_VARIABLE]
header
end
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Create Background
#--------------------------------------------------------------------------
def create_background
@sprite1 = Sprite.new
sprite_name = Racheal_Title::CHANGE_BACKGROUND ? get_title(1) : $data_system.title1_name
@sprite1.bitmap = Cache.title1(sprite_name)
@sprite2 = Sprite.new
sprite_name = Racheal_Title::CHANGE_FOREGROUND ? get_title(2) : $data_system.title2_name
@sprite2.bitmap = Cache.title2(sprite_name)
center_sprite(@sprite1)
center_sprite(@sprite2)
end
#--------------------------------------------------------------------------
# * Get Title Sprite Name
#--------------------------------------------------------------------------
def get_title(num)
title = 0
if Racheal_Title::CHECK_ALL_SAVES
#Check all saves
for i in 0...DataManager.savefile_max
header = DataManager.load_header(i)
next unless header and header[:title]
title = [title, header[:title]].max
end
else
#Check latest save
header = DataManager.load_header(DataManager.latest_savefile_index)
if header and header[:title]
title = [title, header[:title]].max
end
end
#---
if Racheal_Title::USE_FILENAMES
#convert number to name
case num
when 1
return Racheal_Title::BACKGROUND_NAMES[title]
when 2
return Racheal_Title::FOREGROUND_NAMES[title]
end
else
return title.to_s
end
end
end
Credit
- Racheal
Author's Notes
Free for commercial and non-commercial use. Just credit me (and let me know if you use it, just because). There's really not too much to this script. Version 1.1 features increased compatibility with save systems thanks to estriole's tip.
As this is a script that modifies the save header, it will not work with saves created before this script was installed.
Last edited by a moderator:


