Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Advanced Title Screen

Advanced Title Screen
by Dargor
Version 1.8


Introduction

This script let you use a map as the title screen. Additionally, you can choose to run an introduction scene before the title screen.

Features
  • Display a map as the title screen
  • The map's spriteset is animated and events are executed
  • Use the map's BGM as the title BGM
  • Support for introductions before the title screen
  • Support for random introductions
  • Support for random title screen maps
  • Skip introduction

Screenshots
http://img138.imageshack.us/img138/3900/vxatitleid1.th.png[/img]

Demo
Thanks to matmicash for his demo: http://www.mediafire.com/?jadmg3emh3q

Script

Code:
#==============================================================================

# ** Advanced Title Screen

#------------------------------------------------------------------------------

#  © Dargor, 2008

#  02/06/08

#  Version 1.8

#------------------------------------------------------------------------------

#  VERSION HISTORY:

#   - 1.0 (26/05/08), Initial release

#   - 1.1 (26/05/08), Support added for Introductions

#   - 1.2 (29/05/08), Map background added in the loading screen

#   - 1.3 (01/06/08), Fixed screen tone delay in the title screen

#   - 1.4 (01/06/08), Added an Instant Title Screen Variable

#   - 1.5 (02/06/08), Audio Bug fixed between Intro and Title

#   - 1.6 (02/06/08), Bug fixed with Instant Title Screen

#   - 1.7 (02/06/08), Added support for random title screen maps

#   - 1.8 (02/06/08), Added support for random introductions

#------------------------------------------------------------------------------

#  INSTRUCTIONS:

#   - Paste this above main

#   - Edit the constants in Title_Screen module

#==============================================================================

 

#==============================================================================

# ** Title Screen Customization Module

#==============================================================================

module Title_Screen

  # ID of the title screen map

  Map = 1

  # Is the title screen map randomized?

  Map_Randomized = true

  # Random ID of the title screen map

  Random_Maps = [1,2,3]

  # Play the map BGM instead of the title screen BGM

  Map_BGM = true

  # Instant Title Screen (if true, disable the fade to black)

  # Works ONLY in Introduction mode

  Instant_Title_Screen = true

  # Introduction flag

  Intro = true

  # Is the introduction randomized?

  Intro_Randomized = true

  # Introduction map ID

  Intro_Map = 2

  # Random Introduction map ID

  Random_Intro_Maps = [1,2,3]

  # Introduction map player location (x,y)

  Intro_Coords = [10,10]

  # Introduction map player location (x,y)

  # For Random intro only.

  Random_Intro_Coords = [

                         [10,10],

                         [5,5],

                         [0,0]

                        ]

end

 

#==============================================================================

# ** Scene_Map

#------------------------------------------------------------------------------

#  This class performs the map screen processing.

#==============================================================================

 

class Scene_Map < Scene_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_advanced_title_map_update update

  alias dargor_vx_advanced_title_map_call_title call_title

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    if $intro_running && Input.trigger?(Input::B)

      $intro_running = nil

      $intro_completed = true

      $scene = Scene_Title.new

      unless Title_Screen::Instant_Title_Screen

        RPG::BGM.fade(1500)

        Graphics.fadeout(60)

        Graphics.wait(40)

      end

      return

    end

    dargor_vx_advanced_title_map_update

  end

  #--------------------------------------------------------------------------

  # * Switch to Title Screen

  #--------------------------------------------------------------------------

  def call_title

    if $intro_running

      $intro_running = nil

      $intro_completed = true

      dargor_vx_advanced_title_map_call_title

      unless Title_Screen::Instant_Title_Screen

        RPG::BGM.fade(1500)

        Graphics.fadeout(60)

        Graphics.wait(40)

      end

      return

    end

    dargor_vx_advanced_title_map_call_title

  end

end

 

#==============================================================================

# ** Scene_Title

#------------------------------------------------------------------------------

#  This class performs the title screen processing.

#==============================================================================

 

