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.

Actors name reverts in save menu

Hello all.

I'm having, (as well as sure everyone else who use name input processing) is having their actors name revert back to the default Actor name after saving and quitting to the title.
Is it at all possible to counter this so the actors names stay the same as the ones the player inputs?

Many thanks for anyones time and response!
 
errr...the default system SHOULD save your actor's name. When you use name input, it permanently changes the actor's name to that for your savegame. it does NOT get reset, unless you're using custom scripts that change that
 
D'oh, I'm sorry. My original post wasnt as descriptive as it should have been.
Hopefully this wont confuse you...
What happens is, when I save and return to the title screen, then go to load the game, the actors name on the save window is the default actors name. However, when you load the game, its the name the player inputs.
So for example:

I start a new game.
I change my default named character "Bob" to "John"
I save my game.
I quit to title.
I go to the load file select.
The name in the load select is Bob.
I load the game.
The characters name is John.

Hope that made some sense...

It's a very minor issue, but has been really bugging me lately. =/
 
Ah, so you have a custom script that displays characters' names on their savefile? If that's the case, it's not so easy to fix. Because the characters' names are stored in the $game_system class, and that class instance is unique to each savefile, you'd have to do some loading when the file scene is created...
I don't have the time right now to explore it in any detail, maybe you can get onto the creator of said script? (is it even a script lol? I'm pretty sure my savefiles don't have that feature, that's why I thought it was :P)
 
Yes, its a script. Sorry I neglected to mention that earlier. It totally slipped my mind that the name does not show in the file window by default.
The script was a fusion of two scripts put together.

I appreciate the time you've taken to respond to my issue.

The below is the script I'm using.. I my mess around and see if I can figure out a solution for myself.

Code:
#====================================================================
# SCENE FILE LIKE FINAL FANTASY
#====================================================================
# More saveslots by Erzengel, MapName by ccoa
#====================================================================
# Edits by Erzengel, snstar2006 and woratana
#====================================================================
# Crappy fusion by Maverick Highwind
#====================================================================


class Game_Map
attr_reader :name

def setup(map_id)
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
@name = load_data("Data/MapInfos.rvdata")[@map_id].name
@display_x = 0
@display_y = 0
@passages = $data_system.passages
referesh_vehicles
setup_events
setup_scroll
setup_parallax
@need_refresh = false
end
end

class Scene_File < Scene_Base
def write_save_data(file)
characters = []
for actor in $game_party.members
characters.push([actor.character_name, actor.character_index])
end
$game_system.save_count += 1
$game_system.version_id = $data_system.version_id
@last_bgm = RPG::BGM::last
@last_bgs = RPG::BGS::last
Marshal.dump($game_map.name, file)
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
Marshal.dump(@last_bgm, file)
Marshal.dump(@last_bgs, file)
Marshal.dump($game_system, file)
Marshal.dump($game_message, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end

def read_save_data(file)
map_name = Marshal.load(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
$game_system = Marshal.load(file)
$game_message = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
if $game_system.version_id != $data_system.version_id
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
end
end

class Window_SaveFile < Window_Base
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
begin
@mapname = Marshal.load(file)
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
@game_system = Marshal.load(file)
@game_message = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@game_self_switches = Marshal.load(file)
@game_actors = Marshal.load(file)
@game_party = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
rescue
@file_exist = false
ensure
file.close
end
end
end

def refresh
self.contents.clear
self.contents.font.color = normal_color
name = Vocab::File + " #{@file_index + 1}"
self.contents.draw_text(4, 0, 200, WLH, name)
@name_width = contents.text_size(name).width
if @file_exist
#draw_party_characters(152, 58)

for i in 0...4
   if !@game_party.members[i].nil?
actor = @game_party.members[i]
draw_actor_face(actor, 120+i*80, 2, 72)
end
end

for i in 0...1
   if !@game_party.members[i].nil?
actor = @game_party.members[i]
draw_actor_name(actor, 4, 48)
end
end

draw_playtime(-420, 24, contents.width - 4, 2)
draw_mapname(0, 63, contents.width - 3, 32)
#draw_mapname(-372, 63, contents.width - 3, 32)
end
end

def draw_mapname(x, y, width, height)
self.contents.draw_text(x, y, width, height, @mapname, 2)
end
end

#==============================================================================
# ** More saveslots (v1.0 by ERZENGEL)
#------------------------------------------------------------------------------
#    The value of the saveslots can be set
#==============================================================================

# value of the saveslots
SAVE_MAX = 99

#==============================================================================
class Window_SaveFile
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 56 + file_index % SAVE_MAX * 120, 544, 120)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_File
  #--------------------------------------------------------------------------
  def start  
    super
    @file_max = SAVE_MAX
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
    @page_file_max = ((416 - @help_window.height) / 120).truncate
    for i in 0...@file_max
      window = @savefile_windows[i]
      if @index > @page_file_max - 1
        if @index < @file_max - @page_file_max - 1
          @top_row = @index
          window.y -= @index * window.height
        elsif @index >= @file_max - @page_file_max
          @top_row = @file_max - @page_file_max
          window.y -= (@file_max - @page_file_max) * window.height
        else
          @top_row = @index
          window.y -= @index * window.height
        end
      end
      window.visible = (window.y >= @help_window.height and
      window.y < @help_window.height + @page_file_max * window.height)
    end
  end
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @top_row = 0
    @savefile_windows = []
    for i in 0...@file_max
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
  end
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @file_max - 1 or wrap
      @index = (@index + 1) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == 0
          @top_row = 0
          window.y = @help_window.height + i % @file_max * window.height
        elsif @index - @top_row > @page_file_max - 1
          window.y -= window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row > @page_file_max - 1
        @top_row += 1
      end
    end
  end
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @file_max) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == @file_max - 1
          @top_row = @file_max - @page_file_max
          window.y = @help_window.height + i % @file_max * window.height
          window.y -= (@file_max - @page_file_max) * window.height
        elsif @index - @top_row < 0
          window.y += window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row < 0
        @top_row -= 1
      end
    end
  end
  #--------------------------------------------------------------------------  
end
#==============================================================================
 
Hmmm...I've personally never been too lucky editing the Scene_Save class lol...always get problems, so my best suggestion is seeing if the author knows anything about it
 

Zeriab

Sponsor

It is a problem with the script drawing the actor name before loading it from the save file.

Ok this really is an ugly script script  :crazy:
I have fixed the indention and changed it so the proper name is displayed.

Code:
#====================================================================
# SCENE FILE LIKE FINAL FANTASY
#====================================================================
# More saveslots by Erzengel, MapName by ccoa
#====================================================================
# Edits by Erzengel, snstar2006 and woratana
#====================================================================
# Crappy fusion by Maverick Highwind
#====================================================================


class Game_Map
  attr_reader :name

  def setup(map_id)
    @map_id = map_id
    @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
    @name = load_data("Data/MapInfos.rvdata")[@map_id].name
    @display_x = 0
    @display_y = 0
    @passages = $data_system.passages
    referesh_vehicles
    setup_events
    setup_scroll
    setup_parallax
    @need_refresh = false
  end
end

class Scene_File < Scene_Base
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([actor.character_name, actor.character_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump($game_map.name, file)
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm, file)
    Marshal.dump(@last_bgs, file)
    Marshal.dump($game_system, file)
    Marshal.dump($game_message, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
  end

  def read_save_data(file)
    map_name = Marshal.load(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm = Marshal.load(file)
    @last_bgs = Marshal.load(file)
    $game_system = Marshal.load(file)
    $game_message = Marshal.load(file)
    $game_switches = Marshal.load(file)
    $game_variables = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_actors = Marshal.load(file)
    $game_party = Marshal.load(file)
    $game_troop = Marshal.load(file)
    $game_map = Marshal.load(file)
    $game_player = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

class Window_SaveFile < Window_Base
  def load_gamedata
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      begin
        @mapname = Marshal.load(file)
        @characters = Marshal.load(file)
        @frame_count = Marshal.load(file)
        @last_bgm = Marshal.load(file)
        @last_bgs = Marshal.load(file)
        @game_system = Marshal.load(file)
        @game_message = Marshal.load(file)
        @game_switches = Marshal.load(file)
        @game_variables = Marshal.load(file)
        @game_self_switches = Marshal.load(file)
        @game_actors = Marshal.load(file)
        @game_party = Marshal.load(file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end

  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = Vocab::File + " #{@file_index + 1}"
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      #draw_party_characters(152, 58)

      for i in 0...4
          if !@game_party.members[i].nil?
          actor = @game_party.members[i]
          draw_actor_face(actor, 120+i*80, 2, 72)
        end
      end

      for i in 0...1
        if !@game_party.members[i].nil?
        actor = @game_party.members[i]
        actor = @game_actors[actor.id]
        draw_actor_name(actor, 4, 48)
      end
    end

    draw_playtime(-420, 24, contents.width - 4, 2)
    draw_mapname(0, 63, contents.width - 3, 32)
    #draw_mapname(-372, 63, contents.width - 3, 32)
    end
  end

  def draw_mapname(x, y, width, height)
    self.contents.draw_text(x, y, width, height, @mapname, 2)
  end
end

#==============================================================================
# ** More saveslots (v1.0 by ERZENGEL)
#------------------------------------------------------------------------------
#    The value of the saveslots can be set
#==============================================================================

# value of the saveslots
SAVE_MAX = 99

#==============================================================================
class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 56 + file_index % SAVE_MAX * 120, 544, 120)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_File
  #--------------------------------------------------------------------------
  def start  
    super
    @file_max = SAVE_MAX
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
    @page_file_max = ((416 - @help_window.height) / 120).truncate
    for i in 0...@file_max
      window = @savefile_windows[i]
      if @index > @page_file_max - 1
        if @index < @file_max - @page_file_max - 1
          @top_row = @index
          window.y -= @index * window.height
        elsif @index >= @file_max - @page_file_max
          @top_row = @file_max - @page_file_max
          window.y -= (@file_max - @page_file_max) * window.height
        else
          @top_row = @index
          window.y -= @index * window.height
        end
      end
      window.visible = (window.y >= @help_window.height and
      window.y < @help_window.height + @page_file_max * window.height)
    end
  end
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @top_row = 0
    @savefile_windows = []
    for i in 0...@file_max
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
  end
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @file_max - 1 or wrap
      @index = (@index + 1) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == 0
          @top_row = 0
          window.y = @help_window.height + i % @file_max * window.height
        elsif @index - @top_row > @page_file_max - 1
          window.y -= window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row > @page_file_max - 1
        @top_row += 1
      end
    end
  end
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @file_max) % @file_max
      for i in 0...@file_max
        window = @savefile_windows[i]
        if @index == @file_max - 1
          @top_row = @file_max - @page_file_max
          window.y = @help_window.height + i % @file_max * window.height
          window.y -= (@file_max - @page_file_max) * window.height
        elsif @index - @top_row < 0
          window.y += window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row < 0
        @top_row -= 1
      end
    end
  end
  #--------------------------------------------------------------------------  
end
#=================================
 

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