=begin
=========================================
Professional Title Screen ver. 2.0 English Translation
Script by ???, Edited by Kio !! :D
SFS Patch by shdwlink1993
http://rpg.para.s3p.net/
-->Released and translated by Sonicia.
Search for my name (Sonicia)for the customizing place where you can arange the
graphics where you want them. Please credit Kio, who orginally made this script
compatable, and me for translating, releasing, and finding out how to use it.
Note, in a few rare spots there is still Japanese, since it was code I didnt
change it for fear of messing it up. All comments are translated by Sonicia.
Note: you need continue.png, continue_active.png, newgame.png,
newgame_active.png, shutdown.png, shutdown_active.png, newgameplus.png, and
newgameplus_active.png in your game's graphics\title folder. The graphics must
be the same size, both active and inactive. This means that if you have an
arrow or text make that one first, duplicate, then erase the arrow and edit
the rest of the picture or it will be set off.
=========================================
=========================================
Title menu picture
=========================================
=end
module PARA_TITLE_CUSTOM
# Menu command picture, (true/false)
IMG_MENU = true
#?---Menu command picture Setting---
#Character string of menu command
#MENU_NEWGAME = "new game" # new game
MENU_NEWGAME = '??????' # ??????
#MENU_LOAD = "continuing" # continuing
MENU_LOAD = '???????' # ???????
#MENU_END = "shutdown" # shutdown
MENU_END = '???????' # ???????
MENU_NEWGAMEPLUS = 'new game plus' #new game plus
# window frame (true/false)
WINDOW_TRANS = false
#Transparency of the window frame
WINDOW_OPACITY = 160
#Side size (horizontal?) of # window
WINDOW_WIDTH = 192
#Vertical position of window (0: Coordinate appointment/
#1: The left edge/2: Center/3: Right hand edge)
WINDOW_ALIGN = 2
#When # "coordinate appointment" being, abscissa of the window
WINDOW_POS_X = 0
#Vertical position of # window (0: Coordinate appointment/
#1: Top/2: Center/3: Bottom)
WINDOW_VALIGN = 0
#When "coordinate appointment" being, ordinate of the window
WINDOW_POS_Y = 288
#==========================================
=begin
Sonicia
Customize the location and the graphics make sure you change
only the numbers, 250 is approxamtely the center of
the vertical screen.
Make sure that the command pictures are in the "Graphics/Titles" folder
=end
#==========================================
=begin
#New Game Graphic
IMG_NEWGAME = ['newgame','newgame_active']
IMG_NEWGAME_X = 100 # Horizontal position
IMG_NEWGAME_Y = 160 # Vertical position
#Continue Graphic
IMG_LOAD = ['continue','continue_active']
IMG_LOAD_X = 250 # Horizontal position
IMG_LOAD_Y = 160 # Vertical position
#Shut Down Graphic
IMG_END = ['shutdown','shutdown_active']
IMG_END_X = 400 # Horizontal position
IMG_END_Y = 160 # Vertical position
=end
#My orginal settings for reference Copy and paste if you need to
#New Game Graphic
IMG_NEWGAME = ['newgame','newgame_active']
IMG_NEWGAME_X = 100 # Horizontal position
IMG_NEWGAME_Y = 160 # Vertical position
#New Game Plus Graphic
IMG_NEWGAMEPLUS = ['newgameplus','newgameplus_active']
IMG_NEWGAMEPLUS_X = 180 # Horizontal position
IMG_NEWGAMEPLUS_Y = 180 # Vertical position
#Continue Graphic
IMG_LOAD = ['continue','continue_active']
IMG_LOAD_X = 212 # Horizontal position
IMG_LOAD_Y = 250 # Vertical position
#Shut Down Graphic
IMG_END = ['shutdown','shutdown_active']
IMG_END_X = 252 # Horizontal position
IMG_END_Y = 320 # Vertical position
#END CUSTOMIZABLE AREA
#============================================
#Synthetic method of picture (0: Usually/1: Addition/2: Subtraction)
BLEND_TYPE = 0
end
#------------------------------------------------------------------------------
#======================================
# ? Scene_Title
#======================================
class Scene_Title
#--------------------------------------------------------------------------
# - Main processing
#--------------------------------------------------------------------------
def main
#If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data('Data/Actors.rxdata')
$data_classes = load_data('Data/Classes.rxdata')
$data_skills = load_data('Data/Skills.rxdata')
$data_items = load_data('Data/Items.rxdata')
$data_weapons = load_data('Data/Weapons.rxdata')
$data_armors = load_data('Data/Armors.rxdata')
$data_enemies = load_data('Data/Enemies.rxdata')
$data_troops = load_data('Data/Troops.rxdata')
$data_states = load_data('Data/States.rxdata')
$data_animations = load_data('Data/Animations.rxdata')
$data_tilesets = load_data('Data/Tilesets.rxdata')
$data_common_events = load_data('Data/CommonEvents.rxdata')
$data_system = load_data('Data/System.rxdata')
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = PARA_TITLE_CUSTOM::MENU_NEWGAME
if SL93::NGP
s2 = PARA_TITLE_CUSTOM::MENU_NEWGAMEPLUS
s3 = PARA_TITLE_CUSTOM::MENU_LOAD
s4 = PARA_TITLE_CUSTOM::MENU_END
else
s2 = PARA_TITLE_CUSTOM::MENU_LOAD
s3 = PARA_TITLE_CUSTOM::MENU_END
end
w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
if SL93::NGP
@command_window = Window_Command.new(w, [s1, s2, s3, s4])
else
@command_window = Window_Command.new(w, [s1, s2, s3])
end
if PARA_TITLE_CUSTOM::WINDOW_TRANS
@command_window.opacity = 0
else
@command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
end
# Position of the window
case PARA_TITLE_CUSTOM::WINDOW_ALIGN
when 0 then @command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X
when 1 then @command_window.x = 0
when 2 then @command_window.x = ( 640 - @command_window.width ) / 2
when 3 then @command_window.x = 640 - @command_window.width
end
case PARA_TITLE_CUSTOM::WINDOW_VALIGN
when 0 then @command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y
when 1 then @command_window.y = 0
when 2 then @command_window.y = ( 480 - @command_window.height ) / 2
when 3 then @command_window.y = 480 - @command_window.height
end
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = (0..SL93::SAVE_FILES-1).any? {|i|
if SL93::DREAM
FileTest.exist?("#{SAVE_NAME}#{file_index + 1}.dream4") if SL93::DREAM
else
FileTest.exist?("Save#{i+1}.rxdata") if !SL93::DREAM
end
}
@newgameplus_enabled = (0..8).any? {|i|
FileTest.exist?("Complete#{i+1}.ngp")
} if SL93::NGP
@newgame_enabled = true
@newgame_enabled = (SL93::CURRENT_DISK == 1) if SL93::MDS
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
@command_window.disable_item(0) if !@newgame_enabled && SL93::MDS
@command_window.disable_item(1) if !@newgameplus_enabled && SL93::NGP
if @continue_enabled
@command_window.index = 1
else
if SL93::NGP
@command_window.disable_item(2)
else
@command_window.disable_item(1)
end
end
# Command Picture
if PARA_TITLE_CUSTOM::IMG_MENU
@command_window.visible = false
@command_img1 = Sprite.new
@command_img1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img1.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X
@command_img1.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y
@command_img2 = Sprite.new
@command_img2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img2.x = PARA_TITLE_CUSTOM::IMG_LOAD_X
@command_img2.y = PARA_TITLE_CUSTOM::IMG_LOAD_Y
@command_img3 = Sprite.new
@command_img3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img3.x = PARA_TITLE_CUSTOM::IMG_END_X
@command_img3.y = PARA_TITLE_CUSTOM::IMG_END_Y
if SL93::NGP
@command_img4 = Sprite.new
@command_img4.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img4.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS[0])
@command_img4.x = PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS_X
@command_img4.y = PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS_Y
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
@command_img1.opacity = 160 if SL93::MDS && !@newgame_enabled
@command_img4.opacity = 160 if SL93::NGP && !@newgameplus_enabled
if @continue_enabled
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
else
@command_img2.opacity = 160
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
end
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
break if $scene != self
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
if PARA_TITLE_CUSTOM::IMG_MENU
@command_img1.dispose
@command_img2.dispose
@command_img3.dispose
@command_img4.dispose if SL93::NGP
end
# Graphics Dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
if SL93::NGP
# Branch by command window cursor position
case @command_window.index
when 0 then command_new_game # New game
when 1 then command_continue # Continue
when 2 then command_shutdown # Shutdown
end
else
# Branch by command window cursor position
case @command_window.index
when 0 then command_new_game # New game
when 1 then command_continue # Continue
when 2 then command_shutdown # Shutdown
end
end
end
if PARA_TITLE_CUSTOM::IMG_MENU
if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
if SL93::NGP
case @command_window.index
when 0 # New Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img4.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS[0])
when 1 # New Game Plus
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img4.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS[1])
when 2 # Continue Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img4.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS[0])
when 3 # End Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[1])
@command_img4.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAMEPLUS[0])
end
else
case @command_window.index
when 0 # New Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
when 1 # Continue Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
when 2 # End Game
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[1])
end
end
end
end
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data('Data/BT_Actors.rxdata')
$data_classes = load_data('Data/BT_Classes.rxdata')
$data_skills = load_data('Data/BT_Skills.rxdata')
$data_items = load_data('Data/BT_Items.rxdata')
$data_weapons = load_data('Data/BT_Weapons.rxdata')
$data_armors = load_data('Data/BT_Armors.rxdata')
$data_enemies = load_data('Data/BT_Enemies.rxdata')
$data_troops = load_data('Data/BT_Troops.rxdata')
$data_states = load_data('Data/BT_States.rxdata')
$data_animations = load_data('Data/BT_Animations.rxdata')
$data_tilesets = load_data('Data/BT_Tilesets.rxdata')
$data_common_events = load_data('Data/BT_CommonEvents.rxdata')
$data_system = load_data('Data/BT_System.rxdata')
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
end