class Scene_Title < Scene_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_advanced_title_start start

  alias dargor_vx_advanced_title_terminate terminate

  alias dargor_vx_advanced_title_update update

  alias dargor_vx_advanced_title_command_new_game command_new_game

  alias dargor_vx_advanced_title_play_title_music play_title_music

  #--------------------------------------------------------------------------

  # * Start processing

  #--------------------------------------------------------------------------

  def start

    $intro_running   = false if $intro_running.nil?

    $intro_completed = false if $intro_completed.nil?

    if Title_Screen::Intro && !$intro_completed

      start_introduction

      return

    end

    dargor_vx_advanced_title_start

    create_map_background             # Create map as background

  end

  #--------------------------------------------------------------------------

  # * Termination Processing

  #--------------------------------------------------------------------------

  def terminate

    dargor_vx_advanced_title_terminate

    @spriteset.dispose

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    dargor_vx_advanced_title_update

    $game_map.interpreter.update      # Update map interpreter

    $game_map.update                  # Update map

    @spriteset.update                 # Update map spriteset

  end

  #--------------------------------------------------------------------------

  # * Create Map Background

  #--------------------------------------------------------------------------

  def create_map_background(temp=false)

    if Title_Screen::Map_Randomized

      id = rand(Title_Screen::Random_Maps.size)

      map_id = Title_Screen::Random_Maps[id]

    else

      map_id = Title_Screen::Map

    end

    $game_map.setup(map_id)

    $game_map.interpreter.update      # Update map interpreter

    $game_map.update                  # Update map

    if temp

      @spriteset = @sprite

      @spriteset.visible = false

    else

      @spriteset = Spriteset_Map.new

    end

    @spriteset.update                 # Update map spriteset

    play_title_music(true)

  end

  #--------------------------------------------------------------------------

  # * Play Title Screen Music

  #--------------------------------------------------------------------------

  def play_title_music(temp = false)

    if Title_Screen::Map_BGM

      $game_map.autoplay if temp

      return

    end

    dargor_vx_advanced_title_play_title_music

  end

  #--------------------------------------------------------------------------

  # * Command: New Game

  #--------------------------------------------------------------------------

  def command_new_game

    # Clear previous map data and create a new one

    $game_map = Game_Map.new

    # the usual

    dargor_vx_advanced_title_command_new_game

  end

  #--------------------------------------------------------------------------

  # * Command: New Game

  #--------------------------------------------------------------------------

  def start_introduction

    load_database                     # Load database

    create_game_objects               # Create game objects

    create_title_graphic              # Create title graphic

    create_command_window             # Create command window

    @command_window.visible = false

    create_map_background(true)       # Create map as background

    # Clear previous map data and create a new one

    $game_map = Game_Map.new

    $intro_running = true

    confirm_player_location

    if Title_Screen::Intro_Randomized

      id = rand(Title_Screen::Random_Intro_Maps.size)

      map_id = Title_Screen::Random_Intro_Maps[id]

      coords = Title_Screen::Random_Intro_Coords[id]

      x = coords[0]

      y = coords[1]

    else

      map_id = Title_Screen::Intro_Map

      x = Title_Screen::Intro_Coords[0]

      y = Title_Screen::Intro_Coords[1]

    end

    $game_party.setup_starting_members            # Initial party

    $game_map.setup(map_id)    # Initial map position

    $game_player.moveto(x, y)

    $game_player.refresh

    $scene = Scene_Map.new

    $game_map.autoplay

  end

end

 

#==============================================================================

# ** Scene_File

#------------------------------------------------------------------------------

#  This class performs the save and load screen processing.

#==============================================================================

 

class Scene_File < Scene_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_advanced_title_file_start start

  alias dargor_vx_advanced_title_file_terminate terminate

  alias dargor_vx_advanced_title_file_update update

  #--------------------------------------------------------------------------

  # * Start processing

  #--------------------------------------------------------------------------

  def start

    dargor_vx_advanced_title_file_start

    unless @saving

      create_map_background

    end

  end

  #--------------------------------------------------------------------------

  # * Create Map Background

  #--------------------------------------------------------------------------

  def create_map_background

    @spriteset = Spriteset_Map.new

  end

  #--------------------------------------------------------------------------

  # * Termination Processing

  #--------------------------------------------------------------------------

  def terminate

    dargor_vx_advanced_title_file_terminate

    unless @saving

      @spriteset.dispose

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    unless @saving

      $game_map.interpreter.update      # Update map interpreter

      $game_map.update                  # Update map

      @spriteset.update

    end

    dargor_vx_advanced_title_file_update

  end

end

Note
Obviously event commands such as Display Message, Battle Processing, etc. does not work in the title screen.
Don't forget to credit me!
 
This is really great. Here is something i did really quickly as an example of what you can do!  :lol:

Download of my Example: http://www.mediafire.com/?jadmg3emh3q <-- It isn't a virus.  :wink:

I couldn't think of a Game Name so i just used 'NAME' in big ice blocks. Lol.

Great job. Keep it up!  :thumb:

~Matt
 
This is really good!  Thanks for posting this! ^^ 

Btw, Is there any way that a screen tone could be added before the title screen map appears? eventing it happens a split second after the map appears.
 
Add this at the very top of "def create_map_background":
Code:
$game_map.screen.start_tone_change(Tone.new(red, green, blue, gray), duration)

After you've done that, your method should look something like this:
Code:
  def create_map_background
    $game_map.screen.start_tone_change(Tone.new(-100, -100, -100, 0), 0)
    $game_map.setup(Title_Screen::Map)
    @spriteset = Spriteset_Map.new
    if Title_Screen::Map_BGM
      $game_map.autoplay
    end
  end

Hope that helps. Good luck! :thumb:

Over and out - Gando
 
Gando, for some reason your method doesn't seem to work for me. I'm not sure what I'm doing wrong but it always shows up at the default tone.

Here's what I've got:
Code:
  def create_map_background(temp=false)
    $game_map.screen.start_tone_change(Tone.new(-150, -150, 100, 0), 0)
    $game_map.setup(Title_Screen::Map)
    if temp
      @spriteset = @sprite
      @spriteset.visible = false
    else
      @spriteset = Spriteset_Map.new
    end
    if Title_Screen::Map_BGM
      $game_map.autoplay
    end
  end
Any ideas?
 
The method you posted should work. Do you have any other scripts in your project?
Try putting the Advanced title screen script in a new project and see if it works.

Over and out - Gando
 
Gando":h2xnqdlz said:
The method you posted should work. Do you have any other scripts in your project?
Try putting the Advanced title screen script in a new project and see if it works.

Over and out - Gando
Yeah, it works in a new project. One of my other scripts must be interfering with it.

Edit: I tried removing Kylock's Time System and trying it and it works. Now I guess I'll just have to figure out how to make it work without actually getting rid of that script entirely.
 
Oh, and sorry about bugging again, but, it would also be more linear if there was a way the "Return to Title Screen" command did not make the screen fade to black before it reaches the "New Game Window". Do you think that's possible :P?

Also, I have another problem. My game is supposed to start with a black screen (a tint screen in paralel processing) but due to this script, it shows little frames of the screen, and after that goes black. Any ideas?

Sorry if I'm like pushing, it's just a great script, and these are just some ideas to make it better!
 
Script updated to version 1.4
The Screen Tone glitch has been fixed and I have added a Instant Title Screen variable to enable/disable the fade before the title screen.
The random title/intro feature is coming soon! :thumb:

Take care!
-Dargor
 
Dargor, it's not working for me =P the Instant_Title_screen is true but it won't work. What should I do? :P

Btw, can't wait for the random intro.  :thumb:
 
I've updated the script to version 1.8
The Instant Title Screen bug with the Return To Title event command has been fixed.
Also, a minor Audio bug has been fixed between introductions and title maps with the same BGM.
Finally, I've added support for random introductions and random title maps.

Enjoy!
-Dargor
 
It's a really really great script man, I love this, I'm all fired up playing with it =P

Still, the bug is not yet fixed =S The introduction map still fades to black before the Title Screen.

This is one of the most usefull VX sripts I've seen so far!  :thumb:
 
With the ESC it does not fade, but it does with the event.

Another thing, with the randomizing, is it possible to have diferent title screens for each introduction? Like...

Randomize: [Tit. Screen 1 + Intro 1 ; Tit. Screen 2 + Intro 2 ; Tit. Screen 3 + Intro 3] etc

EDIT: For some strange reason, it's bugging now, and even though I have the coords for where the player starts, it says I don't!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top