[MAY BE SOLVED?]
Posts
Pages:
1
I want the save and load file to show actor's faces instead of sprites
I searched scripts, this is what I found, crashes...
(Link = http://www.rpgmakervxace.net/topic/26652-show-faces-instead-of-character-on-saveload-screen/)
Also down here.
#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
# This module manages the database and game objects. Almost all of the
# global variables used by the game are initialized by this module.
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Create Save Header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header = $game_system.playtime_s
header = $game_party.faces_for_savefile
header
end
#--------------------------------------------------------------------------
# * Maximum Number of Save Files
#--------------------------------------------------------------------------
# This can be changed to required amount of save slots needed
#--------------------------------------------------------------------------
def self.savefile_max
return 3
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Face Image Information for Save File Display
#--------------------------------------------------------------------------
def faces_for_savefile
battle_members.collect do |actor|
end
end
end
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * 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_faces(70, 0)
draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
end
#--------------------------------------------------------------------------
# * Draw Party Faces
#--------------------------------------------------------------------------
def draw_party_faces(x, y)
header = DataManager.load_header(@file_index)
return unless header
header.each_with_index do |data, i|
draw_face(data, data, x + i * 98, 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, 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
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This class performs common processing for the save screen and load screen.
#==============================================================================
class Scene_File < Scene_MenuBase
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
DataManager.savefile_max
end
#--------------------------------------------------------------------------
# * Get Number of Save Files to Show on Screen
#--------------------------------------------------------------------------
# Don't change this number or the faces won't fit inside the window
#--------------------------------------------------------------------------
def visible_max
return 3
end
end
I searched scripts, this is what I found, crashes...
(Link = http://www.rpgmakervxace.net/topic/26652-show-faces-instead-of-character-on-saveload-screen/)
Also down here.
#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
# This module manages the database and game objects. Almost all of the
# global variables used by the game are initialized by this module.
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Create Save Header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header = $game_system.playtime_s
header = $game_party.faces_for_savefile
header
end
#--------------------------------------------------------------------------
# * Maximum Number of Save Files
#--------------------------------------------------------------------------
# This can be changed to required amount of save slots needed
#--------------------------------------------------------------------------
def self.savefile_max
return 3
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Face Image Information for Save File Display
#--------------------------------------------------------------------------
def faces_for_savefile
battle_members.collect do |actor|
end
end
end
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * 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_faces(70, 0)
draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
end
#--------------------------------------------------------------------------
# * Draw Party Faces
#--------------------------------------------------------------------------
def draw_party_faces(x, y)
header = DataManager.load_header(@file_index)
return unless header
header.each_with_index do |data, i|
draw_face(data, data, x + i * 98, 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, 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
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This class performs common processing for the save screen and load screen.
#==============================================================================
class Scene_File < Scene_MenuBase
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
DataManager.savefile_max
end
#--------------------------------------------------------------------------
# * Get Number of Save Files to Show on Screen
#--------------------------------------------------------------------------
# Don't change this number or the faces won't fit inside the window
#--------------------------------------------------------------------------
def visible_max
return 3
end
end
Aside from stuff in your post that's hidden because they were in square brackets (and me being an idiot by just copy-pasting rather than quoting then copy-passting), I... didn't have issues getting this to work?
Script '' line66 NoMethodError occured.
undefined method 'each_with_index' for nil:NilClass
Crash happens when I try to save game from menu.
Using just one face graphic file, but it also crashed when I used the regular face file grids (that have 8 faces.)
I also removed all my scripts below main and still crashed.
Unless anything with this script requires RTP?
Because I have removed the RTP from the .ini file.
Edit:
I'm actually pretty sure this may have something to do with the RTP.
Edit Again:
If you get rid of that header bullshit on line 66 with $game_party.faces_for_savefile you can save and load the file. The picture will show up in the save, but not the load.
EDIT:
I think I solved it!
def draw_party_faces(x, y)
header = DataManager.load_header(@file_index)
return unless header
header.each_with_index do |data, i|
draw_face(data, data, x + i * 98, y)
end
end
undefined method 'each_with_index' for nil:NilClass
Crash happens when I try to save game from menu.
Using just one face graphic file, but it also crashed when I used the regular face file grids (that have 8 faces.)
I also removed all my scripts below main and still crashed.
Unless anything with this script requires RTP?
Because I have removed the RTP from the .ini file.
Edit:
I'm actually pretty sure this may have something to do with the RTP.
Edit Again:
If you get rid of that header bullshit on line 66 with $game_party.faces_for_savefile you can save and load the file. The picture will show up in the save, but not the load.
EDIT:
I think I solved it!
def draw_party_faces(x, y)
header = DataManager.load_header(@file_index)
return unless header
header.each_with_index do |data, i|
draw_face(data, data, x + i * 98, y)
end
end
Pages:
1