Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Change file menu character graphics.

Hello Gods and Goddesses of script!

I know this question has been asked multiple times (trust me, I looked), but It does not appear that it has ever seen real resolution.

I am using Mogmenus, which works great for adding face graphics to everything EXCEPT the file menu. It still draws the character sprites as usual.

I have looked all over the board, but I cannot find a script that replaces the character sprites on the file menu with a series of picture files. It seems that people are only worried about the main menu screen (which Mogmenu already takes care of).

Can anyone point me to, or show how to alter the file menu scripts in order to show custom character graphics?



Thank you in advance!
 
Ok, I must be doing something horribly wrong in my help requests... I've got a terrible track record of replies (not including help from Unka-Josh).

Am I not giving enough information? Am I breaking some cardinal rule of the forum? Is it really an unheard-of, extremely off the wall request?

At least let me know what I need to add to the post, folks :) I do my share of trying to answer others questions when I am able :P

Thank you, thank you, thank you!
 
@Legacy: Lines 51-59 in Window_SaveFile

There is an inherent problem in that the window is only 104 pixels tall, leaving only 72 pixels for the bitmap. The standard faceset is 96x96, so it won't quite fit in those windows. Your options are:

1) let the .blt chop off the top & bottom of the face image
2) resize the facesets
3) create another window or sprite over the top of the file windows to draw the faces in
4) eliminate the help window or one of the savefile windows to acquire more space
 
Thank you both so much for taking interest!

Allow me to clarify a few things by posting screenshots as well as my Mog Menu script just in case it wants to throw out any curve-balls.

Screenshots:

Screenshot_01.png


Screenshot_02.png


As you can see the problem is that I have separate dungeon and worldmap sprites. It would be great to have a face sprite show up instead regardless of where I save.

The menu itself is animated, and the different save files swap out in the exact same spot.

Custom face sprites (of any size) are not a problem, if need be.


Here is the MogMenu code I am using:

Code:
#_______________________________________________________________________________

# MOG Scene File Ayumi V1.2           

#_______________________________________________________________________________

# By Moghunter  

# [url=http://www.atelier-rgss.com]http://www.atelier-rgss.com[/url]

#_______________________________________________________________________________

module MOG

#Transition Time. 

MSVT = 30

#Transition Type. 

MSVTT = "006-Stripe02"

end

$mogscript = {} if $mogscript == nil

$mogscript["menu_ayumi"] = false

###############

# Window_Base #

###############

class Window_Base < Window

def drw_win_file(x,y)

dwf = RPG::Cache.picture("Win_File")

cw = dwf.width 

ch = dwf.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x , y - ch, dwf, src_rect)    

end   

def nada

face = RPG::Cache.picture("")

end  

def draw_heroface3(actor,x,y)

face = RPG::Cache.picture(actor.name + "_fc3") rescue nada

cw = face.width 

ch = face.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x , y - ch, face, src_rect)    

end  

def draw_actor_level6(actor, x, y)

self.contents.font.color = Color.new(80,220,60,255)

self.contents.draw_text(x + 8, y + 1, 10, 43, "Lv")  

self.contents.font.color = Color.new (80,220,60,0)

self.contents.draw_text(x, y, 32, 32, "Lv")

self.contents.font.color = Color.new(80,220,60,255)

self.contents.draw_text(x + 6, y + 1, 24, 43, actor.level.to_s, 2)

self.contents.font.color = Color.new(255,255,255,0)

self.contents.draw_text(x, y, 32, 32, actor.level.to_s, 2)

end

def draw_actor_name6(actor, x, y)

self.contents.font.color = Color.new(0,0,0,255)

self.contents.draw_text(x + 1, y + 1, 100, 32, actor.name,1)  

self.contents.font.color = menu_color

self.contents.draw_text(x, y, 100, 32, actor.name,1)

end

end

############

# Game_Map #

############

class Game_Map

def map_name

@mapinfo = load_data("Data/MapInfos.rxdata") if @mapinfo == nil

return @mapinfo[@map_id].name

end

end

###################

# Window_SaveFile #

###################

