Show Chapter Number in Save Screen?

This seemed like more of a script request than a script issue, so I'm sorry if this is in the wrong place.


I am trying to make my game show you what chapter you are on in the save screen. Nothing fancy, I just need to have the save files show which chapter you are on. I have a chapter variable, and I think I made the proper script call (or whatever it's called) and made the text script, but I'm having a problem with the script retrieving and reading the Chapter variable. I would appreciate the Chapter counter to be at the same spot as the playtime, but at the top rather than the bottom. (Or is the other way around?)


I'd also be thankful is the script were to say "Prologue" if the variable is equal to 0, "Epilogue" if it is equal to a specified number, and just be blank if it's in negatives or greater than the Epilogue variable.


Here's the edited Window_SaveFile code:

Code:
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
#  This window displays save files on the save and load screens.
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :selected                 # selected
  attr_reader   :chapter                  # chapter number
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     index : index of save files
  #--------------------------------------------------------------------------
  def initialize(height, index)
    super(0, index * height, Graphics.width, height)
    @file_index = index
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    change_color(normal_color)
    name = Vocab::File + " #{@file_index + 1}"
    draw_text(4, 0, 200, line_height, name)
    @name_width = text_size(name).width
    draw_party_characters(152, 58)
    draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
    draw_chapter(0, contents.height - line_height, contents.width - 4, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Party Characters
  #--------------------------------------------------------------------------
  def draw_party_characters(x, y)
    header = DataManager.load_header(@file_index)
    return unless header
    header[:characters].each_with_index do |data, i|
      draw_character(data[0], data[1], x + i * 48, y)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Play Time
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    header = DataManager.load_header(@file_index)
    return unless header
    draw_text(x, y, width, line_height, header[:playtime_s], 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Chapter
  #--------------------------------------------------------------------------
  def draw_chapter(x, y, width, align)
    header = DataManager.extract_save_contents($game_variables)
    return unless header
    draw_text(x, y, width, line_height, header[:variables], 2)
  end
  #--------------------------------------------------------------------------
  # * Set Selected
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
    update_cursor
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @selected
      cursor_rect.set(0, 0, @name_width + 8, line_height)
    else
      cursor_rect.empty
    end
  end
end

Sorry if this sounds too demanding, or if it's in the wrong spot, or if I'm breaking some other community guideline!

NOTE: Since the new update made everyone so busy, I'm gonna see if editing this will re-add it back into the thread list, because I'm too afraid to try posting this again or looking for a "delete thread" button.
Since the update, I'm gonna see if commenting will help give this thread attention again...
Sorry if this breaks any rules!
You're fine as long as it has been > 72 hours since your last post. Which you were, so no worries there!

As for what you are requesting, I did this very easily with Yanfly's Save Engine, naming one of the variables Chapter, and then setting it so that it shows the variable in the 6 variables it displays when you save your game. Not sure how you would do non numerical Chapters though (like Prologue), I just called my prologue Chapter 0 myself.
Nevermind, this is for MV *cries sadly*

Here is a plug in that does exactly what you want 🙂
http://himeworks.com/2015/12/save-title/.
I just installed the script, and it works perfectly for me. Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/show-chapter-number-in-save-screen.74371/