Variable untouched by "New Game"

I'm making a Storage Box that can hold one item thoughout New Games, and a character that has different dialogues depending on the ending you got last game.


I'm looking for a script that would allow me to keep a couple of variables unchanged after starting a new game.


If not a script, a way around it. Like reseting the entire game exept for those couple of varaibles in the same "Save File".


I will credit properly. Thanks.
I'd create one for you but, Yanfly already has an excellent NewGame+ script for Ace that already allows carrying variables over to a new game from a save.


https://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-save-engine/new-game
I'd create one for you but, Yanfly already has an excellent NewGame+ script for Ace that already allows carrying variables over to a new game from a save.


https://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-save-engine/new-game

Thanks for the response. Not quite what I was looking for.


I wan't the player to press "new game" on the menu screen. If maybe I could move the "NG+" to the menu screen, but then there's no switch to turn NG+ ON from the menu screen.
Ah, give me a couple of minutes to write the option for you. I'll edit this in a few minutes with the snip-it.


Finished, see recent reply.
Ah, give me a couple of minutes to write the option for you. I'll edit this in a few minutes with the snip-it.

Thank you very much. 🙂
Ah I do have one question, did you mean Title Screen Menu or the actual In-Game Main Menu?
Ah I do have one question, did you mean Title Screen Menu or the actual In-Game Main Menu?

Oh yes, Title Screen. where the New Game and Continue options are.
Here you go, @MuyHiram!

Spoiler
#==============================================================================
# ** Kazama - Fast NewGame+ Title Option
#    Commissioned for MuyHiram
#    Version 1.0
#------------------------------------------------------------------------------
#  Placement:
#  Place this script under YEA's NewGame+ Script.
#------------------------------------------------------------------------------
#  How to use:
#  In order for this script to function properly you must save the new game
#  plus switch in the CARRY_OVER_SWITCHES array. Failure to do so, will not
#  allow the option to show up on the title screen.
#  If you'd like to change the Command Text, you may do so by changing the
#  NGP_TEXT constant in the original YEA NG+ module.
#------------------------------------------------------------------------------
#  License:
#  Both Non-Commercial & Commercial allowed.
#  Retain the original script header.
#  Simple Credit required.
#==============================================================================


#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
#  This module manages the database and game objects. Almost all of the 
# global variables used by the game are initialized by this module.
#==============================================================================


class << DataManager
  #--------------------------------------------------------------------------
  # * Module Class Variables
  #--------------------------------------------------------------------------
  @@recently_saved_file = 0
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias :kazama_yanfly_ngp_data_manager_init                            :init
  #--------------------------------------------------------------------------
  # * Initialize Module
  #--------------------------------------------------------------------------
  def init
    kazama_yanfly_ngp_data_manager_init
    @@recently_saved_file = 0
  end
  #--------------------------------------------------------------------------
  # * Set Recently Saved File Index
  #--------------------------------------------------------------------------
  def set_recent_saved_file_index=(index)
    @@recently_saved_file = index
  end
  #--------------------------------------------------------------------------
  # * Get Recently Saved File Index
  #--------------------------------------------------------------------------
  def get_recent_saved_file_index
    @@recently_saved_file
  end
end


#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing. 
#==============================================================================


class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias :kazama_yanfly_ngp_menu_on_savefile_ok                😮n_savefile_ok
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def on_savefile_ok
    kazama_yanfly_ngp_menu_on_savefile_ok
    DataManager.set_recently_saved_file_index = @index
  end
end


#==============================================================================
# ** Window_TitleCommand
#------------------------------------------------------------------------------
#  This window is for selecting New Game/Continue on the title screen.
#==============================================================================


class Window_TitleCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  include YEA
  include NEW_GAME_PLUS
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias :kazama_yanfly_ngp_menu_initialize                 :initialize
  alias :kazama_yanfly_ngp_menu_make_command_list          :make_command_list
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
    def initialize
    @header = DataManager.load_header(DataManager.get_recent_saved_file_index)
        kazama_yanfly_ngp_menu_initialize
    end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
    def make_command_list
    add_command(NGP_TEXT, :new_game_plus) if new_game_plus_allowed?
        kazama_yanfly_ngp_menu_make_command_list
    end
  #--------------------------------------------------------------------------
  # * Determine if New Game Plus Is Allowed?
  #--------------------------------------------------------------------------
    def new_game_plus_allowed?
    return false if @header.nil?
        return @header[:switches][YEA::NEW_GAME_PLUS::NGP_SWITCH]
    end
end


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


class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias :kazama_yanfly_ngp_title_create_command_window :create_command_window
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    kazama_yanfly_ngp_title_create_command_window
    @command_window.set_handler🙂new_game_plus, method🙂on_action_ngp))
  end
  #--------------------------------------------------------------------------
  # * On NewGame+
  #--------------------------------------------------------------------------
  def on_action_ngp
    Sound.play_load
    DataManager.setup_new_game_plus(DataManager.get_recent_saved_file_index)
    fadeout_all
    $game_system.on_after_load
    SceneManager.goto(Scene_Map)
  end
end

Thank you, I defintely can work with that. I'll Add you to the credits.

Original thread: https://forums.rpgmakerweb.com/threads/variable-untouched-by-new-game.68902/