TDS Auto Intro
#1
TDS Auto Intro
by Sephirothtds
Apr 7 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Description

This script makes the title screen go to a map after a certain time of inactivity in the title screen.

Version

1.2
-Removed 100 + lines of unneeded code and aliased the update method.-
1.3
-Removed lines of codes and aliased the main method.

Instructions

Really simple to use just put it above main and edit the lines 10 through 20 to choose the options you want.


Script
Code:
#==============================================================================
# ** TDS Auto Intro [Scene Title]
# Version 1.3
# Fix: Shortened the code thank you aliasing.
# Aliased Main & Update methods.
#------------------------------------------------------------------------------
# This class performs title screen processing.
# The edits to this class will allow for an intro in a map to start after
# Inactivity of the player for a certain period of time.
#==============================================================================

#This is for the ID of the map in which the intro will begin
INTRO_MAP_ID = 2
#This is for the X tile in which to which the player will be put in the intro
INTRO_MAP_BEGIN_X = 1
#This is for the Y tile in which to which the player will be put in the intro
INTRO_MAP_BEGIN_Y = 1
#Intro Wait time [Increase the number to make it wait more]
INTRO_WAIT = 100
#The intro will start with a black screen
PITCH_BLACK = true

class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias tds_intro_main main
def main
# Variable used for waiting
@wait = 0
# This will lock the transition from title to intro
@changing_to_intro = false
tds_intro_main
end
#--------------------------------------------------------------------------
# * Frame Update [Wait added]
#--------------------------------------------------------------------------
alias update_tds_intro update
def update
update_tds_intro
if @wait < INTRO_WAIT
@wait += 1
end

if @wait == INTRO_WAIT
@changing_to_intro = true
@command_window.contents_opacity -= 5
@command_window.opacity -= 5
@command_window.active = false
@sprite.opacity -= 5
if @command_window.contents_opacity == 0 && @sprite.opacity == 0
@command_window.contents_opacity = 0
@command_window.opacity = 0
intro_sequence
end
end

#If any key is pressed the time counter goes back to 0
if @changing_to_intro == false
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or
Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT) or
Input.trigger?(Input::A) or Input.trigger?(Input::B) or
Input.trigger?(Input::C) or Input.trigger?(Input::X) or
Input.trigger?(Input::Y) or Input.trigger?(Input::Z) or
Input.trigger?(Input::L) or Input.trigger?(Input::R)
Input.trigger?(Input::ALT) or Input.trigger?(Input::CTRL) or
Input.trigger?(Input::SHIFT)
@wait = 0
end
end
end
#--------------------------------------------------------------------------
# * Command: Intro_sequence
#--------------------------------------------------------------------------
def intro_sequence
Audio.bgm_fade(800)
$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
# Move to intro map
$game_map.setup(INTRO_MAP_ID)
# Move player to initial position
$game_player.moveto(INTRO_MAP_BEGIN_X, INTRO_MAP_BEGIN_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
if PITCH_BLACK == true
$game_screen.start_tone_change(Tone.new(-255, -255, -255, 0), 0)
end
# Switch to map screen
$scene = Scene_Map.new
end
end


Extra

This is an extra script for people who want to make the intro maps go back to the title as soon as a key is pressed.

Instructions

Just go to line 13 and add the ID number of the maps

Example:
Code:
if [1,5,78,123,4,].include?($game_map.map_id)

Code:
#==============================================================================
# TDS Intro Skip
#==============================================================================
#------------------------------------------------------------------------------
# This causes the intro map to go back to scene title when keys are pressed
#==============================================================================
class Scene_Map
alias tds_intro_map_update update
def update
tds_intro_map_update

#Maps that are part of the intro, keep adding ID for all maps [1,2,3,4]
if [2].include?($game_map.map_id)
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or
Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT) or
Input.trigger?(Input::A) or Input.trigger?(Input::B) or
Input.trigger?(Input::C) or Input.trigger?(Input::X) or
Input.trigger?(Input::Y) or Input.trigger?(Input::Z) or
Input.trigger?(Input::L) or Input.trigger?(Input::R)
Input.trigger?(Input::ALT) or Input.trigger?(Input::CTRL) or
Input.trigger?(Input::SHIFT)
$scene = Scene_Title.new
end
end
end
end


Compatibility

Should be compatible with almost everything.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Auto Command Racheal of Dragonfly 0 2,543 02-22-2007, 01:00 PM
Last Post: Racheal of Dragonfly



Users browsing this thread: 1 Guest(s)