The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: cjk on May 08, 2007, 09:33:31 PM

Title: [RESOLVED] Beginning Titles
Post by: cjk on May 08, 2007, 09:33:31 PM
I'm not sure if this is an event or not, but how do you make titles at the beginning of the game before the title that has 'New Game'  ' Continue' and 'Quit'?
Title: Re: Beginning Titles
Post by: Kokowam on May 08, 2007, 09:35:56 PM
You just draw it XP And then import it into "Titles" in the Import Manager and then go to Database -> System -> Title Screen (or something like that) and then choose your screen.
Title: Re: Beginning Titles
Post by: Lackluster on May 08, 2007, 09:40:03 PM
I think he means before that screen shows up...in which case try this:

#==============================================================================
# ** Introduction & Splash System
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 3.1
# 2006-10-17
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 -------------------------------------------- (Aprrox. 2005-01-01)
#   Version 2 ---------------------------------------------------- (2005-01-08)
#    - Update : Re-scripted Much of the System
#   Version 3 ---------------------------------------------------- (2006-08-04)
#    - Update : Re-scripted Much of the System
#    Version 3.01 ------------------------------------------------ (2006-10-17)
#     - Bug Fix : Made Introduction Scene Child Class of Scene Base
#------------------------------------------------------------------------------
# * Requirements :
#
#   Scene_Base
#------------------------------------------------------------------------------
# * Description :
#
#   This Script was designed to create an introduction before the title screen
#   in your game. You will also have the option to display a splash screen,
#   where an image will flash (Usually Press Start). It also adds a timer at
#   both the splash screen and in the title screen, so after X seconds, it
#   will replay the introduction and splash. The splash is completely
#   optional. It will not be displayed from the editor (Debug Mode).
#
#   * Changes In 1.1 - Added Dependency On Scene_Base. Now Scene_Introduction
#   is a child class of Scene_Base (This Means Nothing to Non-Scripters).
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To Setup Introduction, refer to customization below.
#------------------------------------------------------------------------------
# * Customization :
#
#   Setting Up Introduction Pictures
#    - Intro_Pictures = ['Pic 1', ...]
#
#   Setting Up Splash Pictures
#    - Splash = 'filename' or nil
#
#   (Pictures Should Be in the Titles Folder)
#
#   Picture Fade In Speed
#    - Picture_Fade_Speed = X
#
#   Splash Button Speed
#    - Start_Fade_Speed = X
#
#   Seconds Until Introduction Leaves Splash & Title
#    - Seconds_Until_Restart = X
#
#   Intorudction BGM
#    - Introduction_BGM = RPG::AudioFile
#
#   Restart Introduction At Splash Flag
#    - Restart_At_Splash = true (RESTART) or false (DON'T RESTART)
#
#   Restart Introduction At Title Flag
#    - Restart_At_Title = true (RESTART) or false (DON'T RESTART)
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Introduction & Splash System', 'SephirothSpawn', 3.1, '2006-10-17')

#------------------------------------------------------------------------------
# * Scene Base Test
#------------------------------------------------------------------------------
unless SDK.state('Scene Base')
  # Print Error
  p 'Scene Base Not Found. Introduction & Splash System Disabled.'
  # Disable Encounter Control
  SDK.disable('Introduction & Splash System')
end

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Introduction & Splash System')

#==============================================================================
# ** Scene_Introduction
#==============================================================================

class Scene_Introduction < Scene_Base
  #--------------------------------------------------------------------------
  # * Options
  #--------------------------------------------------------------------------
  Intro_Pictures = ['Logo1', 'Logo2']
  Splash = nil
  Picture_Fade_Speed = 5
  Start_Fade_Speed = 5
  Seconds_Until_Restart = 34
  Introduction_BGM = load_data('Data/System.rxdata').title_bgm
  Restart_At_Splash = false
  Restart_At_Title = false
  #--------------------------------------------------------------------------
  # * Main Processing : Variable Initialization
  #--------------------------------------------------------------------------
  def main_variable
    # Instance Variables     
    @index, @phase = 0, 0
    @speed, @s_speed = Picture_Fade_Speed, Start_Fade_Speed
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Sprite Initialization
  #--------------------------------------------------------------------------
  def main_sprite
    # Background Images
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title(Intro_Pictures[@index])
    @sprite.opacity = 5
    # Start Logo
    unless Splash.nil?
      @start = Sprite.new
      @start.bitmap = RPG::Cache.title('Start')
      @start.x = 320 - @start.bitmap.width / 2 #320
      @start.y = 480 - @start.bitmap.height - 32 #480
      @start.z, @start.opacity = 10, 0
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Audio Initialization
  #--------------------------------------------------------------------------
  def main_audio
    # Play Introduction BGM
    Audio.bgm_play('Audio/BGM/' + Introduction_BGM.name)
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Ending
  #--------------------------------------------------------------------------
  def main_end
    # Fade BGM
    Audio.bgm_fade(5)
    # If Premain
    $pre_main ? $pre_main = false : $scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    case @phase
    when 0 # Introduction Procreesing
      update_intro
    when 1 # Splash Procreesing
      update_splash
    when 2 # Splash Transition
      to_splash_transition
    when 3 # Title Transition
      to_title_transition
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Intro Images
  #--------------------------------------------------------------------------
  def update_intro
    # If C is pressed
    if Input.trigger?(Input::C)
      @speed *= -1 if @speed > 0
      @phase = Splash.nil? ? 3 : 2
    end
    # Updates Sprite Opacity
    @sprite.opacity += @speed
    # Changes Direction
    @speed *= -1 if @sprite.opacity >= 255
    # Change Sprite
    if @sprite.opacity <= 0
      @index += 1 ; @speed *= -1
      @index == Intro_Pictures.size ? @phase = Splash.nil? ? 3 : 2 :
        @sprite.bitmap = RPG::Cache.title(Intro_Pictures[@index])
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Splash Image
  #--------------------------------------------------------------------------
  def update_splash
    # If Restart on splash and seconds reached
    if Restart_At_Splash && Graphics.frame_count %
      (Graphics.frame_rate * Seconds_Until_Restart) == 0
      # Restart Scene
      $scene = self.new(Intro_Pictures, Splash)
      return
    end
    # If C is pressed
    if Input.trigger?(Input::C)
      @speed *= -1 if @speed > 0
      @s_speed *= -1 if @s_speed > 0
      @phase = 3
    end
    # Loads Sprite Splash Bitmap
    @sprite.bitmap = RPG::Cache.title(Splash)
    # Updates Start Logo Opacity
    @start.opacity += @s_speed
    # Changes Direction
    @s_speed *= -1 if @start.opacity >= 255 || @start.opacity <= 0
    # Updates Splash
    @sprite.opacity += @speed if @sprite.opacity < 255
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Intro To Splash Transistion
  #--------------------------------------------------------------------------
  def to_splash_transition
    @sprite.opacity > 0 ? @sprite.opacity += @speed : @phase = 1
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Splash To Title Transistion
  #--------------------------------------------------------------------------
  def to_title_transition
    # Decrease Splash Opacity
    @sprite.opacity += @speed if @sprite.opacity > 0
    # Decresh Start Logo Opacity
    unless @start.nil?
      @start.opacity += @s_speed if @start.opacity > 0
    end
    # Proceed to Title Screen
    return if @sprite.opacity > 0
    unless @start.nil?
      return if @start.opacity > 0
    end
    # End Introduction
    $scene = nil
    # Restart Graphics Frame Count
    Graphics.frame_count = 0
  end