class Window_SaveFile < Window_Base

  attr_reader   :filename                

  attr_reader   :selected                

  def initialize(file_index, filename)

    super(0, 64 + file_index * 138, 640, 240)    

    self.contents = Bitmap.new(width - 32, height - 32)  

    self.opacity = 0

    @file_index = file_index

    @filename = "Save#{@file_index + 1}.rxdata"

    @time_stamp = Time.at(0)

    @file_exist = FileTest.exist?(@filename)

    if @file_exist

      file = File.open(@filename, "r")

      @time_stamp = file.mtime

      @characters = Marshal.load(file)

      @frame_count = Marshal.load(file)

      @game_system = Marshal.load(file)

      @game_switches = Marshal.load(file)

      @game_variables = Marshal.load(file)

      @game_self_switches = Marshal.load(file)

      @game_screen = Marshal.load(file)

      @game_actors = Marshal.load(file)

      @game_party = Marshal.load(file)

      @game_troop = Marshal.load(file)

      @game_map = Marshal.load(file)

      @total_sec = @frame_count / Graphics.frame_rate

      file.close 

    end

    @wiref = 0

    refresh

    @selected = false

  end  

  def refresh

    self.contents.clear

    self.contents.font.name = "OCR A Extended" #originally Georgia

    drw_win_file(0,190) #originally (0,190)

    name = ("LOG:" + "#{@file_index + 1}") #was +1

    self.contents.font.color = Color.new(80,220,60,255)

    self.contents.draw_text(135, 46, 600, 96, name) #first number L-R 2nd U-D was 32

    self.contents.font.color = Color.new(255,255,255,0)

    self.contents.draw_text(160, 40, 600, 32, name)    

    @name_width = contents.text_size(name).width

    if @file_exist

      for i in [email=0...@characters.size]0...@characters.size[/email]

        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])

        cw = bitmap.rect.width / 4

        ch = bitmap.rect.height / 4

        src_rect = Rect.new(cw * @wiref + 1 , 0, cw, ch)

        x = 322 - @characters.size + i * 44 - cw / 4 #Degree of actor separation

        self.contents.blt(x - 10, 156 - ch, bitmap, src_rect) #156 is normally 150

        x = 116

        actors = @game_party.actors

        for i in 0...[actors.size, 4].min

        x     = i * 44 #originally 60

        actor = actors[i]        

        self.contents.font.size = 12 #Font size of Level Indicator

        draw_actor_level6(actor, x + 296, 144) #Originally 280, 140

        actor = actors[0]     

        draw_heroface3(actor,160,135)    

        #draw_actor_name6(actor, 160, 155)

        self.contents.font.size = 18 #was 22

        end          

      end      

      hour = @total_sec / 60 / 60

      min = @total_sec / 60 % 60

      sec = @total_sec % 60

      time_string = sprintf("TIME: " + "%02d:%02d:%02d", hour, min, sec)

      self.contents.font.color = Color.new(80,220,60,255)

      self.contents.draw_text(4, 46, 450, 32, time_string, 2)

      self.contents.draw_text(116 , 155, 120 , 32, @game_map.map_name.to_s)

      self.contents.font.color = Color.new(80,220,60,0)

      self.contents.draw_text(116 , 155, 120 , 32, @game_map.map_name.to_s)  

      self.contents.draw_text(4, 40, 450, 32, time_string, 2)   

   end

  end

  def selected=(selected)

    @selected = selected

  end

end

##############

# Scene_File #

##############

class Scene_File

  def initialize(help_text)

    @help_text = help_text

  end

  def main

    @mnback = Plane.new

    @mnback.bitmap = RPG::Cache.picture("MN_BK_FILE")

    @mnback.z = 1

    @mnlay = Sprite.new

    @mnlay.bitmap = RPG::Cache.picture("Lay_File.PNG")

    @mnlay.z = 2

    @help_window = Window_Help.new

    @help_window.set_text(@help_text)

    @help_window.opacity = 0

    @savefile_windows = []

    for i in 0..2

      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))

    end

    @savefile_windows[0]

    @file_index = $game_temp.last_file_index

    @savefile_windows[@file_index].selected = true

    @savefile_windows[0].y = 16    

    @savefile_windows[1].y = 16

    @savefile_windows[2].y = 16    

    @win_move_time = 0

    @win_move = 0

    @win_dire = 0

    @win_opac = 255

    @win1_y = 0

    @win2_y = 0

    @win3_y = 0

    Graphics.transition(MOG::MSVT, "Graphics/Transitions/" + MOG::MSVTT)

    loop do

      Graphics.update

      Input.update

      update

      if $scene != self

        break

      end

    end

    for i in 0..50

    @mnback.oy += 1 #normally 1

    @savefile_windows[0].x += 0 #normally += 10 Causes Win_File to move off    

    @savefile_windows[1].x += 0 #normally -= 10 screen when selected.

    @savefile_windows[2].x += 0 #normally += 10

    for i in @savefile_windows

    i.contents_opacity -= 5

    end  

    Graphics.update  

    end      

    Graphics.freeze

    @help_window.dispose

    @mnback.dispose

    @mnlay.dispose

    for i in @savefile_windows

      i.dispose

    end

  end

  def update

    @mnback.oy += 1 #originally 1 and ox

    @win_opac += 3

    @win_move_time += 1    

    if @win_opac > 254

       @win_opac = 210

    end         

    if @win_move_time > 60

    @win_dire += 0

    @win_move_time = 0    

    end

    if @win_dire > 1

       @win_dire = 0

    end

    if @win_dire == 0

       @win_move += 0

    else   

       @win_move -= 1

    end         

    if @file_index == 0

    @savefile_windows[0].z = 2  

    @savefile_windows[1].z = 1 

    @savefile_windows[2].z = 0   

    @savefile_windows[0].x = @win_move

    @savefile_windows[1].x = 0

    @savefile_windows[2].x = 0    

    @savefile_windows[0].contents_opacity = @win_opac

    @savefile_windows[1].contents_opacity = 0

    @savefile_windows[2].contents_opacity = 0

    elsif @file_index == 1

    @savefile_windows[0].z = 0 #was 1  

    @savefile_windows[1].z = 2 

    @savefile_windows[2].z = 1    

    @savefile_windows[0].x = 0 

    @savefile_windows[1].x = @win_move 

    @savefile_windows[2].x = 0     

    @savefile_windows[0].contents_opacity =  0

    @savefile_windows[1].contents_opacity = @win_opac

    @savefile_windows[2].contents_opacity =  0

    else

    @savefile_windows[0].z = 0  

    @savefile_windows[1].z = 1 

    @savefile_windows[2].z = 2       

    @savefile_windows[0].x = 0 

    @savefile_windows[1].x = 0 

    @savefile_windows[2].x = @win_move  

    @savefile_windows[0].contents_opacity = 0

    @savefile_windows[1].contents_opacity = 0

    @savefile_windows[2].contents_opacity = @win_opac    

    end    

    @help_window.update    

    for i in @savefile_windows

      i.update

    end

    if Input.trigger?(Input::C)

      on_decision(make_filename(@file_index))

      Audio.se_play("Audio/SE/" + "018-Teleport01", 80, 100)

      $game_temp.last_file_index = @file_index

      return

    end

    if Input.trigger?(Input::B)

      on_cancel

      return

    end

    if Input.repeat?(Input::DOWN)

      if Input.trigger?(Input::DOWN) or @file_index < 3

        Audio.se_play("Audio/SE/" + "136-Light02", 60, 100)

        @savefile_windows[@file_index].selected = false

        @file_index = (@file_index + 1) % 3

        @savefile_windows[@file_index].selected = true

        return

      end

    end

    if Input.repeat?(Input::UP)

      if Input.trigger?(Input::UP) or @file_index > 0

        Audio.se_play("Audio/SE/" + "136-Light02", 60, 100)

        @savefile_windows[@file_index].selected = false

        @file_index = (@file_index - 1) % 3

        @savefile_windows[@file_index].selected = true

        return

      end

    end

  end

  def make_filename(file_index)

    return "Save#{file_index + 1}.rxdata"

  end

