Moghunter Animated_Title: add new command error (solved)

I tried adding a new command for one of moghunter's scripts.
I managed to easily add the command,but when I press it it just closes the game,like a second shutdown 🙁
I don't think I edited anything wrong,just in case I'll show what I did

1717327363350.png

I don't see where I can edit or define commands anywhere else tbh idk what else to edit.
I wanted to add the command for the new game+ script i had previously for the default menu.
idk If it could be added to this new menu,if it can't then I'm fine with not using this script as long
as it can do similar to it (teleporting the player to a new chosen map)
1717327693748.png
It's because of this
1717335144128.png


You set the commands to
1717335099468.png


So line 3 is shutdown
but in the title menu line 3 is bonus stage

So when you select the bottom command it goes to line 4, which is shutdown.

You just need to move one of them. either the bonus script commands or the names in MOG title script

The order the add_command is processed is the order of the commands when you select them

You can also take it a step further and modifiy the code so that the new game only shows up when the new_game_plus is true
Ruby:
 def create_commands
     @command_window.visible = false
     @commands_index_old = -1
     @commands = []
     @commands_shake_duration = 0
     index = 0
     limit = 3
     limit += 1 if new_game_plus_enabled
     for com in 0...limit
         sprite = Sprite.new
         case index
            when 0; com_name = "New_Game"
            when 1; com_name = "Continue"
            when 2; com_name = "Shutdown"
            when 3; if new_game_plus_enabled; com_name = "Bonus"; end
         end
         sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
         if sprite.bitmap == nil
            sprite.bitmap = Bitmap.new(200,32)
            sprite.bitmap.font.size = 24
            sprite.bitmap.font.bold = true
            sprite.bitmap.font.italic = true
            sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
         end
         sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
         sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
         sprite.z = 100 + index
         sprite.opacity = 0
         index += 1
         @commands.push(sprite)
     end
     @command_max = index  
 end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end

Ruby:
class Window_TitleCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command(Vocab::shutdown, :shutdown)
    add_command("Bonus Stage", :new_game_plus) if new_game_plus_enabled
  end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end
end
class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:new_game_plus, method(:command_plus)) if new_game_plus_enabled
    @command_window.set_handler(:shutdown, method(:command_shutdown))
  end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end
  def command_plus
    DataManager.setup_new_game_plus
    close_command_window
    fadeout_all
    $game_map.autoplay
    SceneManager.goto(Scene_Map)
  end
end
It's because of this
View attachment 307204

You set the commands to
View attachment 307203

So line 3 is shutdown
but in the title menu line 3 is bonus stage

So when you select the bottom command it goes to line 4, which is shutdown.

You just need to move one of them. either the bonus script commands or the names in MOG title script

The order the add_command is processed is the order of the commands when you select them

You can also take it a step further and modifiy the code so that the new game only shows up when the new_game_plus is true
Ruby:
 def create_commands
     @command_window.visible = false
     @commands_index_old = -1
     @commands = []
     @commands_shake_duration = 0
     index = 0
     limit = 3
     limit += 1 if new_game_plus_enabled
     for com in 0...limit
         sprite = Sprite.new
         case index
            when 0; com_name = "New_Game"
            when 1; com_name = "Continue"
            when 2; com_name = "Shutdown"
            when 3; if new_game_plus_enabled; com_name = "Bonus"; end
         end
         sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
         if sprite.bitmap == nil
            sprite.bitmap = Bitmap.new(200,32)
            sprite.bitmap.font.size = 24
            sprite.bitmap.font.bold = true
            sprite.bitmap.font.italic = true
            sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
         end
         sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
         sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
         sprite.z = 100 + index
         sprite.opacity = 0
         index += 1
         @commands.push(sprite)
     end
     @command_max = index 
 end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end

Ruby:
class Window_TitleCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command(Vocab::shutdown, :shutdown)
    add_command("Bonus Stage", :new_game_plus) if new_game_plus_enabled
  end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end
end
class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:new_game_plus, method(:command_plus)) if new_game_plus_enabled
    @command_window.set_handler(:shutdown, method(:command_shutdown))
  end
  def new_game_plus_enabled
    return true if $game_plus.create_new_game
    return false if $game_plus.create_new_game
  end
  def command_plus
    DataManager.setup_new_game_plus
    close_command_window
    fadeout_all
    $game_map.autoplay
    SceneManager.goto(Scene_Map)
  end
end
tbh I had thought abt moving them,but I didnt want to accidentally mess anything up just in case xD
It works perfectly now thank you!!
This thread is closed due to being reported as solved. If you need it reopened, let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/moghunter-animated_title-add-new-command-error-solved.169203/