end

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_intro_scnttl_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If Not Debug
    unless $DEBUG
      # If Restart && Seconds Reached
      if Scene_Introduction::Restart_At_Splash && Graphics.frame_count %
        (Graphics.frame_rate * Scene_Introduction::Seconds_Until_Restart) == 0
        # Switch to Splash Scene
        $scene = Scene_Introduction.new
      end
    end
    # Original Update
    seph_intro_scnttl_update
  end
end

#==============================================================================
# ** Pre-Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

unless $DEBUG
  begin
    # Sets Pre-main flag
    $pre_main = true
    # Prepare for transition
    Graphics.freeze
    # Proceed to Introduction & Splash Scene
    $scene = Scene_Introduction.new
    # Call main method as long as $scene is effective
    while $scene != nil
      $scene.main
    end
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end


Place it below the SDK and above Main. Be sure to credit SephirothSpawn.
Title: Re: Beginning Titles
Post by: Irock on May 08, 2007, 09:41:19 PM
Yeah, next time please use the search button.
Title: Re: Beginning Titles
Post by: modern algebra on May 08, 2007, 09:42:53 PM
I think he is talking about a cutscene before that screen pops up, but I'm not sure. Please clarify request. If all you want is a different picture, do what Moo says. If you want what lackluster says, do what he said. If you want a cutscene, http://rmrk.net/index.php/topic,8605.0.html (http://rmrk.net/index.php/topic,8605.0.html)

@Irock: The script lackluster posted is not on  this site, so if that's what he wants, it wouldn't help him very much to use the search button
Title: Re: Beginning Titles
Post by: cjk on May 08, 2007, 09:43:59 PM
yea before the screen comes up
Title: Re: Beginning Titles
Post by: modern algebra on May 08, 2007, 09:45:09 PM
By clarify, I meant what do you want to happen before the screen comes up?
Title: Re: Beginning Titles
Post by: Irock on May 08, 2007, 09:46:08 PM
Oh, whoops. I thought it was the same script.

I think he just wants something to happen before the screen, which can be done with what you posted.
Title: Re: Beginning Titles
Post by: Kokowam on May 08, 2007, 09:46:32 PM
Quote from: cjk on May 08, 2007, 09:43:59 PM
yea before the screen comes up

That still doesn't explain whether you want a cutscene or a picture. XD Anyways, you should have the answer to add [RESOLVED] to the title of this thread by editing the first post.

EDIT: LOL YOU BEAT ME XD But he should still have the answer.
Title: Re: Beginning Titles
Post by: Lackluster on May 08, 2007, 09:47:46 PM
I think he meant what I posted..he said titles...not cutscene or movie or something...
Title: Re: [RESOLVED]Beginning Titles
Post by: Irock on May 08, 2007, 09:49:04 PM
But, it can be done with both scripts.
Title: Re: [RESOLVED]Beginning Titles
Post by: Lackluster on May 08, 2007, 09:50:24 PM
My way is easier though -_-
Title: Re: [RESOLVED]Beginning Titles
Post by: modern algebra on May 08, 2007, 09:50:42 PM
lack's is different. Edeon X's sends you to a map and plays an event-based cutscene. I think Seph's does a picture-based cutscene. At least, I think that's what it does.
Title: Re: [RESOLVED]Beginning Titles
Post by: Kokowam on May 08, 2007, 10:46:01 PM
I think you're right modern. Also, there's a weird thing between the usual SDK dependency things so I'm not sure if you can take it off... I'm not going to test >_> This was resolved so w/e.