Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Monster Album
#2
Part 2
Code:
#==============================================================================
# ** Scene_Save
#==============================================================================

class Scene_Save < Scene_File
 #--------------------------------------------------------------------------
 # * Write Save Data
 #     file : write file object (opened)
 #--------------------------------------------------------------------------
 def write_save_data(file)
   # Make character data for drawing save file
   characters = []
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     characters.push([actor.character_name, actor.character_hue])
   end
   # Write character data for drawing save file
   Marshal.dump(characters, file)
   # Wrire frame count for measuring play time
   Marshal.dump(Graphics.frame_count, file)
   # Increase save count by 1
   $game_system.save_count += 1
   # Save magic number
   # (A random value will be written each time saving with editor)
   $game_system.magic_number = $data_system.magic_number
   # Write each type of game object
   Marshal.dump($game_system, file)
   Marshal.dump($game_switches, file)
   Marshal.dump($game_variables, file)
   Marshal.dump($game_self_switches, file)
   Marshal.dump($game_screen, 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)
   # Added code. Stores the Album data on save command
   Marshal.dump($game_album, file)
 end
end

#==============================================================================
# ** Scene_Load
#==============================================================================

class Scene_Load < Scene_File
 #--------------------------------------------------------------------------
 # * Read Save Data
 #     file : file object for reading (opened)
 #--------------------------------------------------------------------------
 def read_save_data(file)
   # Read character data for drawing save file
   characters = Marshal.load(file)
   # Read frame count for measuring play time
   Graphics.frame_count = Marshal.load(file)
   # Read each type of game object
   $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)
   $game_player        = Marshal.load(file)
   # Added code. Retrieves the Album data on load command
   $game_album         = Marshal.load(file)
   # If magic number is different from when saving
   # (if editing was added with editor)
   if $game_system.magic_number != $data_system.magic_number
     # Load map
     $game_map.setup($game_map.map_id)
     $game_player.center($game_player.x, $game_player.y)
   end
   # Refresh party members
   $game_party.refresh
 end
end

#==============================================================================
# ** Section V: Modules
#==============================================================================

#==============================================================================
# ** Module Colors
#------------------------------------------------------------------------------
# Contains various defined colors for use in projects.
#==============================================================================

module Colors
 # CONSTANTS

 GREEN = Color.new(50, 200, 50, 255)
 RED = Color.new(200, 50, 50, 255)
 YELLOW = Color.new(200, 200, 0, 255)
 ORANGE = Color.new(220, 150, 0, 255)
 INDIGO = Color.new(50, 50, 200, 110)
 VIOLET = Color.new(120, 50, 180, 110)
 BLACK = Color.new(0, 0, 0, 255)
end
}


Messages In This Thread
Monster Album - by El Conductor - 08-04-2007, 01:00 PM
RE: Monster Album - by El Conductor - 08-04-2007, 01:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Advanced Monster Database SephirothSpawn 0 2,430 11-19-2005, 01:00 PM
Last Post: SephirothSpawn



Users browsing this thread: