[XP] Chaos Project Save Layout

Started by Fantasist, March 19, 2008, 10:45:25 am

Previous topic - Next topic

Fantasist

March 19, 2008, 10:45:25 am Last Edit: February 24, 2011, 05:50:54 am by Fantasist
Chaos Project Save Layout
Authors: Fantasist, Blizzard
Version: 1.4.2
Type: Save/Load Scene Mod
Key Term: Title / Save / Load / GameOver Add-on



Introduction

This replaces the default Save/Load scenes with the layout from the game Chaos Project.


Features

Features taken from Chaos Project:


  • The layout
  • Confirm overwrite window (optional)
  • Detects and uses the windowskin from the savefile (useful with other scripts which enable in-game changing of windowskins)
  • Detects and uses the font from the savefile (made to work with Ultimate Font Override from Tons of Addons)
  • Load-on-demand feature which temporarilyloads save data for faster file selection. Handy especially when using scripts like DREAM
  • Prevents crashing and displays 'Corrupted save data' (customizable) if a savefile is corrupted
  • Compatible with DREAM for Savefiles
  • Location names (optional)


Additional features:

  • Chapter System (optional)
  • Following things are customizable: number of save slots, savefile name, savefile extension, savefile location, text in the Save/Load scene (help window text, overwrite prompt text, etc)
  • Indicates if file exists by colouring the text in the list window (optional)




Screenshots

Spoiler: ShowHide






Demo

Come on already, this is almost plug-and-play! (Demo on demand, but respect my laziness ^_^)


Script

Installation: Place this script anywhere above main and below Scene_Load. Place above Tons of Addons if you're using it.
Spoiler: ShowHide

#==============================================================================
# ** Chaos Project Save Layout
#------------------------------------------------------------------------------
# by Fantasist
# Version 1.4.2
# 24-Feb-2011
#------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First version
#   1.1 - Optimized code a bit
#   1.2 - Closer to CP layout and features
#   1.3 - Load-on-demand feature added for faster loading of scene
#   1.4 - Location name and Chapter systems added
#   1.4.1 - Can now customize default option in confirm overwrite window
#   1.4.2 - Added feature (coloured text in filelist based on file existence)
#------------------------------------------------------------------------------
# Description:
#     This replaces the default Save/Load scenes with the layout from the game
#   Chaos Project.
#
#   Features taken from Chaos Project:
#    - The layout
#    - Confirm overwrite window (optional)
#    - Detects and uses the windowskin from the savefile (useful with other
#      scripts which enable in-game changing of windowskins)
#    - Detects and uses the font from the savefile (made to work with
#      Ultimate Font Override from Tons of Addons)
#    - Prevents crashing and displays 'Corrupted save data' (customizable) if a
#      savefile is corrupted
#    - Compatible with DREAM for Savefiles
#    - Location names (optional)
#
#   Additional features:
#    - Chapter System (optional)
#    - Customizable number of save slots, savefile name, savefile extension,
#      savefile location
#    - Customizable text in the Save/Load scene (help window text,
#      overwrite prompt text, etc)
#    - Indicates if file exists by colouring text in the list window (optional)
#------------------------------------------------------------------------------
# Compatibility:
#
#   Might not be compatible with other save/load systems. Should be compatible
#   with everything else.
#   Compatible with 'Ultimate Font Override' from Tons of Addons,
#   'Storm Tronics CMS' and 'DREAM for Savefiles' by Blizzard
#------------------------------------------------------------------------------
# Installation: Place this script anywhere above main and below Scene_Load.
#               Place above Tons of Addons if you're using it.
#
# Configuration:

module CPSL
 
#============================================================
# Main Config Start
#============================================================
 
 Save_number = 8     # Number of save slots
 Save_path = ''      # Path where savefiles are placed (Example: 'Saves/')
 Save_name = 'Save'  # Name of savefiles
 Save_ext = 'rxdata' # Extension of savefiles. Change to 'dreamX' if you're
                     # using DREAM. X is the DREAM version (like 'dream4')
 
 Confirm_Overwrite = true  # Enable/disable the Confirm Overwrite prompt window
 Confirm_Overwrite_Words = 'Overwrite file?'  # The prompt to be displayed
 Confirm_Overwrite_default = 1 # Default choice for confirm overwrite window
                               # 0: Yes, 1: No
 
 Chapter = true  # Enable chapter system
 Location = true  # Enable location names
 
 File_name = 'No. '  # Text shown for the save slots (No. 1, No. 2, etc)
 No_file_text = 'No saved game'  # Text shown if the slot has no game saved
 Corrupted_file_text = 'Corrupted save data'  # Text shown if the savefile is corrupted
 Load_Help_Text = 'Which file would you like to load from?' # Text in help window during Load scene
 Save_Help_Text = 'Which file would you like to save to?'   # Text in help window during Save scene
 
 Show_File_Exists = true # Enable/disable showing if file exists in the file list
 File_Exist_Color = Color.new(255, 255, 255) # Colour to show if savefile exists
 File_Empty_Color = Color.new(128, 128, 128) # Colour to show if savefile doesn't exist
 File_Corrupt_Color = Color.new(255, 0, 0) # Colour to show if file is corrupt
 
 module_function
 
 def chapter(gs)
   ch = case gs.chapter
   #=============Chapter System Config Start=======================
   # You can change the chapter by using the following code in Call Script
   # event command
   #                 $game_system.chapter = <number>
   #
   when 1 then 'First Chapter'
   when 2 then 'Second Chapter'
   # to add another chapter, copy the above line
   # and change the number and chapter name
   #=====================================================
   else '---'
   end
   return [gs.chapter, ch]
 end
 
#============================================================
# Main Config End (Look below for optional config)
#============================================================
 
 def set_fontsize(font)
   size = case font
   #=============Font size correction config=======================
   # This is for the size of the font to be displayed in the file info window.
   # This was made because the font size I decided for the layout (21)
   # might not be suitable for fonts other than Arial. If you're using a
   # different font and it doesn't look right, add that font to this list.
   when 'Impact' then 24
   when 'Comic Sans MS' then 24
   when 'Brush Script' then 24
   # to add another font, copy the above line
   # and change the font name and size
   #=====================================================
   else 21
   end
   return size
 end

#============================================================
# Config End
#============================================================

 
 def make_savename(file_index)
   return Save_path + Save_name + "#{file_index + 1}." + Save_ext
 end
 
end
#------------------------------------------------------------------------------
# Issues:
#
#   This is not an issue, and is meant to work like that. So before you ask:
#
#     There is a feature which colours the text in the file list window
#   depending on whether that savefile exists or not. It also shows if the file
#   is corrupt, but only if it has been viewed at least once. That is, it'll
#   show that the file exists, but not that it is corrupt unless it is selected
#   at least once.
#------------------------------------------------------------------------------
# Credits: Fantasist for making this
# Thanks: Blizzard (and his game Chaos Project) for the layout and inspiration,
#         Sase for pointing out the issue with the confirm overwrite window, and
#         IserLuick for suggesting a feature.
#------------------------------------------------------------------------------
# Notes:
# If you have any questions, problems or suggestions, you can find me at:
#
#  - www.chaos-project.com
#
# Enjoy ^_^
#==============================================================================

#==============================================================================
# ** Bitmap
#==============================================================================

class Bitmap
 
 def draw_load_bar(num)
   o = 160
   w, h = self.width - 32, 12
   bh = 2
   c = num == 100 ? Color.new(0, 255, 0, o) : Color.new(255, 0, 0, o)
   fill_rect(16 + 0, self.height - bh*h, w, h, Color.new(255, 255, 255, o))
   fill_rect(16 + 1, self.height - bh*h + 1, w-2, h-2, Color.new(0, 0, 0, o))
   fill_rect(16 + 2, self.height - bh*h + 2, (w-4)*num/100, h-4, c)
 end
 
end

#==============================================================================
# ** Loading_Bar
#==============================================================================

