How to add bonus content to menu after condition is met?

Nice job with this, Milena.

I'm curious about the approach you took, because I use a much different approach in my own game where I store a global text file for this kind of thing because when I tried to simply create a new object like $new_game_plus, I found that it did not persist after closing the application and restarting (unless I programmed a loop to check every saved file, which did actually work, but was relatively clumsy).

Does your approach allow the option to be available on the menu screen even after you start a new game (and then return to the menu) or close and re-open the program?
My script is clumsy there, the developer has to let the player return to the title screen after activating the object then there they can access the bonus stage. My knowledge is limited to how it would be possible to close the program, re-open and still there's a bonus stage available.
The easiest approach would be, indeed, using an external file for storing the new game plus data and reading that instead of some internal data.


But that file should also be encrypted somehow, because if not, enabling the new game plus option would be as easy as adding/changing one single line in that external text file.


Yanfly's New Game+ script can somehow store some values which persist through different play-through of the game. And if I remember right, it adds a new option to the title screen as well.


Perhaps that script can be used as a guide to see how he did it.
Ok so after play testing it the script works beautifully 🙂
Glad that it does ^^
Glad that it does ^^



Pardon me Milena , I still am little clumsy with scripting but , when I copy your script and past it in the script  editor , it all is in one single line instead of being shaped like a usual script . Am I doing something wrong ?
I think it has something to do with the failed formatting of this forum. Please try this:

Code:
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      
  
  #--------------------------------------------------------------------------  
  # * 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  
 
end# this is referenced by $game_plus

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   
    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))    
    @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
Hi, sorry for being late, I used your script but it gives error: “line 69: NoMethodError occurred. Undefined method ‘setup_new_game_plus’ for DataManager:Module”
Am I doing something wrong? Please help 😢
185965691_4023486847715997_6363508274890079087_n.jpg

I think it has something to do with the failed formatting of this forum. Please try this:

Code:
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     
 
  #-------------------------------------------------------------------------- 
  # * 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 

end# this is referenced by $game_plus

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  
    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))   
    @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 gives error
line 19 says def self.setup_new_game_plus
but it should be def setup_new_game_plus
line 19 says def self.setup_new_game_plus
but it should be def setup_new_game_plus
It's working, thank you very much 😂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-bonus-content-to-menu-after-condition-is-met.37648/