Help - Search - Members - Calendar
Full Version: Law's Custom Equipment Screen
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS-Submissions
Pages: 1, 2, 3
The Law G14
Law's Custom Equipment Screen

Version 1.1
By The Law G14
8/10/09 ~ 05/07/10


Introduction
Wow, the day has finally come. My first script that I'm releasing to RRR! It took quite some time to make plus the fact that I planned on making it exclusive to my game, but I decided that it would be alright to release it to the public. This script is a Custom Equipment Screen that I hope you guys find useful for your game. Many more of my scripts will come in the future.


Features
Color system, just like in VX, so that if the new stat is stronger than the old stat, it turns green, and if it’s weaker, it turns red.
The face graphic of the party member is now shown, or any picture that you would like to use to represent the character.
A new user friendly layout of the equipment screen.


Script

Click to view attachment

Compatibility
There may be some compatibility issues with some CMS’s or scripts that mess with the equipment screen. If you encounter any problems, I would be more than happy to help you solve your problem.

Screenshots
[Show/Hide] Screenshots






Instructions
There is something very important that you must do to make the script work and that revolves around displaying the face graphics. To do this, you have to import your face into the pictures section of your recourse manager and name the face graphic '1' for the first actor in the actors tab of your databse, '2' for second, '3' for the third and so on.

FAQ
Question 1: How do you make it so that you don’t have to name your actor with the actual name of the character? In my game, the character doesn’t have a set name.

Answer: On line 29, change this:
CODE
bitmap = RPG::Cache.picture(actor.name)


to this:

CODE
bitmap = RPG::Cache.picture(actor.id.to_s)


All you have to do is name the face graphic '1' if it's the first person in the database, '2' if it's the second, and so on.


Terms and Conditions
All I ask for is proper credit where it is due.

Also, if you plan on hosting this script in other sites PLEASE TELL ME.

Special Thanks
Special Thanks to Charlie Lee for helping me with the color system.
Special Thanks to Ty for helping me learn RGSS.
Edited by Night_Runner

SHistory
Version 1.0: Click to view attachment
Holder
Wonderful Law, brilliant to see your first script here.

From looking at the 'presentation' of the code (As the code itself means nothing to me tongue.gif ) it's like your a natural, parts have been commented on, indented parts.

Keep 'em coming smile.gif

There's some ideas that can be done, I noticed that VX scripts were simply duplicates of XP ones. Since it's easier to script in VX there's now possibly more VX ones, why not check through the RGSS2 section for ideas for more XP scripts wink.gif
The Law G14
Wow, thank you Dark Holder! I've already started working on my next scripts which inlcudes more custom menu scripts and a quicksave script. Oh, and thanks for that idea you gave me, I'll be sure to look through the RGSS2 forum smile.gif
Xach-Crisis
Congrats Law this looks decent and very well made, i cant belive this is your first script very nice work and you have my support all the way lol, i wish you luck on your next upload and i hope more people comment on this beacuse it looks very nice and i wouldnt be suprised if it was used in a game once
The Law G14
Haha, thanks Sicon. Actually, I plan on using it in my game. And yeah, I hope more people can give me some comments because I was wondering what I could add to the script to make it better.
Xach-Crisis
By your game you do mean Luster right? lol, im just wondering, i might use it in my side project aswell and add you in the credits, haha love it awesome work once again Law,
The Law G14
Thanks Sicon smile.gif And yeah, I do mean Luster. I hope you find this script useful for your game smile.gif
Tenshino
Thanks man, good stuff smile.gif
The Law G14
Glad you like it smile.gif If you find any bugs, errors, or just have a question, don't hesitate to tell me smile.gif Also, I'm thinking about adding another feature in which you have the ability to either equip your equipment freely or have the option to optimize your equipment, so that the game gives you the best choice of equipment to have.
Icalasari
This script looks genius. I'll have to use it in my game

>.> I wish I could script, period. At this rate, half of the credits will be dedicated to script makers XD
The Law G14
Thankyou very much smile.gif Your comments mean alot to me. And like I said before, if you find any bugs, errors, ect. report away smile.gif
Icalasari
Found a bug. When drawing the face graphic, it takes away the right most column of pixels in the picture

I found this out when the right line from the frame I made for the face graphic vanished. I even tried adding another row, but it also gets rid of that one

Essentially, instead of drawing, say, a 50x50 square, it will draw a 49x50 square. Even if one makes a 51x50 square, it will still draw a 49x50 square

EDIT: BIG bug

This script doesn't work with the ability to name the actors. For example, in my game, you can name the main character. As such, it causes a few issues, such as crashing the name if I so much as look at the main character's equip screen unless I make sure not to change the name
The Law G14
QUOTE
Found a bug. When drawing the face graphic, it takes away the right most column of pixels in the picture

I found this out when the right line from the frame I made for the face graphic vanished. I even tried adding another row, but it also gets rid of that one

Essentially, instead of drawing, say, a 50x50 square, it will draw a 49x50 square. Even if one makes a 51x50 square, it will still draw a 49x50 square


So what you mean is that you found out the maximum space for a picture is a 49x50 square? Thats a problem, I'm gonna try to work that out.

QUOTE
This script doesn't work with the ability to name the actors. For example, in my game, you can name the main character. As such, it causes a few issues, such as crashing the name if I so much as look at the main character's equip screen unless I make sure not to change the name


Actually, what the script does, is find the party member's name in the database. So, what name did you give your main charcter in the database? I'm nnot sure if finding this out will help, but its a try.


EDIT: For the 49x50 square thing, I'm thinking its because in order to initialize the window, I have to take off 32 pixels from the width and height of the actual window which holds the face graphic. This is probably not allowing the picture to get much bigger then 49x50 pixels.
Icalasari
QUOTE (The Law G14 @ Aug 14 2009, 04:27 AM) *
So what you mean is that you found out the maximum space for a picture is a 49x50 square? Thats a problem, I'm gonna try to work that out.


Yeah, that's essentially the issue. I'm not sure of the exact size it chooses, but it does make the width one less than the height

QUOTE
Actually, what the script does, is find the party member's name in the database. So, what name did you give your main charcter in the database? I'm nnot sure if finding this out will help, but its a try.


I did try that. It still crashes because the hero's name changes. Maybe having it match up pictures with the same name as the actor ID (e.g. 001) instead of the name would help?
The Law G14
Alright! I got it to work! On line 29, change this:

CODE
bitmap = RPG::Cache.picture(actor.name)


to this:

CODE
bitmap = RPG::Cache.picture(actor.id.to_s)


All you have to do is name the face graphic '1' if it's the first person in the database, '2' if it's the second, and so on. Hope that helped smile.gif
Icalasari
QUOTE (The Law G14 @ Aug 14 2009, 08:39 AM) *
Alright! I got it to work! On line 29, change this:

CODE
bitmap = RPG::Cache.picture(actor.name)


to this:

CODE
bitmap = RPG::Cache.picture(actor.id.to_s)


All you have to do is name the face graphic '1' if it's the first person in the database, '2' if it's the second, and so on. Hope that helped smile.gif


Ah, that fixed the issue with name changing perfectly! Works like a charm now!

EDIT: The pixel being cut off glitch is worse than I thought. I tried doing a quick fix by reducing the face graphic from 102x102 to 101x102, and it still cuts off pixels. I found out the exact maximum width it allows. 99. Yet it seems to not limit the height of the face graphic, which leads to some confusion =/
Redd
Will definitely use this (unless I find a better one)
Nice job wink.gif
The Law G14
QUOTE
The pixel being cut off glitch is worse than I thought. I tried doing a quick fix by reducing the face graphic from 102x102 to 101x102, and it still cuts off pixels. I found out the exact maximum width it allows. 99. Yet it seems to not limit the height of the face graphic, which leads to some confusion =/


Do you mind me having the face graphic or picture you're using. Let me try to see what I can do with it and the code.

QUOTE
Will definitely use this (unless I find a better one)
Nice job


Thanks smile.gif Glad you like it.
Icalasari
QUOTE (The Law G14 @ Aug 14 2009, 02:23 PM) *
QUOTE
The pixel being cut off glitch is worse than I thought. I tried doing a quick fix by reducing the face graphic from 102x102 to 101x102, and it still cuts off pixels. I found out the exact maximum width it allows. 99. Yet it seems to not limit the height of the face graphic, which leads to some confusion =/


Do you mind me having the face graphic or picture you're using. Let me try to see what I can do with it and the code.




I know it sucks. It was a placeholder graphic until I had made something better. I had to shrink it down before it fit in the programs (seemingly random) 99+x99 limit
The Law G14
I tested it out and I don't think I found anything wrong. I also checked how big it was and it was 102x102 pixels. No pixels were cut off, also, I have a screenshot of what I see:



Unless I'm misunerstanding what you're saying, everything works fine for me.
Icalasari
QUOTE (The Law G14 @ Aug 15 2009, 09:16 AM) *
I tested it out and I don't think I found anything wrong. I also checked how big it was and it was 102x102 pixels. No pixels were cut off, also, I have a screenshot of what I see:



Unless I'm misunerstanding what you're saying, everything works fine for me.


That is odd. The black line on the right side of the box is cut off in mine. Must be the windowskin I have then =/
The Law G14
Actually, I have a good feeling its the windowskin, because I'm making a game and I'm using this script in it, and some of the picture gets cut off if I move it to far to the right. In this game I also have a custom windowskin. So it might just be that, though I think I've found a way around that. On line 30 of the script, there should be something that looks like this:

CODE
self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))


Change the bitmap.width and bitmap.height to the actual properties of the picture. In your case, the bitamp.width should be changed to 102 along with the bitmap.height.
The Law G14
A small bump and update to say that I added Icalasari's problem regarding saving the name of the face graphic as the actor id to the FAQ so if anyone runs into that problem, they can just look at the FAQ smile.gif
The Law G14
Bump.

I switched the script over to a notepad file since that makes it easier for me. Also, comments, suggestions and thoughts are all welcome smile.gif
Icalasari
Currently a theoretical question, as I don't know of any scripts that add a Ring slot that I can access (>.> Guillaume777's Multi-Slot Equipment Script seems to be down all over or require me to join a forum that I don't want to join)

What will happen if one uses a script that adds more equipable slots? Will the script allow the person to scroll down?

EDIT: Finally found one script, and saw that it works well... Except for the fact that it wipes out the left window that shows items that you can equip

It seems to be this section of the script that causes problems. Any way to fix your script or this part of Guillaume's script so that the windows work correctly? If not, then alright. I'll just have to find another multi-slot script XD

CODE
#==============================================================================
# Multi-slot equipment script
#------------------------------------------------------------------------------
# Section 3:  Windows
#------------------------------------------------------------------------------
# Guillaume777
# 6.2.1
# 2006/02/14
#==============================================================================

#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================
class Scene_Equip
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias g7_ms_scene_equip_main main
  def main
    @additional_initialize_done = false
    g7_ms_scene_equip_main
    for i in 5...@item_windows.size
      @item_windows[i].dispose unless @item_windows[i].nil?
    end
  end
  #--------------------------------------------------------------------------
  # * Initialize the extra right windows
  #--------------------------------------------------------------------------
  def g7_ms_scene_equip_additional_initialize
  unless @additional_initialize_done
    @item_windows = []
    @item_windows[0] = @item_window1  # Weapon
    @item_windows[1] = @item_window2  # Shield
    @item_windows[2] = @item_window3  # Helmet
    @item_windows[3] = @item_window4  # Armor
    @item_windows[4] = @item_window5  # Accessory
    nb_old_windows = @item_windows.size
    for i in nb_old_windows...@actor.armor_slots.max+1
      # Add the remaining windows for extra slots
      @item_windows.push(Window_EquipItem.new(@actor, i) )
      @item_windows[i].help_window = @help_window
    end
    @item_windows.push(Window_EquipOffHand.new(@actor, 0))
    @item_windows[-1].help_window = @help_window
    # If windows_stretch is true, stretch window
    if G7_MS_MOD::WINDOWS_STRETCH
      h = (@actor.weapon_slots.size + @actor.armor_slots.size + 1) * 32
      h2 = (G7_MS_MOD::MAX_SHOW_SLOTS+1) * 32
      h = [h, h2].min
      @right_window.height = h
      if @right_window.index > @actor.weapon_slots.size + @actor.armor_slots.size - 1
        @right_window.index = @actor.weapon_slots.size + @actor.armor_slots.size - 1
      end
      if @left_window.y + @left_window.height == 256
        @left_window.height = @right_window.height
      elsif G7_MS_MOD::HELP_AT_BOTTOM == true and @left_window.height == 416 then
        # Make left window shorter
        @left_window.height -= 64
      end
      y_pos = (@right_window.y + @right_window.height)
      y_space = 480 - y_pos
      # If help at bottom, reduce bottom item window size
      if G7_MS_MOD::HELP_AT_BOTTOM == true then y_space -= 64  end
      for item_window in @item_windows
        next if item_window.nil?
        item_window.y = y_pos
        item_window.height = y_space
      end
    end
    @additional_initialize_done = true
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh and make visible the correct right window
  #--------------------------------------------------------------------------
  alias g7_ms_scene_equip_refresh refresh
  def refresh
    # This part is used to refresh the equipped item at the right window
    g7_ms_scene_equip_additional_initialize
    @actor.translucent_texts.fill(false)
    @actor.equip_type_force = index_to_equip_part(@right_window.index)
    @right_window.item_fix_on
    @right_window.scroll_fix_on
    save = @right_window.index
    @right_window.index = index_to_equip_kind(@right_window.index)
    if @right_window.index == 0 and @actor.ignore_offhand? != true then
      if @actor.nb_offhand_required(save) > 0 then
        @right_window.index = @item_windows.size-1
      end
    end
    @actor.equip_from_menu = true
    # Ensure current equipment will get properly stored...
    @actor.equip_mode = 'STORE'
    # ...and re-equiped
    @item_window = @item_windows[@right_window.index]
    @item_windows[@right_window.index].visible = true
    for i in 0...@item_windows.size
      if i != @right_window.index then
        @item_windows[i].visible = false
      end
    end
    # Equip and remove item
    g7_ms_scene_equip_refresh
    @actor.equip_from_menu = false                          
    @actor.equip_mode = nil
    @actor.equip_type_force = nil
    @right_window.index = save
    @right_window.scroll_fix_off
    @right_window.item_fix_off
    if @item_window.index != @old_index
      @right_window.refresh
    end
    @old_index = @item_window.index
  end
  #--------------------------------------------------------------------------
  # * Convert the right_window.index to equip_type
  #--------------------------------------------------------------------------
  alias g7_ms_scene_equip_update_item update_item
  def update_item
    # This changes the @right_window.index to the correct value to take
    # account of extra slots
    @actor.equip_type_force = index_to_equip_part(@right_window.index)
    @right_window.item_fix_on
    @right_window.scroll_fix_on
    save = @right_window.index
    @right_window.index = index_to_equip_kind(@right_window.index)
    @actor.equip_from_menu = true
    # Equip item
    g7_ms_scene_equip_update_item
    @actor.equip_from_menu = false
    @actor.equip_type_force = nil
    # If not in item_window screen
    if @item_window.index == -1
      # If shield-weapon can modify each other
      if @actor.shield_hand_wield == true and
        if @right_window.index == @actor.shield_hand_slot then
          @item_windows[0].refresh
          @item_windows[-1].refresh
        elsif @right_window.index == 0
          # Refresh the shield slot
          @item_windows[@actor.shield_hand_slot].refresh
        end
      end
      if @right_window.index == 0 and @actor.ignore_offhand? != true then
        if @item_window == @item_windows[-1] then
          @item_windows[0].refresh
        elsif @item_window == @item_windows[0] then
          @item_windows[-1].refresh
        end
      end
    end
    @right_window.index = save
    @right_window.scroll_fix_off
    @right_window.item_fix_off
    @actor.equip_type_force = nil
  end
  #--------------------------------------------------------------------------
  # * Convert index to equip part
  #     index : slot number
  #--------------------------------------------------------------------------
  def index_to_equip_part(index)
    # Return index of slot in the
    # array [0, @actor.armor_slots, actor.weapon_slots]
    # If Armor
    if index >= @actor.weapon_slots.size
      return index - (@actor.weapon_slots.size - 1)
    # If extra weapon
    elsif index >= 1
      # Make it last
      return index + [@actor.armor_slots.size, 4].max
    else
      return 0
    end
end
  #--------------------------------------------------------------------------
  # Convert index to equip kind
  #     index : slot number
  #--------------------------------------------------------------------------
  def index_to_equip_kind(index)
    # Return index of slot in either actor.weapon_slots or actor.armor_slots
    i = index_to_equip_part(index)
    # If armor
    if index >= @actor.weapon_slots.size
      set = @actor.armor_slots[i-1]
    # If weapon  
    else
      i = i == 0 ? 0 : i - [@actor.armor_slots.size, 4].max
      set = @actor.weapon_slots[i]
    end
    return set != nil ? set : 0
  end
  #--------------------------------------------------------------------------
  # * End of CLASS:  Scene Equip
  #--------------------------------------------------------------------------  
end



#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
#  This window displays items the actor is currently equipped with on the
#  equipment screen.
#==============================================================================
class Window_EquipRight < Window_Selectable
  #--------------------------------------------------------------------------
  # * Item Fix On
  #--------------------------------------------------------------------------
  def item_fix_on
    # Fix window
    @fixed_item = @data[self.index]
    @fixed = true
  end
  #--------------------------------------------------------------------------
  # * Item Fix Off
  #--------------------------------------------------------------------------
  def item_fix_off
    #stop fixing window
    @fixed_item = nil
    @fixed = false
  end
  #--------------------------------------------------------------------------
  # * Don't scroll right window if you press L or R
  #--------------------------------------------------------------------------
  def update
    if Input.repeat?(Input::R) or  Input.repeat?(Input::L) then
      return
    else
      super
    end
  end
  #--------------------------------------------------------------------------
  # Draws equipped items with support of translucent and cursed items
  #     item        : item
  #     x           : draw spot x-coordinate
  #     y           : draw spot y-coordinate
  #     translucent : draw translucent
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, translucent = false)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    if item.cursed
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
      self.contents.font.color = G7_MS_MOD::CURSED_COLOR
    elsif translucent
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 128)
      self.contents.font.color = disabled_color
    else
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
      self.contents.font.color = normal_color
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name)
  end
  #--------------------------------------------------------------------------
  # * Prevent needless update of item quantities in item window
  #--------------------------------------------------------------------------
  alias g7_ms_window_equipright_item item
  def item
    # This ensures that the number of items doesn't get updated if you move
    # cursor in item window
    return @fixed_item if @fixed
    return g7_ms_window_equipright_item
  end
  #--------------------------------------------------------------------------
  # * Change the height of right windows to fit the slots
  #     actor : actor
  #--------------------------------------------------------------------------
  alias g7_ms_window_equipright_initialize initialize
  def initialize(actor)
    # Initialize with a different height
    g7_ms_window_equipright_initialize(actor)
    # Total height of right window
    h = (actor.weapon_slots.size + actor.armor_slots.size) * 32
    # Change the height                                                        
    self.contents = Bitmap.new(width - 32, h)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Shows the slot names and the name of the items you have equipped
  #--------------------------------------------------------------------------
  def refresh
    # Replaced method to show caption of all items and slot
    self.contents.clear
    @data = []
    # Begin Multi-slot equipment script Edit
    self.contents.font.name = G7_MS_MOD::FONT_NAME
    for i in 0...@actor.weapon_slots.size
      # Push the name(s) of the weapon(s)
      @data.push($data_weapons[@actor.weapon_ids[i]])
    end
    for i in 0...@actor.armor_slots.size
      # Push the names of the armors
      @data.push($data_armors[@actor.armor_ids[i]])
    end
    @caption = []
    for i in 0...@actor.weapon_slots.size
      # Push the name(s) of the weapon slots
      @caption.push(@actor.weapon_slot_names[i])
    end
    for i in 0...@actor.armor_slots.size
      # Push the names of the armor slots
      @caption.push(@actor.armor_slot_names[@actor.armor_slots[i]-1])
    end
    @item_max = @data.size
    if @actor.translucent_texts == nil then @actor.translucent_texts = Array.new end
    for i in 0...@data.size
      if @caption[i] != nil
        self.contents.font.color = system_color
        # Draw the name of the slots
        self.contents.draw_text(4, 32 * i, 92, 32, @caption[i])
      end
      # Draw the name of the equipment
      draw_item_name(@data[i], 92, 32 * i, @actor.translucent_texts[i])
    end
    # Support for other script
    if defined? xrxs_additional_refresh
      xrxs_additional_refresh
    end
  # End Multi-slot equipment script Edit
  end
  #--------------------------------------------------------------------------
  # * End of CLASS:  Window EquipRight
  #--------------------------------------------------------------------------
end



#============================================================================
# ** Window_EquipOffHand
#----------------------------------------------------------------------------
#  A new window class that displays an equipped item in the actor's off hand.
#============================================================================
class Window_EquipOffHand < Window_EquipItem
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    weapon_set = $data_classes[@actor.class_id].weapon_set
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
        weapon = $data_weapons[i]
        if weapon.needs_offhand == false
          if G7_MS_MOD::TWOHANDED_IN_OFFHAND != false and weapon.nb_hands <= 1 then
            @data.push(weapon)
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.font.name = G7_MS_MOD::FONT_NAME
    #self.contents.font.size = 24
    for i in 0...@item_max-1
      draw_item(i)
    end
    if G7_MS_MOD::SHOW_REMOVE then
       i = @item_max -1
       x = 4 + i % @column_max * (288 + 32)
       y = i / @column_max * 32
       self.contents.draw_text(x+4, y, 100, 32, '[Remove]')
    end
  end
  #--------------------------------------------------------------------------
  # * End of CLASS:  Window EquipOffHand
  #--------------------------------------------------------------------------
end



#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window class contains cursor movement and scroll functions.
#==============================================================================
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * Scroll Fix On
  #--------------------------------------------------------------------------
  def scroll_fix_on
    @scroll_fixed = true
  end
  #--------------------------------------------------------------------------
  # * Scroll Fix Off
  #--------------------------------------------------------------------------  
  def scroll_fix_off
    @scroll_fixed = false
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  alias g7_ms_update_cursor_rect update_cursor_rect
  def update_cursor_rect
    # This prevents the windows from scrolling if scroll is fixed
    # This was added to ensure that if there are few slots, the right equip
    # screen doesn't scroll needlessly
    return if @scroll_fixed
    g7_ms_update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # * End of CLASS:  Window Selectable
  #--------------------------------------------------------------------------  
end



#==============================================================================
# *** Global IF condition
#     Shows a new status window if Status_window_arrange is true
#==============================================================================
if G7_MS_MOD::STATUS_WINDOW_ARRANGE
  #==========================================================================
==
  # ** Window_Status
  #----------------------------------------------------------------------------
  #  This window displays full status specs on the status screen.
  #==========================================================================
==
  class Window_Status < Window_Base
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      # Begin Multi-slot equipment script Edit
      self.contents.font.name = G7_MS_MOD::FONT_NAME
      # End Multi-slot equipment script Edit
      self.contents.clear
      draw_actor_graphic(@actor, 40, 112)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4 + 144, 0)
      draw_actor_level(@actor, 96, 32)
      draw_actor_state(@actor, 96, 64)
      draw_actor_hp(@actor, 96, 112, 172)
      draw_actor_sp(@actor, 96, 144, 172)
      draw_actor_parameter(@actor, 96, 192, 0)
      draw_actor_parameter(@actor, 96, 224, 1)
      draw_actor_parameter(@actor, 96, 256, 2)
      draw_actor_parameter(@actor, 96, 304, 3)
      draw_actor_parameter(@actor, 96, 336, 4)
      draw_actor_parameter(@actor, 96, 368, 5)
      draw_actor_parameter(@actor, 96, 400, 6)
      # Begin Multi-slot equipment script Edit
      if G7_MS_MOD::EVADE
        # Activate if you have a draw_actor_paramter method that draws evade
        draw_actor_parameter(@actor, 96, 432, 7)
      end
      self.contents.font.color = system_color
      self.contents.draw_text(320, 16, 80, 32, 'EXP')
      self.contents.draw_text(320, 48, 80, 32, 'NEXT')
      self.contents.font.color = normal_color
      self.contents.draw_text(320 + 80, 16, 84, 32, @actor.exp_s, 2)
      self.contents.draw_text(320 + 80, 48, 84, 32, @actor.next_rest_exp_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(320, 80, 96, 32, 'Equipment')
      y = 108
      for i in 0...@actor.weapon_slots.size
        draw_item_name($data_weapons[@actor.weapon_ids[i]], 320 + 16, y)
        y += G7_MS_MOD::STATUS_WINDOW_SPACING
      end
      for i in 0...@actor.armor_slots.size
        draw_item_name($data_armors[@actor.armor_ids[i]], 320 + 16, y)
        y += G7_MS_MOD::STATUS_WINDOW_SPACING
      end
      # End Multi-slot equipment script Edit      
    end
    #------------------------------------------------------------------------
    # * End of CLASS:  Window Status
    #------------------------------------------------------------------------
  end
  #--------------------------------------------------------------------------
  # * End of Global IF condition
  #--------------------------------------------------------------------------
end


The Law G14
Hm, I'll try to see what I can do. From what you've said so far, it's proabably the coordinates of the windows that are causing problems. Also, can I see a screenshot of the script with mine?
Icalasari


...>.> I had fun saving the file as ErrorERRORErRoReRrOreRROR
The Law G14
Add this piece of code to your script:

CODE
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_EquipItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor      : actor
  #     equip_type : equip region (0-3)
  #--------------------------------------------------------------------------
  def initialize(actor, equip_type)
    super(0, 64, 224, 415)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
          @data.push($data_weapons[i])
        end
      end
    end
    # Add equippable armor
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 160, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 163, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
Icalasari
QUOTE (The Law G14 @ Aug 30 2009, 04:48 PM) *
Add this piece of code to your script:

CODE
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_EquipItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor      : actor
  #     equip_type : equip region (0-3)
  #--------------------------------------------------------------------------
  def initialize(actor, equip_type)
    super(0, 64, 224, 415)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
          @data.push($data_weapons[i])
        end
      end
    end
    # Add equippable armor
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 160, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 163, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end


=/ Not working at all. It still looks the same

EDIT: Maybe I have it in there wrong. I put it at the end of first your script, then tried it at the end of the multi slot menu screen script. Should it stand alone instead?
The Law G14
Fisrt, try putting the code I posted after line 197 of the multi slot script. If that doesn't work, try that idea you thought of of making it stand alone.
Icalasari
The Law G14
Hey I'm getting an error on line 597, saying no method error for 'Rg'. Do you get the same error?

EDIT: Nevermind, the next part you added didn't cause any errors, and also, the left part of the screen isn't gone for me.
Icalasari
QUOTE (The Law G14 @ Aug 31 2009, 02:05 PM) *
Hey I'm getting an error on line 597, saying no method error for 'Rg'. Do you get the same error?

EDIT: Nevermind, the next part you added didn't cause any errors, and also, the left part of the screen isn't gone for me.


=/ Then why isn't it working for me?

Must be something screwing with something...
The Law G14
Make sure you put the multi slot script UNDER the my custom equipment script. That might just be the problem.
Icalasari
No, it still didn't work

Should I send you a copy of my game so you can see what it is? Because this is driving me nuts XD
The Law G14
Yeah, I'm cool with that, just send me the download link smile.gif
carnie_natas
Much Props!
The Law G14
Thanks Carnie biggrin.gif If you find any bugs, please report smile.gif
carnie_natas
Will do,none so far tho!
Soul_Torn


I get this error, whether i am using a clean game, or a
Enu SBS Tanketai XP scripted game....

I dont' know whats causing it...

I have a picture title Tir in my photo place...And my Main character is named Tir. >.>
The Law G14
Well first of all, what line are you getting the error from?

Second of all, are you sure you put the picture of your character in the pictures section of your recource manager?

EDIT: Just remebered how I changed the script around, name your first actor '1' and you should be set.
Soul_Torn
QUOTE (The Law G14 @ Sep 26 2009, 07:02 AM) *
Well first of all, what line are you getting the error from?

Second of all, are you sure you put the picture of your character in the pictures section of your recource manager?

EDIT: Just remebered how I changed the script around, name your first actor '1' and you should be set.


did all that still getting an error for line 139?
The Law G14
No like, name your first actor, whcih is the first actor in the actors tab fo the database, name him '1', then the second would be '2' and so on. Also, are you getting an error in my script or the Enu script.
Soul_Torn
QUOTE (The Law G14 @ Sep 26 2009, 12:02 PM) *
No like, name your first actor, whcih is the first actor in the actors tab fo the database, name him '1', then the second would be '2' and so on. Also, are you getting an error in my script or the Enu script.




This is the error I am getting.

And do i actually name my character in the actors tab "1" ?
like as his name... or just his image. o.o
The Law G14
No you name the image as 1 if it's the first actor in the actors tab of the database, 2 if it's the second, and so on. Also, line 139 of my script is just 'end'. Are you sure that's the line?
Soul_Torn
QUOTE (The Law G14 @ Sep 26 2009, 12:14 PM) *
No you name the image as 1 if it's the first actor in the actors tab of the database, 2 if it's the second, and so on. Also, line 139 of my script is just 'end'. Are you sure that's the line?


I followed the instructions to the letter... And I think i might have missed something. And I have no idea what the error is. >.>;;
Thats just the message that pops up. .o.o
The Law G14
Alright, open up a new rpg maker xp project, download my script again, and put it in the new project. Get any random face graphic and name it '1' and see if there's still an error when you try to open the equipment screen.
Soul_Torn
QUOTE (The Law G14 @ Sep 26 2009, 12:20 PM) *
Alright, open up a new rpg maker xp project, download my script again, and put it in the new project. Get any random face graphic and name it '1' and see if there's still an error when you try to open the equipment screen.


yeah same error.
Its odd cause your custom menu works fine... just not the equipment screen or the battle icons... I get errors... >.>
The Law G14
Alright two things:

First of all, can you post what's on the whole line of where you're getting the error.

Also, in that line, there should be a '-@', take out the minus sign.

Just found the error. Somewhere here:

CODE
@new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int


You put a minus sign before the @, make sure to delete that.
Soul_Torn
QUOTE (The Law G14 @ Sep 26 2009, 12:26 PM) *
Alright two things:

First of all, can you post what's on the whole line of where you're getting the error.

Also, in that line, there should be a '-@', take out the minus sign.

Just found the error. Somewhere here:

CODE
@new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int


You put a minus sign before the @, make sure to delete that.


here is my script section:

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.