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.

Skipping Title BUT THEN...

In a rush here, guys...
I need to skip the title menu for my game. I got a quick script I found on this website. Everything works fine except the 'Return to Title' command. Could someone help me out?

So after my credits, I need to use the 'Return to Title' Command (I skipped the menu at the start due to credits).
heres my 'Quick Code' that isnt working:

Code:
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    if $BTEST                         # If battle test
      battle_test                     # Start battle test
    else                              # If normal play
      super                           # Usual main processing
    end
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    load_database                     # Load database
    create_game_objects               # Create game objects
    command_new_game                  # Create command window
  end
  #--------------------------------------------------------------------------
  # * Load Database
  #--------------------------------------------------------------------------
  def load_database
    $data_actors        = load_data("Data/Actors.rvdata")
    $data_classes       = load_data("Data/Classes.rvdata")
    $data_skills        = load_data("Data/Skills.rvdata")
    $data_items         = load_data("Data/Items.rvdata")
    $data_weapons       = load_data("Data/Weapons.rvdata")
    $data_armors        = load_data("Data/Armors.rvdata")
    $data_enemies       = load_data("Data/Enemies.rvdata")
    $data_troops        = load_data("Data/Troops.rvdata")
    $data_states        = load_data("Data/States.rvdata")
    $data_animations    = load_data("Data/Animations.rvdata")
    $data_common_events = load_data("Data/CommonEvents.rvdata")
    $data_system        = load_data("Data/System.rvdata")
    $data_areas         = load_data("Data/Areas.rvdata")
  end
  #--------------------------------------------------------------------------
  # * Load Battle Test Database
  #--------------------------------------------------------------------------
  def load_bt_database
    $data_actors        = load_data("Data/BT_Actors.rvdata")
    $data_classes       = load_data("Data/BT_Classes.rvdata")
    $data_skills        = load_data("Data/BT_Skills.rvdata")
    $data_items         = load_data("Data/BT_Items.rvdata")
    $data_weapons       = load_data("Data/BT_Weapons.rvdata")
    $data_armors        = load_data("Data/BT_Armors.rvdata")
    $data_enemies       = load_data("Data/BT_Enemies.rvdata")
    $data_troops        = load_data("Data/BT_Troops.rvdata")
    $data_states        = load_data("Data/BT_States.rvdata")
    $data_animations    = load_data("Data/BT_Animations.rvdata")
    $data_common_events = load_data("Data/BT_CommonEvents.rvdata")
    $data_system        = load_data("Data/BT_System.rvdata")
  end
  #--------------------------------------------------------------------------
  # * Create Game Objects
  #--------------------------------------------------------------------------
  def create_game_objects
    $game_temp          = Game_Temp.new
    $game_message       = Game_Message.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.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
  end
  #--------------------------------------------------------------------------
  # * Check Player Start Location Existence
  #--------------------------------------------------------------------------
  def confirm_player_location
    if $data_system.start_map_id == 0
      print "Player start location not set."
      exit
    end
  end
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  def command_new_game
    confirm_player_location
    $game_party.setup_starting_members            # Initial party
    $game_map.setup($data_system.start_map_id)    # Initial map position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    Graphics.frame_count = 0
    RPG::BGM.stop
    $game_map.autoplay
  end
  #--------------------------------------------------------------------------
  # * Battle Test
  #--------------------------------------------------------------------------
  def battle_test
    load_bt_database                  # Load battle test database
    create_game_objects               # Create game objects
    Graphics.frame_count = 0          # Initialize play time
    $game_party.setup_battle_test_members
    $game_troop.setup($data_system.test_troop_id)
    $game_troop.can_escape = true
    $game_system.battle_bgm.play
    snapshot_for_background
    $scene = Scene_Battle.new
  end
end

Could someone help me out? Thanks...

~AdamationStudios
 

khmp

Sponsor

Did you just replace your whole Scene_Title with the one you have there?  :cry:

Anyway restore your Scene_Title back to its original code. Steal it from an untouched project if necessary just get it back to the default. Afterwards just below that Material's section insert a new section. Copy and paste the code nearest the bottom of this post. Initially at startup Scene_Title, will as you wanted, be skipped. Some time in the game to disable Scene_Title from being skipped using the following piece of code in the Event Command "Script...":
Code:
Scene_Title.skip_title = false

The whole dealie-o:
Code:
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Class Variables
  #--------------------------------------------------------------------------
  @@skip_title = true
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias adst_skiptitle_update update
  alias adst_skiptitle_create_command_window create_command_window
  alias adst_skiptitle_close_command_window close_command_window
  alias adst_skiptitle_open_command_window open_command_window
  alias adst_skiptitle_dispose_command_window dispose_command_window
  alias adst_skiptitle_terminate terminate
  #--------------------------------------------------------------------------
  # * Start processing                                             !OVERRIDE!
  #--------------------------------------------------------------------------
  def start
    super
    load_database                     # Load database
    create_game_objects               # Create game objects
    
    # If the $game_switch to not skip the title is turned off start the game.
    # Otherwise continue with the usual work.
    (command_new_game; return) if @@skip_title

    check_continue                    # Determine if continue is enabled
    create_title_graphic              # Create title graphic
    create_command_window             # Create command window
    play_title_music                  # Play title screen music
  end
  #--------------------------------------------------------------------------
  # * Frame Update                                                    !ALIAS!
  #--------------------------------------------------------------------------
  def update
    return if @@skip_title
    adst_skiptitle_update
  end
  #--------------------------------------------------------------------------
  # * Create Command Window                                           !ALIAS!
  #--------------------------------------------------------------------------
  def create_command_window
    return if @@skip_title
    adst_skiptitle_create_command_window
  end
  #--------------------------------------------------------------------------
  # * Dispose of Command Window                                       !ALIAS!
  #--------------------------------------------------------------------------
  def dispose_command_window
    return if @@skip_title
    adst_skiptitle_dispose_command_window
  end
  #--------------------------------------------------------------------------
  # * Open Command Window                                             !ALIAS!
  #--------------------------------------------------------------------------
  def open_command_window
    return if @@skip_title
    adst_skiptitle_open_command_window
  end
  #--------------------------------------------------------------------------
  # * Close Command Window                                            !ALIAS!
  #--------------------------------------------------------------------------
  def close_command_window
    return if !$dont_skip_title
    adst_skiptitle_close_command_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing                                          !ALIAS!
  #--------------------------------------------------------------------------
  def terminate
    return if @@skip_title
    adst_skiptitle_terminate
  end
  #--------------------------------------------------------------------------
  # * Command: New Game                                            !OVERRIDE!
  #--------------------------------------------------------------------------
  def command_new_game
    confirm_player_location
    Sound.play_decision if !@@skip_title
    $game_party.setup_starting_members            # Initial party
    $game_map.setup($data_system.start_map_id)    # Initial map position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    close_command_window
    Graphics.fadeout(60)
    Graphics.wait(40)
    Graphics.frame_count = 0
    RPG::BGM.stop
    $game_map.autoplay
  end
  #--------------------------------------------------------------------------
  # * Set Skip Title
  #     skip  : skip title or not?(true/false)
  #--------------------------------------------------------------------------
  def self.skip_title=(skip)
    @@skip_title = skip
  end
  #--------------------------------------------------------------------------
  # * Get Skip Title
  #--------------------------------------------------------------------------
  def self.skip_title
    return @@skip_title
  end
end

If you have any questions or troubles let me know.
 

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