Idle Title intro
Version: 1.0
Author: TDS
Date: September 1, 2011
Version History
- 1.0 09.01.2011 - Public release.
Description
Allows you to start a map for an intro after idling for a preset period of time in the title screen.
Features
- Starts a map after a while idling in the title screen.
- Interrupts intro in the map if desired.
Instructions
They're in the script.
Script
#==============================================================================
# ** TDS Idle Title Intro
# Ver: 1.0
#------------------------------------------------------------------------------
# * Description:
# This script allows you to make an intro start after an amount of time has
# passed idling in the title screen.
#------------------------------------------------------------------------------
# * Features:
# Starts a map after a while idling in the title screen.
# Interrupts intro in the map if desired.
#------------------------------------------------------------------------------
# * Instructions:
# Edit the constants below the script information to set it up how you want.
#------------------------------------------------------------------------------
# * Notes:
# To make a good automatic intro make sure to use \! \^ commands in the text
# box and use the "Return to title" event command at the end of your intro.
#------------------------------------------------------------------------------
# * New Methods:
# Scene_Title:
# - reset_idle_intro_counter?
# ^ Used to determine if any input has happened to interrupt the idle intro.
# - start_idle_intro
# ^ Used to start the idle intro in the map.
#
# Scene_Map:
# - interrupt_idle_intro?
# ^ Used to interrupt the idle intro in the map and return to title.
#------------------------------------------------------------------------------
# * Aliased Methods:
# Game_Temp:
# - initialize
# ^ Aliased to initialize the viewing idle intro flag.
#
# Scene_Title:
# - initialize
# ^ Aliased to initialize the idle intro counter.
# - update
# ^ Aliased to process the idle intro values and methods.
#
# Scene_Map:
# - update
# ^ Aliased to process the idle intro interruption methods.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#==============================================================================
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
# Idle Title Intro Wait (in frames)
IDLE_TITLE_INTRO_WAIT = 700
# Idle Title Intro Start Map ID
IDLE_TITLE_INTRO_START_MAP_ID = 1
# Idle Title Intro Start X Position
IDLE_TITLE_INTRO_START_X = 0
# Idle Title Intro Start Y Position
IDLE_TITLE_INTRO_START_Y = 0
# Idle Title Intro Start Screen Tone
IDLE_TITLE_INTRO_START_SCREEN_TONE = Tone.new(0, 0, 0, 0)
# If Idle Titlle intro in map can be interrupted once started
CAN_INTERRUPT_MAP_INDLE_TITLE_INTRO = true
# Array of Idle Interrupt Keys
IDLE_INTERRUPT_KEYS = [Input::A, Input::B, Input::C, Input::X, Input::Y,
Input::Z, Input::L, Input::R, Input::DOWN, Input::LEFT, Input::RIGHT,
Input::UP, Input::SHIFT, Input::CTRL, Input::ALT]
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_idle_title_intro_game_temp_initialize initialize unless $@
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :viewing_idle_title_intro # Viewing Idle Title Intro Flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Run Original Method
tds_idle_title_intro_game_temp_initialize
# Set Viewing Title Idle intro flag to false
@viewing_idle_title_intro = false
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_idle_title_intro_scene_title_initialize initialize unless $@
alias tds_idle_title_intro_scene_title_update update unless $@
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Run Original Method
tds_idle_title_intro_scene_title_initialize
# Set Idle Intro Counter Initial Value
@idle_intro_counter = 0
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Run Original Method
tds_idle_title_intro_scene_title_update
# Reset Idle Intro Counter
@idle_intro_counter = 0 if reset_idle_intro_counter?
# Increase Idle Intro Counter
@idle_intro_counter += 1
# Start Idle Intro Idle Intro Counter is equal or more to idle intro wait
start_idle_intro if @idle_intro_counter >= IDLE_TITLE_INTRO_WAIT
end
#--------------------------------------------------------------------------
# * Determine if idle title intro counter is to be reset
#--------------------------------------------------------------------------
def reset_idle_intro_counter?
# Go Through Idle Interrup Keys
IDLE_INTERRUPT_KEYS.each {|key|
# Return true if Interrupt key has been pressed
return true if Input.trigger?(key) or Input.press?(key) or Input.repeat?(key)
}
# Return false by default
return false
end
#--------------------------------------------------------------------------
# * Start Idle Intro
#--------------------------------------------------------------------------
def start_idle_intro
# Initial party
$game_party.setup_starting_members
# Initial map position
$game_map.setup(IDLE_TITLE_INTRO_START_MAP_ID)
$game_player.moveto(IDLE_TITLE_INTRO_START_X, IDLE_TITLE_INTRO_START_Y)
$game_player.refresh
$scene = Scene_Map.new
# Start Game Map Tone change
$game_map.screen.start_tone_change(IDLE_TITLE_INTRO_START_SCREEN_TONE, 0)
# Set Viewing Idle Intro flag to true
$game_temp.viewing_idle_title_intro = true
RPG::BGM.fade(1500)
close_command_window if @command_window != nil
Graphics.fadeout(60)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_idle_title_intro_scene_map_update update unless $@
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Run Original Method
tds_idle_title_intro_scene_map_update
# Call title If Viewing Idle Intro and idle intro is interrupted
call_title if $game_temp.viewing_idle_title_intro and interrupt_idle_intro?
end
#--------------------------------------------------------------------------
# * Determine if idle intro should be interrupted
#--------------------------------------------------------------------------
def interrupt_idle_intro?
# Return false if Idle Intro cannot be interrupted
return false if !CAN_INTERRUPT_MAP_INDLE_TITLE_INTRO
# Go Through Idle Interrup Keys
IDLE_INTERRUPT_KEYS.each {|key|
# Return true if Interrupt key has been pressed
return true if Input.trigger?(key) or Input.press?(key) or Input.repeat?(key)
}
# Return false by default
return false
end
end
Credit
Support
On this topic.
Known Compatibility Issues
There could be some compatibility issues with other custom title screen scripts.
Author's Notes
To make a good automatic intro make sure to use \! \^ commands in the text box and use the "Return to title" event command at the end of your intro.
Restrictions
Only for use in non-commercial games.