Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: dark-archangel on March 18, 2008, 12:01:39 pm

Title: [RESOLVED] can someone help me?
Post by: dark-archangel on March 18, 2008, 12:01:39 pm
I asked blizz and he told me to post.I asked Juan and he couldn't....do someone know how can I resize the save & load screen  and make them transparent?
Title: Re: can someone help me?
Post by: fugibo on March 18, 2008, 03:44:07 pm
What exactly do you mean?
Title: Re: can someone help me?
Post by: Sally on March 18, 2008, 04:33:05 pm
he wants to make the screens transparent and a diffrent size
Title: Re: can someone help me?
Post by: Juan on March 18, 2008, 04:52:32 pm
I know how to resize the window but not sure on transparenty. Pss when you asked I had to get ready for school.
Title: Re: can someone help me?
Post by: Nortos on March 18, 2008, 04:53:27 pm
sure but can you put an example done in paint or something of the size and transparent u mean the window is clear? Like no opacity
Title: Re: can someone help me?
Post by: Juan on March 18, 2008, 05:07:29 pm
Hes using my menu system. the opacity is set to 200. So I'm prety sure thats what he wants. I finally figured the opacity thing out.
Title: Re: can someone help me?
Post by: Nortos on March 18, 2008, 11:55:09 pm
u didn't already know about opacity? Or did u mean that you didn't know wat he meant by transparent
Title: Re: can someone help me?
Post by: Blizzard on March 19, 2008, 05:02:26 am
I suggest an opacity of 192 or 160, though.
Title: Re: can someone help me?
Post by: Juan on March 19, 2008, 07:08:10 am
I couldn't figure figure where to add opacity.
Title: Re: can someone help me?
Post by: dark-archangel on March 19, 2008, 07:23:48 am
This is the normal one
(http://img89.imageshack.us/img89/2784/normaldd9.png)

And I want something like this....

(http://img80.imageshack.us/img80/5584/resizedld5.png)

Oh and if someone could,can make the characters more appropiate..?
Title: Re: can someone help me?
Post by: Blizzard on March 19, 2008, 07:29:10 am
Window_FileStatus and I think Window_Help. Just check Scene_File.
Title: Re: can someone help me?
Post by: Fantasist on March 19, 2008, 02:48:05 pm
And what do you mean "make the characters more appropiate..?"
I think I'll give it a try. Do you want to use the title pic (or any pic, or no pic) as a background?

EDIT: nvm, I got what you said. See if this is what you want. Paste it in a new slot above Main.

Spoiler: ShowHide
#============================================================================
# ** Scene_File Visual Fix (requested by dark angel)
#------------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.0
# 20-Mar-2008
#============================================================================

Scene_File_BG = 'title' # 'title' for title pic, name of pic in Pictures folder for other pic, nil for nothing
Scene_File_Win_Opacity = 160  # opacity of windows
Center_Help_Text = true  # whether the help text is centered or not. Set to true or false.

#==============================================================================
# ** Window_SaveFile
#==============================================================================

class Window_SaveFile < Window_Base
 
  attr_reader   :filename, :selected
 
  def initialize(file_index, filename)
    super(64, 64 + file_index % 4 * 104, 512, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = Scene_File_Win_Opacity
    @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
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(4, 0, 472, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      (0...@characters.size).each {|i|
        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 = 260 - @characters.size * 32 + i * 48 - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      }
      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, 472, 32, time_string, 2)
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 40, 472, 32, time_string, 2)
    end
  end
 
end

#==============================================================================
# ** Window_Help
#==============================================================================

class Window_Help < Window_Base
 
  def initialize
    w = $scene.is_a?(Scene_File) ? 512 : 640
    x = $scene.is_a?(Scene_File) ? 64 : 0
    super(x, 0, w, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = Scene_File_Win_Opacity if $scene.is_a?(Scene_File)
  end
 
  alias fant_scene_file_win_size_fix_set_text set_text
  def set_text(txt, align=0)
    align = $scene.is_a?(Scene_File) && Center_Help_Text ? 1 : 0
    fant_scene_file_win_size_fix_set_text(txt, align)
  end
 
end

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

class Scene_File
 
  alias fant_scene_file_win_size_fix_main main
  def main
    @bg = Sprite.new
    @bg.bitmap = get_title
    fant_scene_file_win_size_fix_main
    @bg.dispose
  end
 
  def get_title
    if Scene_File_BG == 'title'
      RPG::Cache.title($data_system.title_name) rescue Bitmap.new(32, 32)
    else
      RPG::Cache.picture(Scene_File_BG) rescue Bitmap.new(32, 32)
    end
  end
 
end


Screenshot:
(http://img223.imageshack.us/img223/2513/clipboard01en3.th.jpg) (http://img223.imageshack.us/my.php?image=clipboard01en3.jpg)

The BG is optional. You can use the title pic, or any pic in the Pictures folder.
Title: Re: can someone help me?
Post by: dark-archangel on March 20, 2008, 07:23:16 am
nearly perfect.....
can more appropiate?
And I want to ask you....can you era that lines between the save files (on save & load)
In the main menu(new game,continue...) to have the back tile,and in game to have the back the respective of mine position(its a bit hard to explain)

Anyway thanks for what you done since now :)
Title: Re: can someone help me?
Post by: Fantasist on March 20, 2008, 07:44:16 am
Quotecan more appropiate?

You mean about the background picture?

Scene_File_BG = <picname>


<picname> can be:

1. name of the picture you want to use as background, placed in the Graphics/Pictures folder
2. 'title' - uses the title pic as background
3. nil - no background

QuoteAnd I want to ask you....can you era that lines between the save files (on save & load)
I don't quite get you. Lines between the File1, File2, ... windows? That's because of the windowskin. Try another winskin and see.

QuoteIn the main menu(new game,continue...) to have the back tile,and in game to have the back the respective of mine position(its a bit hard to explain)

I don't understand...
Title: Re: can someone help me?
Post by: dark-archangel on March 20, 2008, 10:32:49 am
in the load and save are some lines,between the files ....Can you make them to dissapear

(http://img507.imageshack.us/img507/905/normalna5.png)

I mean the caracters,the actors,when you save you have actors on save & load pag(like mine in file1)...
They're too far away one of each other,can you cutomize the distance between them?
(I don't think that it's becuz of windowskin,becuz I saw somewhere something like that withno lines between files)

And,in the main menu you have command(new,load game,exit) and you have a tile picture.
I want that when I load the game from the main menu to have the background the tile picture.But when I load or save in game,I want that it's background to be the map where I am....

Title: Re: can someone help me?
Post by: Fantasist on March 20, 2008, 10:53:28 am
Okay, I got it about the BG. But those lines are because of the windowskin borders. Since the windows are touching each other, the border lines get thicker in a manner of speaking. Try a windowskin without a border. I can make it so that the save/load scene uses different windowskin.

And the distance between the actors is customizable. I'll post the new script in a bit.
Title: Re: can someone help me?
Post by: dark-archangel on March 20, 2008, 11:07:05 am
but how can I put a window skin to load & save screen and other in game


Anyway Thanks :)
Title: Re: can someone help me?
Post by: Fantasist on March 20, 2008, 11:49:40 am
Quotebut how can I put a window skin to load & save screen and other in game

I took care of that.

Here's the new code. I've added windowskin selection, and two options to customize the position of the actor sprites.

#============================================================================
# ** Scene_File Visual Fix (requested by dark-archangel)
#------------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.1
# 20-Mar-2008
#============================================================================

Scene_File_Windowskin = 'normal'  # Windowskin for the windows in the save/load scene.
                                                    # 'normal' for using the regular skin, nil for no skin,
                                                    # and <name of the skin> for any windowskin you like
Scene_File_Win_Opacity = 160  # Opacity of windows.
Center_Help_Text = false  # Whether the help text is centered or not. Set to true or false.
Actor_Gap = 32  # Distance between character sprites. Default is 32.
Actor_Offset = 300  # Just try it out yourself, it's easier to know that way. Default is 300.

#==============================================================================
# ** Window_SaveFile
#==============================================================================

class Window_SaveFile < Window_Base
 
  attr_reader   :filename, :selected
 
  def initialize(file_index, filename)
    super(64, 64 + file_index % 4 * 104, 512, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = Scene_File_Win_Opacity
    unless Scene_File_Windowskin == 'normal'
      self.windowskin = RPG::Cache.windowskin(Scene_File_Windowskin) rescue nil
    end
    @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
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(4, 0, 472, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      (0...@characters.size).each {|i|
        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 = Actor_Offset - @characters.size * 32 + i * Actor_Gap - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      }
      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, 472, 32, time_string, 2)
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 40, 472, 32, time_string, 2)
    end
  end
 
end

#==============================================================================
# ** Window_Help
#==============================================================================

class Window_Help < Window_Base
 
  def initialize
    w = $scene.is_a?(Scene_File) ? 512 : 640
    x = $scene.is_a?(Scene_File) ? 64 : 0
    super(x, 0, w, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = Scene_File_Win_Opacity if $scene.is_a?(Scene_File)
    if $scene.is_a?(Scene_File) && Scene_File_Windowskin != 'normal'
      self.windowskin = RPG::Cache.windowskin(Scene_File_Windowskin) rescue nil
    end
  end
 
  alias fant_scene_file_win_size_fix_set_text set_text
  def set_text(txt, align=0)
    align = $scene.is_a?(Scene_File) && Center_Help_Text ? 1 : 0
    fant_scene_file_win_size_fix_set_text(txt, align)
  end
 
end

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

class Scene_File
 
  alias fant_scene_file_win_size_fix_main main
  def main
    if self.is_a?(Scene_Load) && $scene.title
      @bg = Sprite.new
      @bg.bitmap = RPG::Cache.title($data_system.title_name)
    else
      @bg = Spriteset_Map.new
    end
    fant_scene_file_win_size_fix_main
    @bg.dispose
  end
 
end

#==============================================================================
# ** Scene_Title_Load
#==============================================================================

class Scene_Load
 
  attr_accessor :title
 
  alias fant_scene_file_win_size_fix_sl_init initialize
  def initialize
    @title = false
    fant_scene_file_win_size_fix_sl_init
  end
 
end

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

class Scene_Title
 
  alias fant_scene_file_win_size_fix_st_cmdcont command_continue
  def command_continue
    fant_scene_file_win_size_fix_st_cmdcont
    $scene.title = true
  end
 
end
Title: Re: can someone help me?
Post by: Flermza on March 20, 2008, 11:55:04 am
Great work Fantasist! XD
Title: Re: can someone help me?
Post by: Fantasist on March 20, 2008, 12:51:45 pm
ty :) Hope dark-archangel likes it :)
Title: Re: can someone help me?
Post by: dark-archangel on March 23, 2008, 04:34:59 am
Thanks Fantasist :)