class Loading_Bar < Sprite
 
 def initialize
   w, h = 200, 80
   super
   self.ox, self.oy = w/2, h/2
   self.bitmap = Bitmap.new(w, h)
   self.bitmap.fill_rect(self.bitmap.rect, Color.new(0, 0, 0, 160))
   self.z = 999
   self.bitmap.draw_text(0, 0, w, 32, 'Loading...', 1)
   self.bitmap.draw_load_bar(0)
 end
 
 def refresh(num=0)
   self.bitmap.fill_rect(0, 0, self.bitmap.width, 32, Color.new(0, 0, 0, 160))
   txt = num == 100 ? 'Complete!' : 'Loading...'
   self.bitmap.draw_text(0, 0, self.bitmap.width, 32, txt, 1)
   self.bitmap.draw_load_bar(num)
 end
 
end

#==============================================================================
# ** Window_Prompt
#==============================================================================

class Window_Prompt < Window_Base
 
 attr_reader :index
 
 def initialize(txt, mode=0, index=0)
   @txt, @mode = txt, mode
   width = [text_width(txt) + 32, 220].max
   height = 64 + mode * 64
   super(320 - width/2, 240 - height/2, width, height)
   self.contents = Bitmap.new(self.width - 32, self.height - 32)
   bmp = Bitmap.new(192, 128)
   bmp.fill_rect(0, 0, 128, 128, Color.new(0, 0, 0, 200))
   bmp.fill_rect(128, 64, 32, 32, Color.new(255, 0, 0, 200))
   self.windowskin = bmp
   refresh
   @index = @mode > 0 ? index : -1
 end
 
 def text_width(text)
   dummy = Bitmap.new(640, 64)
   w = dummy.text_size(text).width
   dummy.dispose
   return w
 end
 
 def reset(txt, mode=0, index=0)
   @txt = txt unless txt == nil
   @mode = mode
   @index = @mode > 0 ? index : -1
   self.contents.dispose
   width = [text_width(txt) + 32, 300].max
   self.width, self.height = width, 64 + mode * 64
   self.x, self.y = 320 - self.width/2, 240 - self.height/2
   self.contents = Bitmap.new(self.width - 32, self.height - 32)
   refresh
   update_cursor_rect
 end
 
 def refresh
   self.contents.clear
   self.contents.draw_text(0, 0, self.width - 32, 32, @txt, 1)
   if @mode > 0
     self.contents.draw_text(self.width/2 - 16 - 34, 32, 68, 32, 'Yes', 1)
     self.contents.draw_text(self.width/2 - 16 - 34, 64, 68, 32, 'No', 1)
   end
 end
 
 def index=(index)
   @index = index
   update_cursor_rect
 end
 
 def update_cursor_rect
   if @index < 0
     self.cursor_rect.empty
     return
   end
   cursor_width = self.contents.text_size('  Yes  ').width
   x = (self.width - cursor_width)/2 - 16
   y = 32 + @index * 32
   self.cursor_rect.set(x, y, cursor_width, 32)
 end
 
 def update
   super
   if @mode > 0
     if self.active && @index >= 0
       if Input.repeat?(Input::DOWN)
         $game_system.se_play($data_system.cursor_se)
         @index = (@index + 1) % 2
       elsif Input.repeat?(Input::UP)
         $game_system.se_play($data_system.cursor_se)
         @index = (@index - 1) % 2
       end
     end
     update_cursor_rect
   end
 end
 
end

#==============================================================================
# ** Window_FileList
#==============================================================================

class Window_FileList < Window_Selectable
 
 def initialize
   super(0, 64, 98, 416)
   list = []
   (1..CPSL::Save_number).each {|i| list.push("#{CPSL::File_name}#{i}")}
   @commands = list
   @item_max = list.size
   @ch = list.size < 12 ? (self.height - 32) / list.size : 32
   self.contents.dispose if self.contents
   self.contents = Bitmap.new(self.width - 32, list.size < 12 ? 416-32 : list.size * 32)
   refresh
 end
 
 def refresh
   self.contents.clear
   (0...@item_max).each {|i|
   if CPSL::Show_File_Exists
     color = FileTest.exist?(CPSL.make_savename(i)) ? CPSL::File_Exist_Color : CPSL::File_Empty_Color
   else
     color = normal_color
   end
   draw_item(i, color)}
 end
 
 def draw_item(index, color)
   self.contents.font.color = color
   rect = Rect.new(4, @ch * index, self.contents.width - 8, @ch)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[index], @commands.size > 9 ? 0 : 1)
 end
 
 alias fant_cpsl_list_upd_cursor_rect update_cursor_rect
 def update_cursor_rect
   fant_cpsl_list_upd_cursor_rect
   cursor_width = self.width / @column_max - 32
   x = @index % @column_max * (cursor_width + 32)
   y = @index / @column_max * @ch - self.oy + (@ch-32)/2
   self.cursor_rect.set(x, y, cursor_width, 32)
 end
 
end

#==============================================================================
# ** Window_FileInfo
#==============================================================================

class Window_FileInfo < Window_Base
 
 attr_reader :index
 
 def initialize(file_index=0)
   super(98, 64, 542, 416)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.size = 21
   @index = -2
   @bar = Loading_Bar.new
   @bar.x = self.x + self.width / 2
   @bar.y = self.y + self.height / 2 - 32
   @bar.visible = false
   @save_data = []
   reload(file_index)
 end
 
 def reload(index)
   return if @index == index
   @index = index
   self.visible = false
   if @save_data[index] == nil
     filename = CPSL.make_savename(index)
     file_exist = FileTest.exist?(filename)
     if file_exist
       begin
         file = File.open(filename, 'r')
         ts = file.mtime
         if (defined? DREAM) && Required_DREAM_Version >= 4.1
           @bar.refresh(0)
           @bar.visible = true
           Graphics.transition(10)
           gs, gs, gs, gp, gp, gp, gm = DREAM.data(file)
           @bar.refresh(100)
           Graphics.update
           Graphics.freeze
           @bar.visible = false
           Graphics.transition(10)
         else
           @bar.refresh(0)
           @bar.visible = true
           Graphics.transition(10)
           3.times {|i| gs = Marshal.load(file); @bar.refresh(i*100/11); Graphics.update}
           6.times {|i| gp = Marshal.load(file); @bar.refresh((i+3)*100/11); Graphics.update}
           2.times {|i| gm = Marshal.load(file); @bar.refresh((i+9)*100/11); Graphics.update}
           @bar.refresh(100)
           Graphics.update
           Graphics.freeze
           @bar.visible =false
           Graphics.transition(10)
         end
         file.close
         Graphics.freeze
       rescue
         file.close
         @bar.visible = false
         ts = gs = gp = gm = 'bad_file'
         $scene.list_win.draw_item(index, CPSL::File_Corrupt_Color)
       end          
     else
       ts = gs = gp = gm = nil
     end
     @save_data[index] = [ts, gs, gp, gm]
   end
   @time_stamp, @game_system, @game_party, @game_map = @save_data[index][0],
     @save_data[index][1], @save_data[index][2], @save_data[index][3]
   self.visible = true
   refresh
   Graphics.transition(5)
 end
 
 def refresh
   self.contents.clear
   self.contents.font.name = @game_system.fontname rescue 'Arial'
   self.contents.font.size = CPSL.set_fontsize(self.contents.font.name)
   self.windowskin = RPG::Cache.windowskin(@game_system.windowskin_name) rescue nil
   if @game_party == nil
     self.contents.font.color = normal_color
     draw_text_center(CPSL::No_file_text)
   elsif @time_stamp == 'bad_file'
     self.contents.font.color = Color.new(255, 0, 0)
     draw_text_center(CPSL::Corrupted_file_text)
   else
     mtime = @time_stamp
     date = mtime.strftime("%d-%b-%Y")
     time = mtime.strftime("%I:%M:%S %p")
     self.contents.font.color = system_color
     y = !(CPSL::Chapter || CPSL::Location) ? self.contents.height-54 : 0
     self.contents.draw_text(0, y + 0, self.contents.width - 8, 32, time, 2)
     self.contents.draw_text(0, y + 32, self.contents.width - 8, 22, date, 2)
     self.contents.font.color = normal_color
     if CPSL::Chapter
       y = CPSL::Location ? 0 : 14
       chapter = CPSL.chapter(@game_system)
       chapter_text = "Chapter #{chapter[0]}: #{chapter[1]}"
       self.contents.draw_text(0, y, 502, 32, chapter_text)
     end
     if CPSL::Location
       y = CPSL::Chapter ? 28 : 14
       self.contents.draw_text(0, y, 502, 32, 'Location: ' + $map_names[@game_map.map_id])
     end
     @game_party.actors.each_index {|i|
       x = 64
       y = (!(CPSL::Chapter || CPSL::Location) ? 8 : 48) + i * 82
       actor = @game_party.actors[i]
       
       draw_actor_graphic(actor, x - 24, y + 86)
       draw_actor_name(actor, 0, y + 12, 82, 1)
       
       draw_actor_level(actor, x + 28, y + 12)
       draw_actor_state(actor, x + 28 + 64, y + 12)
       draw_actor_exp(actor, x + 28, y + 64 - 18)
       
       draw_actor_hp(actor, x + 224, y + 12)
       draw_actor_sp(actor, x + 224, y + 64 - 18)
     }
   end
 end
 
 def draw_text_center(txt)
   self.contents.draw_text(0, (self.height-32)/2 - 16, self.width - 32, 32, txt, 1)
 end
 
 def draw_text_outline(x, y, w, h, t, a=0)
   original_color = self.contents.font.color.clone
   self.contents.font.color = Color.new(0, 0, 0)
   self.contents.draw_text(x-1, y-1, w, h, t, a)
   self.contents.draw_text(x-1, y+1, w, h, t, a)
   self.contents.draw_text(x+1, y-1, w, h, t, a)
   self.contents.draw_text(x+1, y+1, w, h, t, a)
   self.contents.font.color = original_color
   self.contents.draw_text(x, y, w, h, t, a)
 end
 
 def draw_actor_name(actor, x, y, width=120, align=0)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, width, 32, actor.name, align)
 end
 
 def dispose
   super
   @save_data = nil
   @bar.bitmap.dispose
   @bar.dispose
 end
 
end

#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
 
 attr_reader :list_win
 
 def initialize(help_text)
   @help_text = help_text
 end
 
 def main
   if $scene.is_a?(Scene_Load)
     text = CPSL::Load_Help_Text
   elsif $scene.is_a?(Scene_Save)
     text = CPSL::Save_Help_Text
   else
     text = @help_text
   end
   @help_text = text
   $game_temp.last_file_index = 0
   latest_time = Time.at(0)
   (0...CPSL::Save_number).each {|i|
     filename = make_filename(i)
     if FileTest.exist?(filename)
       file = File.open(filename, "r")
       if file.mtime > latest_time
         latest_time = file.mtime
         $game_temp.last_file_index = i
       end
       file.close
     end
   }
   @help_window = Window_Help.new
   @help_window.set_text(@help_text)
   @list_win = Window_FileList.new
   @list_win.index = $game_temp.last_file_index
   @info_win = Window_FileInfo.new(@list_win.index)
   @confirm_win = Window_Prompt.new(CPSL::Confirm_Overwrite_Words, 1)
   @confirm_win.visible = @confirm_win.active = false
   @confirm_win.z = @info_win.z + 10
   Graphics.transition
   loop {
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   }
   Graphics.freeze
   @help_window.dispose
   @list_win.dispose
   @info_win.dispose
   @confirm_win.dispose
 end
 
 def update
   @help_window.update
   if @list_win.active
     update_list
   elsif @confirm_win.active
     update_confirm
   end
 end
 
 def update_list
   @list_win.update
   if Input.trigger?(Input::C)
     if $scene.is_a?(Scene_Save) && CPSL::Confirm_Overwrite &&
       FileTest.exist?(make_filename(@list_win.index))
       @list_win.active = false
       @confirm_win.index = CPSL::Confirm_Overwrite_default
       @confirm_win.visible = @confirm_win.active = true
       $game_system.se_play($data_system.decision_se)
       return
     end
     on_decision(make_filename(@list_win.index))
     $game_temp.last_file_index = @list_win.index
   elsif Input.trigger?(Input::B)
     on_cancel
   elsif Input.repeat?(Input::UP)
     @info_win.reload(@list_win.index)
   elsif Input.repeat?(Input::DOWN)
     @info_win.reload(@list_win.index)
   end
 end
 
 def update_confirm
   @confirm_win.update
   if Input.trigger?(Input::C)
     if @confirm_win.index == 0
       on_decision(make_filename(@list_win.index))
       $game_temp.last_file_index = @list_win.index
     end
     $game_system.se_play($data_system.cancel_se) if @confirm_win.index == 1
     @confirm_win.visible = @confirm_win.active = false
     @list_win.active = true
   elsif Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @confirm_win.visible = @confirm_win.active = false
     @list_win.active = true
   end
 end
 
 def make_filename(index)
   CPSL.make_savename(index)
 end
 
