Modification to Milena's Script

Script Link: https://forums.rpgmakerweb.com/inde...menu-after-condition-is-met.37648/post-629320

Hi. Is there a way to keep the Bonus Stage option active even upon quitting? The script seems to reset whenever I quit entirely from the game, despite having the game saved right after I activate the script call. It works just fine when I go back to the Title Screen without quitting, but I want the option to remain active nonetheless.

I am unsure whether I am doing something wrong, but to (probably) fix this I thought of adding a command that checks every save file, and/or the most recent one, in order to maintain the option accessible at any given time, as long as the script call has been activated somewhere, at some point. There is a script called Dynamic Title (by Racheal) which does just that. However, it uses variables instead of script calls. Here's the link if you want to take a look at Racheal's script: https://forums.rpgmakerweb.com/index.php?threads/dynamic-title.14549/

Does anyone know how to create such command for Melina's script? I don't know much about Ruby, so this would be of huge help!

And excuse my mistakes, if any. I am a pretty new user to the forums, as you can probably tell.
Now I see what you want. and here.
Spoiler: New Game Bonus Stage
Ruby:
# bonus stage

module DataManager  
  MAP_ID_FOR_BONUS_STAGE = 2 # bonus stage map start
  MAP_X = 10 # x coords of the bonus stage map you will be transferred in.
  MAP_Y = 10 # y coords of the bonus stage map you will be transferred in.  
 
  class << self  
  alias milena_create_game_objects create_game_objects  
  #--------------------------------------------------------------------------  
  # * Create Game Objects  
  #--------------------------------------------------------------------------  
  def create_game_objects    
    milena_create_game_objects    
    $game_plus        = Game_NewGamePlus.new  
  end  
  #--------------------------------------------------------------------------  
  # * Make Save Header
  #--------------------------------------------------------------------------  
  alias new_game_plus_make_save_header make_save_header; end
  def self.make_save_header
    header = new_game_plus_make_save_header
    header[:game_plus] = $game_plus.create_new_game
    header
  end
  #--------------------------------------------------------------------------
  # * Set Up New Game
  #--------------------------------------------------------------------------
  def self.setup_new_game_plus  
    create_game_objects  
    $game_party.setup_starting_members  
    $game_map.setup(MAP_ID_FOR_BONUS_STAGE)  
    $game_player.moveto(MAP_X, MAP_Y)  
    $game_player.refresh  
    Graphics.frame_count = 0
  end  
end
 
class Game_Interpreter
    def new_game_plus_on
        $game_plus.create_new_game = true
    end
end

class Game_NewGamePlus
  attr_accessor :create_new_game
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize  
    @create_new_game = false
  end
end
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("Bonus Stage", :new_game_plus, new_game_plus_enabled)  
    add_command(Vocab::shutdown, :shutdown)
  end  
  def new_game_plus_enabled
        for i in 0...DataManager.savefile_max
            header = DataManager.load_header(i)
            next unless header and header[:game_plus]
            return header[:game_plus]
        end
        return false
    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))  
    @command_window.set_handler(:shutdown, method(:command_shutdown))
  end  
 
  def command_plus  
    DataManager.setup_new_game_plus  
    close_command_window  
    fadeout_all  
    $game_map.autoplay  
    SceneManager.goto(Scene_Map)
  end
 
end
It works just how I wanted! Thank you so much! : D

(I apologise for my late reply! I must have missed the notification. I am unsure whether this will be marked as necroposting.)
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("Bonus Stage", :new_game_plus, new_game_plus_enabled)
    add_command(Vocab::shutdown, :shutdown)
  end
  def new_game_plus_enabled
    game_plus = false
    for i in 0...DataManager.savefile_max
      header = DataManager.load_header(i)
      next unless header and header[:game_plus]
      game_plus = header[:game_plus] # <==== Right here!
    end
    return game_plus
  end
end

I'd say the following would be a good way to avoid any duplicity.

Ruby:
  def new_game_plus_enabled
    for i in 0...DataManager.savefile_max
      header = DataManager.load_header(i)
      next unless header and header[:game_plus]
      return header[:game_plus] # <==== Stop it right here!
    end
    return false
  end

Unless @Roninator2 has a good reason to keep iterating through the headers. Is it possible to find a header[:game_plus] that isn't true there?
to keep iterating through the headers.
I was confused for a minute, but you're right, I didn't think about it continuously scanning, because if the next save file has the new game plus set to false then this would break the function.
Thanks for noticing.
I'd say the following would be a good way to avoid any duplicity.

Ruby:
  def new_game_plus_enabled
    for i in 0...DataManager.savefile_max
      header = DataManager.load_header(i)
      next unless header and header[:game_plus]
      return header[:game_plus] # <==== Stop it right here!
    end
    return false
  end
Thanks for the fix!

Original thread: https://forums.rpgmakerweb.com/threads/modification-to-milenas-script.149267/