Add Variables to Save Display

Discussion in 'RGSS3 Script Requests' started by wrigty12, Dec 14, 2014.

  1. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    I want to keep the simple save-file layout that is default, but I want to display a couple variables on the save file as well (Such as an Episode number or "secondary currency" value).

    Is there a script to add these, or a way to add them to the default setup?

    (I looked at Yanfly's Save engine, but it had too much I don't need and didn't work properly for my needs.)

    Thanks!
     
    #1
  2. Another Fen

    Another Fen Veteran Veteran

    Messages:
    500
    Likes Received:
    221
    First Language:
    German
    The default display works by loading the data from the savefiles header without changing the global game variables.

    You could try extending DataManager.make_save_header to add the values you want and load the header within your method:
     

    Code:
    class << DataManager    alias_method(:make_save_header_addChapterVariable, :make_save_header)  def make_save_header    header = make_save_header_addChapterVariable    header[:chapter] = $game_variables[14]    header  endendclass Window_Savefile    # ...    #--------------------------------------------------------------------------  # * Draw Whatever  #--------------------------------------------------------------------------  def draw_xyz    header = DataManager.load_header(@file_index)    return unless header    # Code for drawing stuff goes here, referring to header  endend
     
    Last edited by a moderator: Dec 14, 2014
    #2
    boyflea likes this.
  3. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    Hmm. Alright.

    Is it possible if you (or someone) could quickly write the drawing aspect (I'm a noob at programming)? This is what I want it to look like:

    [​IMG]

    Variable 6 is a String, where Variable 7 and 10 are integers.

    Also, I do not need the Map Name on the Save, so it can be removed.

    Thanks!
     
    Last edited by a moderator: Dec 15, 2014
    #3
  4. Zetu

    Zetu Level 99 Stabomancer Veteran

    Messages:
    247
    Likes Received:
    99
    Location:
    Durham, NC
    First Language:
    English
    Primarily Uses:
    N/A
    Here, I filled it out.

    Code:
    class << DataManager    alias_method(:make_save_header_addChapterVariable, :make_save_header)  def make_save_header    header = make_save_header_addChapterVariable    header[:chapter] = "#{$game_variables[7]}% #{$game_variables[6]}"    header  endendclass Window_SaveFile < Window_Base    alias :wrigty_req_refresh :refresh  def refresh    wrigty_req_refresh    draw_completion  end    def draw_completion    header = DataManager.load_header(@file_index)    return unless header    draw_text(0, 0, contents.width, line_height, header[:chapter], 2)  end  end 
     
    Last edited by a moderator: Dec 15, 2014
    #4
    boyflea, Pink Peach and Bonkers like this.
  5. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    Thank you, a ton! :D
     
    #5

Share This Page