end

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
 
 alias fant_cpsl_title_main main
 def main
   unless $map_names
     $map_names = load_data('Data/MapInfos.rxdata')
     $map_names.each_key {|key| $map_names[key] = $map_names[key].name}
   end
   fant_cpsl_title_main
 end
 
end

#==============================================================================
# ** Game_System
#==============================================================================

class Game_System
 attr_accessor :chapter
end


Now, search for the following or similar in Scene_Title:

   @continue_enabled = false
   for i in 0..3
     if FileTest.exist?("Save#{i+1}.rxdata")
       @continue_enabled = true
     end
   end


Comment those lines and add this line:

   @continue_enabled = (0...CPSL::Save_number).any? {|i|FileTest.exist?(CPSL.make_savename(i))}




Instructions

In script header.


Compatibility

Quote#------------------------------------------------------------------------------
# Compatibility:
#
#   Might not be compatible with other save/load systems. Should be compatible
#   with everything else.
#   Compatible with 'Ultimate Font Override' from Tons of Addons,
#   'Storm Tronics CMS' and 'DREAM for Savefiles' by Blizzard
#------------------------------------------------------------------------------



Credits and Thanks

Credits: Fantasist for making this, Blizzard for the layout
Thanks: Blizzard (and his game Chaos Project) for the original layout and inspiration, Sase for pointing out the issue with the confirm overwrite window, and IserLuick for suggesting a feature


Author's Notes

  I'm not perfectly happy with the bars. If anything seems too troublesome or annoying while using the script, please let me know. I want to make this as practically pleasant as possible.

If you have any questions, problems or suggestions, you can find me at:
- www.chaos-project.com
- www.quantumcore.forumotion.com
Enjoy ^_^
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

I use load-on-demand as well if you haven't noticed. ^_^

BTW, add the [RMXP] tag to the topic's title.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

Forgot in the excitement. And yeah, I know. When 1.3 is out, it'll be added to the Features from CP list :D
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Flermza


Blizzard

March 19, 2008, 11:45:11 am #4 Last Edit: March 19, 2008, 11:47:14 am by Blizzard
I just tested it, nice job on it. Here are my suggestions and comments:

1. In your header it says v1.0 while in the version history it says v1.2. xD

2. When you try to overwrite a file and choose "No", the next time you select a file to overwrite, the cursor was memorized and is still pointing at "No". You should reset it.

3. This piece here:

    if @index == i
      return
    else
      @index = i
    end


Just this is enough:

    return if @index == i
    @index = i


4. Interesting, you used the load bar for the load state of the files. I used the load bar when actually loading the game data. I only display "Loading file..." when a file is being loaded to display. Of course, it doesn't have to be a complete clone so I think you should leave it that way.

