[SOLVED]Equip screen edits

Started by TrueCynder, July 15, 2012, 05:43:18 am

Previous topic - Next topic

TrueCynder

July 15, 2012, 05:43:18 am Last Edit: July 16, 2012, 07:13:28 am by TrueCynder
Hello every1 of you :S

I was wondering if one of you could help me with a script
for these "problems"

I want the colors of the values change
depending on if they are increasing or decreasing ( green and red f.e.)

and also all the equip slots exept of the weapon one
shall use the accessory armor kind so you can equip 4 accessorys at the same time




i hope this is possible and not as difficult :S
please help  :'(

diagostimo

this is for the change of colors:
#------------------------------------------------------------------------------
#  This window displays actor parameter changes on the equipment screen.
#==============================================================================

class Window_EquipLeft < Window_Base
  #----------------------------------------------------------------------------
  # * Refresh
  #----------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 32)
    draw_actor_parameter(@actor, 4, 64, 0)
    draw_actor_parameter(@actor, 4, 96, 1)
    draw_actor_parameter(@actor, 4, 128, 2)
    if @new_atk != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 64, 40, 32, "->", 1)
      if @new_atk < @actor.atk
        self.contents.font.color = Color.new(255, 0, 0)
      else
        self.contents.font.color = Color.new(0, 255, 0)
      end
      self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
    end
    if @new_pdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 96, 40, 32, "->", 1)
      if @new_pdef < @actor.pdef
        self.contents.font.color = Color.new(255, 0, 0)
      else
        self.contents.font.color = Color.new(0, 255, 0)
      end
      self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
    end
    if @new_mdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 128, 40, 32, "->", 1)
      if @new_mdef < @actor.mdef
        self.contents.font.color = Color.new(255, 0, 0)
      else
        self.contents.font.color = Color.new(0, 255, 0)
      end
      self.contents.draw_text(200,128, 36, 32, @new_mdef.to_s, 2)
    end
  end
end

place it above main and below other scripts, as for the second part im not sure what you are asking for, try to be a bit more descriptive on what you want.

TrueCynder

1st - thank you very much for the script :)

2nd - well i don“t know how i could make it
more clear :S as you can see in the image
i called the slots for equipment "slot 1 - slot 4" instead of "shild , armor ,etc)
out of the reason that they all are supossed to use the same kind of equp type
like here



so in other words ALL the equpment slots exept of the weapon slot
are supoosed to use ONE "kind" of armor :S

diagostimo

July 16, 2012, 03:52:17 am #3 Last Edit: July 16, 2012, 06:01:59 am by diagostimo
so if i have got it right, you want it to only say equip weppon and armour, when you equip armour it automaticy equips the selected item to the corisponding body part?
edit:
nvm after reading the first post i get it now, so your game has 4 accessories, do you still plan on equiping other armor types through other means?
edit 2:
ok i put this together on the asumption your ony equiping accessories in your game:
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_EquipItem < Window_Selectable
 #--------------------------------------------------------------------------
 # * 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)
         @data.push($data_armors[i])
       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
end
#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Get actor
   @actor = $game_party.actors[@actor_index]
   # Make windows
   @help_window = Window_Help.new
   @left_window = Window_EquipLeft.new(@actor)
   @right_window = Window_EquipRight.new(@actor)
   @item_window1 = Window_EquipItem.new(@actor, 0)
   @item_window2 = Window_EquipItem.new(@actor, 1)
   # Associate help window
   @right_window.help_window = @help_window
   @item_window1.help_window = @help_window
   @item_window2.help_window = @help_window
   # Set cursor position
   @right_window.index = @equip_index
   refresh
   # Execute transition
   Graphics.transition
   # Main loop
   loop do
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame update
     update
     # Abort loop if screen is changed
     if $scene != self
       break
     end
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose of windows
   @help_window.dispose
   @left_window.dispose
   @right_window.dispose
   @item_window1.dispose
   @item_window2.dispose
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   # Set item window to visible
   @item_window1.visible = (@right_window.index == 0)
   @item_window2.visible = (@right_window.index >= 1)
   # Get currently equipped item
   item1 = @right_window.item
   # Set current item window to @item_window
   case @right_window.index
   when 0
     @item_window = @item_window1
   when 1
     @item_window = @item_window2
   when 2
     @item_window = @item_window2
   when 3
     @item_window = @item_window2
   end
   # If right window is active
   if @right_window.active
     # Erase parameters for after equipment change
     @left_window.set_new_parameters(nil, nil, nil)
   end
   # If item window is active
   if @item_window.active
     # Get currently selected item
     item2 = @item_window.item
     # Change equipment
     last_hp = @actor.hp
     last_sp = @actor.sp
     @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
     # Get parameters for after equipment change
     new_atk = @actor.atk
     new_pdef = @actor.pdef
     new_mdef = @actor.mdef
     # Return equipment
     @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
     @actor.hp = last_hp
     @actor.sp = last_sp
     # Draw in left window
     @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
   end
 end
end

also theres no need to set the type to helm or accessory etc. it will display and let you equip them none the less, again just place the script above main and below the defaults

TrueCynder

THAAAAAAAAAAAANKS :D this is PERFECT :D
thank you ^_^