end

And here is Window_SaveFile, since I can't remember if I edited it at all or not...

Code:
#==============================================================================

# ** Window_SaveFile

#------------------------------------------------------------------------------

#  This window displays save files on the save and load screens.

#==============================================================================

 

class Window_SaveFile < Window_Base

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :filename                 # file name

  attr_reader   :selected                 # selected

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     file_index : save file index (0-3)

  #     filename   : file name

  #--------------------------------------------------------------------------

  def initialize(file_index, filename)

    super(0, 64 + file_index % 4 * 104, 640, 104)

    self.contents = Bitmap.new(width - 32, height - 32)

    @file_index = file_index

    @filename = "Save#{@file_index + 1}.rxdata"

    @time_stamp = Time.at(0)

    @file_exist = FileTest.exist?(@filename)

    if @file_exist

      file = File.open(@filename, "r")

      @time_stamp = file.mtime

      @characters = Marshal.load(file)

      @frame_count = Marshal.load(file)

      @game_system = Marshal.load(file)

      @game_switches = Marshal.load(file)

      @game_variables = Marshal.load(file)

      @total_sec = @frame_count / Graphics.frame_rate

      file.close

    end

    refresh

    @selected = false

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    # Draw file number

    self.contents.font.color = normal_color

    name = "File#{@file_index + 1}"

    self.contents.draw_text(4, 0, 600, 32, name)

    @name_width = contents.text_size(name).width

    # If save file exists

    if @file_exist

      # Draw character

      for i in [email=0...@characters.size]0...@characters.size[/email]

        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])

        cw = bitmap.rect.width / 4

        ch = bitmap.rect.height / 4

        src_rect = Rect.new(0, 0, cw, ch)

        x = 300 - @characters.size * 32 + i * 64 - cw / 2

        self.contents.blt(x, 68 - ch, bitmap, src_rect)

      end

      # Draw play time

      hour = @total_sec / 60 / 60

      min = @total_sec / 60 % 60

      sec = @total_sec % 60

      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)

      self.contents.font.color = normal_color

      self.contents.draw_text(4, 8, 600, 32, time_string, 2)

      # Draw timestamp

      self.contents.font.color = normal_color

      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")

      self.contents.draw_text(4, 40, 600, 32, time_string, 2)

    end

  end

  #--------------------------------------------------------------------------

  # * Set Selected

  #     selected : new selected (true = selected, false = unselected)

  #--------------------------------------------------------------------------

  def selected=(selected)

    @selected = selected

    update_cursor_rect

  end

  #--------------------------------------------------------------------------

  # * Cursor Rectangle Update

  #--------------------------------------------------------------------------

  def update_cursor_rect

    if @selected

      self.cursor_rect.set(0, 0, @name_width + 8, 32)

    else

      self.cursor_rect.empty

    end

  end

end

 

Thanks a ton for even bothering to look at this guys!


EDIT to say: The window size should not be a factor now that I think about it, as the files aren't competing for space.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top