5. Change

    if @list_win.active
      update_list
      return
    end
    if @confirm_win.active
      update_confirm
      return
    end


to

    if @list_win.active
      update_list
    elsif @confirm_win.active
      update_confirm
    end


6. Change

      @continue_enabled = false
      (0...CPSL::Save_number).each {|i|
      @continue_enabled = true if FileTest.exist?(CPSL.make_savename(i))
      }


to

      @continue_enabled = (0...CPSL::Save_number).any? {|i|
          FileTest.exist?(CPSL.make_savename(i))
      }


7. There's a "little glitch" in the title menu. Initially the "Continue" option is not enabled and is being enabled after the loading was done. You should add instructions how to edit the title script instead of making your script do the work. I did the same in DREAM for Savefiles.

8. Load-on-demand will become very useful if somebody can't resist to use more 50 fileslots... >.<

9. I put up 2 screenshots. ::)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

March 19, 2008, 12:32:58 pm #5 Last Edit: March 19, 2008, 12:40:00 pm by Fantasist
@Flermza; Thank you :)

@Blizz:

QuoteIn your header it says v1.0 while in the version history it says v1.2. xD

Oops! Will have to correct that.

Quote2. When you try to overwrite a file and choose "No", the next time you select a file to overwrite, the cursor was memorized and is still pointing at "No". You should reset it.

I know, I just forgot to do it.

Quotereturn if @index == i; @index = i

lol! I wrote that code just to get it out of the way at that moment and never bothered to correct it.

Quote4. Interesting, you used the load bar for the load state of the files. I used the load bar when actually loading the game data. I only display "Loading file..." when a file is being loaded to display. Of course, it doesn't have to be a complete clone so I think you should leave it that way.

Well, I know. But since it's a substitute for load-on-demand and it's noticable, I had to make a loading bar there. And the loading bar when actually loading a save, I know how to make a bar for normal Marshal files, but DREAM has DREAM.data(file) to directly get the data, is there a way I can make a loading bar which is not a fake? (I'd never want to put a fake bar, so I decided to just make 'Loading...' without the bar).

Quoteif @list_win.active
      update_list
    elsif @confirm_win.active
      update_confirm
    end

Point to be noted. But I think the scene messes up if I don't use 'return', I guess the 'elsif' takes care of that. ty :)

Quote@continue_enabled = (0...CPSL::Save_number).any? {|i|
          FileTest.exist?(CPSL.make_savename(i))
      }

I was in a hurry to get the Scene_Title thing out of the way, I didn't realize >.<

Quote7. There's a "little glitch" in the title menu. Initially the "Continue" option is not enabled and is being enabled after the loading was done. You should add instructions how to edit the title script instead of making your script do the work. I did the same in DREAM for Savefiles.

I wanted to mention about it, but it makes the script 100% plug-and-play. I'll remove that when this becomes beta (when this becomes worthy of having to change a script, lol!)

Quote8. Load-on-demand will become very useful if somebody can't resist to use more 50 fileslots... >.<

lol, yeah. I tested it with 100 save slots and it takes a couple of seconds even without no savefiles. (but at least the loading bar looks nice... ahem...)

Quote9. I put up 2 screenshots.

Hey! Where's the screenshot of the confirmation window >:(
j/k
Very much appreciated :D
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

March 19, 2008, 12:53:46 pm #6 Last Edit: March 19, 2008, 12:54:32 pm by Blizzard
4. Not without hacking DREAM. I use a modified version of DREAM for CP of course. The only thing that COULD work is if you hack DREAM and extract the method "dream4_decryption" AND mess around with it.

7. Some scripts just can't work plug-n-play. ._.

8. 2.5 seconds with 100 empty files.

9. Add it yourself. :P
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

4. - I guess I have to accept it. (and can and will you sue me if I DID hack DREAM, modify the method and upload the new files? Now that I think about it, your license allows derivative works with proper attribution...)

7. - I just made it work :P (by compromizing effeciency and a nagging piece of concience that tells me I coded a lame excuse for "Some scripts just can't work plug-n-play", lol)

8. - Speaking of which I've been uising Time.now a lot lately.

9. - lol, OK :P

Spoiler: ShowHide
I've actually made a functional and effecient ring command window and I'm VERY happy with the result, I'll be uploading an encrypted demo soon. I'll PM you the other scripts I made, just for kicks XD (and they're plug-and-play withoug problems).
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Sally

this seems cool,
what dose "Customizable savefile extension" mean?

Fantasist

thanks :) It's a complete script I did after a long time.

Customizable Savefile extension means your savefiles can have any extension you want other than .rxdata, just like Chaos Project saves have the extension .cps (Chaos Project Save).

Oh! And if you're using DREAM, don't forget to change it accordingly! (got to add this line in v1.3)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Quote from: Fantasist on March 19, 2008, 01:12:56 pm
4. - I guess I have to accept it. (and can and will you sue me if I DID hack DREAM, modify the method and upload the new files? Now that I think about it, your license allows derivative works with proper attribution...)


Hack DREAM and see what happens. There is a license redefinition in there. WcW found it already. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

I'm not even a beginner at hacking XD
I normally use notepad to open files when I want to look at them. I DID try a hex editor once, but everything was Greek and Latin. I don't think I'll go that far, I can pass without the loading bar. For now, I just used the bar, but it only displays 0 and 100%. 0% when starting to load the data, and 100% when done. It's not really fake, but it'll look better without the bar and only words imo. I'll do that later.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

You just need to figure out how it gets decoded, nothing more. It's not even REAL hacking. ::)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

March 26, 2008, 07:10:14 am #13 Last Edit: April 03, 2008, 11:00:42 pm by Fantasist
Will give it a shot then, ty :)

EDIT: v1.4 is up.

New features:
- A little remodel (gave more space for the names of actors)
- Chapter System and location names added
- Other little things I can't remember right now
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Sase

Nice, I will use ^^;

I searched the script but it's too messy for me. How to change the "overwrite"-choices default by No, because it may prevent some mishabs if you accidently press Enter.

Fantasist

April 06, 2008, 02:10:49 pm #15 Last Edit: February 24, 2011, 05:54:38 am by Fantasist
Hm, good point. For the time being, find Scene_File and scroll down to 'def update_list'. Somewhere below that line, you'll find these lines:

def update_list
    @list_win.update
    if Input.trigger?(Input::C)
      if $scene.is_a?(Scene_Save) && CPSL::Confirm_Overwrite &&
        FileTest.exist?(make_filename(@list_win.index))
        @list_win.active = false
        @confirm_win.index = 0
        @confirm_win.visible = @confirm_win.active = true
        .
        .
        .


Now, change the 0 in "@confirm_win.index = 0" to 1 and you're done.



EDIT:

Sorry for the necro, but I've updated the script to 1.4.2 to address the following:

Quote from: Sase on April 06, 2008, 03:01:47 am
Nice, I will use ^^;

I searched the script but it's too messy for me. How to change the "overwrite"-choices default by No, because it may prevent some mishabs if you accidently press Enter.


A post from this topic:
Quote from: Fantasist on February 24, 2011, 04:24:08 am
Hi :)
Why didn't you post in that topic? Making a new topic is pointless, I think, because the original topic is there so that you can ask stuff, you know?  :roll:

QuoteThis isn't a huge modification I think, I just want to draw Icons on the left side of the filenames; if the file has a game saved, it will show an icon, if there isn't, it will show another.

It can definitely be done, but I stopped coding a while ago...
Oh what the hell. This has been due an update for so long. I'll be on it, it shouldn't take too long.
EDIT: Sorry, but I'm not going to do it. I'll have to increase the width of the file list window for both the text and the icon to fit in, and that means I'll have to adjust the layout of the information window (since it's width is reduced). I don;t think it's worth it, I'm sorry :(
Instead, I'll add an option to change the text colour depending on whether the file exists or not. I hope that'll suffice :)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews