Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 A fourth column in MOG Scene Item Laura V1.2
#11
(11-25-2016, 06:09 AM)DerVVulfman Wrote: Well, it's still a bit sloppy by my standard, but here's a patch for the revised version of Scene Item Laura V1.2 - Revised version.

Sloppy by my standard as I left his inner mechanics untouched.  I should have broken the menus into smaller modules so other scripters could more easily write new code and  patches.



Code:
#==============================================================================
# Extra ITEM for MOG_Scene_Item Revised
#     an edit of MOG_Scene_Item V1.3 by Moghunter  
#                http://www.atelier-rgss.com
#==============================================================================
#  Patch by DerVVulfman
#  
#  NOTE:  Requires the end user to rework their "Item_com" graphics to allow
#         for a 4th category, the 'Special' item type.  The format is:
#     Item_com01.png ... To have 4 items, the 1st window "Item" highlighted
#     Item_com02.png ... To have 4 items, the 2nd window "Weapon" highlighted
#     Item_com03.png ... To have 4 items, the 3rd window "Armor" highlighted
#     Item_com04.png ... To have 4 items, the 4th window "Special" highlighted
#
#   Special Items are items not visible in the normal Item bag, but are loca-
#   ted in the 4th category in the item window.  ONLY within the 4th window
#   will these items be found.
#
#   To define special items, place the IDs of these items within the
#   SpecialSelect array inside the MOG module.
#  
#   Setting the name of the new 4th slot graphic is also within the
#   MOG module
#  
#==============================================================================

module MOG
 
 # BASIC MENU CONFIGURATION
   # Item Menu Graphics Used
     ITEM_TYPE_4       = "Item_com02"      # Selection graphic (Secondary Item)

     
 # ITEM Values
   # The list of Items
     SpecialSelect     = [1,2,3]           # List if items by Item ID
 
end



#==============================================================================
# ** Window_Type
#------------------------------------------------------------------------------
#   A hidden window used to switch between the 4 item groups in the menu.
#==============================================================================

class Window_Type < Type_Sel
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------  
 def initialize
   super(0, 0, 0, 0)
   @item_max = 4
   self.index = 0
 end
end



#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
#  This window displays items in possession on the item and battle screens.
#==============================================================================

class Window_Item < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------    
 alias scene_laura_extraslot_init initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------  
 def initialize(special=false)
   # Add a new value into the item window
   @special = special
   # The original call
   scene_laura_extraslot_init
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------    
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   for i in 1...$data_items.size
     if $game_party.item_number(i) > 0
       # If special data, push only special IDs
       if @special == true
         @data.push($data_items[i]) if MOG::SpecialSelect.include?(i)
       # Otherwise, only push IDs that aren't special
       else
         @data.push($data_items[i]) unless MOG::SpecialSelect.include?(i)
       end
     end
   end
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end  
end



#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_Item
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------  
 def main
   unless MOG::ITEM_FX == 2
     @back = Plane.new
     @back.bitmap = RPG::Cache.picture(MOG::ITEM_BACKGROUND)
     @back.z = 100
   else
     @spriteset = Spriteset_Map.new
   end
   @item_lay = Sprite.new
   @item_lay.bitmap = RPG::Cache.picture(MOG::ITEM_LAYOUT)
   @item_lay.z = 100
   @item_com = Sprite.new
   @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_1)
   @item_com.z = 100
   @type = Window_Type.new
   @type.opacity  = 0
   @type.visible = false    
   @help_window = Window_Help.new
   @help_window.y = 405
   @item_window = Window_Item.new
   @item_window.help_window = @help_window
   @item_window.visible = true
   @item_window.active = true
   @weapon_window = Window_Weapon.new
   @weapon_window.help_window = @help_window
   @weapon_window.visible = false
   @weapon_window.active = true
   @armor_window = Window_Armor.new
   @armor_window.help_window = @help_window
   @armor_window.visible = false
   @armor_window.active = true    
   @item2_window = Window_Item.new(true)
   @item2_window.help_window = @help_window
   @item2_window.visible = false
   @item2_window.active = true    
   @target_window = Window_Target_Item.new
   @target_window.x = -300
   @target_window.active = false
   @help_window.opacity = 0
   @help_window.x = -200
   @help_window.contents_opacity = 0    
   @item_window.opacity = 0
   @item2_window.opacity = 0
   @weapon_window.opacity = 0
   @armor_window.opacity = 0
   @target_window.opacity = 0    
   @weapon_window.x = 640
   @armor_window.x = 640
   @item2_window.x = 640
   @item_window.x = 640  
   @weapon_window.contents_opacity = 0
   @armor_window.contents_opacity = 0
   @item2_window.contents_opacity = 0  
   @item_window.contents_opacity = 0  
   unless MOG::ITEM_FX == 2
     Graphics.transition(MOG::ITEM_TRAN_TIME, "Graphics/Transitions/" +
       MOG::ITEM_TRAN_TYPE)
   else
     Graphics.transition
   end
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   for i in 0..30
     @weapon_window.x += 20
     @armor_window.x += 20
     @item2_window.x += 20  
     @item_window.x += 20  
     @weapon_window.contents_opacity -= 15
     @armor_window.contents_opacity -= 15
     @item2_window.contents_opacity -= 15    
     @item_window.contents_opacity -= 15    
     @item_com.opacity -= 15
     @item_lay.opacity -= 15
     @help_window.contents_opacity -= 15
     @item_lay.zoom_x += 0.2
     @item_com.zoom_y += 0.2
     @target_window.x -= 15
     @back.ox += 1 if MOG::ITEM_FX == 0
     Graphics.update  
   end  
   Graphics.freeze
   @help_window.dispose
   @item_window.dispose
   @item2_window.dispose
   @weapon_window.dispose
   @armor_window.dispose
   @target_window.dispose
   @item_lay.dispose
   @back.dispose       if MOG::ITEM_FX == 0
   @back.dispose       if MOG::ITEM_FX == 1
   @spriteset.dispose  if MOG::ITEM_FX == 2
   @item_com.dispose
   @type.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------  
 def update
   if @target_window.active == true
      @target_window.visible = true
     if @target_window.x < 0
        @target_window.x += 20
     elsif @target_window.x >= 0
        @target_window.x = 0      
     end  
   else
     if @target_window.x > -300
        @target_window.x -= 20
     elsif @target_window.x >= -300
        @target_window.x = -300
        @target_window.visible = false
     end
   end    
   if @help_window.x < 0
     @help_window.x += 10
     @help_window.contents_opacity += 15    
   elsif @help_window.x >= 0
     @help_window.x = 0
     @help_window.contents_opacity = 255    
   end
   if @item_window.x > 250
     @weapon_window.x -= 20
     @armor_window.x -= 20
     @item2_window.x -= 20  
     @item_window.x -= 20  
     @weapon_window.contents_opacity += 15
     @armor_window.contents_opacity += 15
     @item2_window.contents_opacity += 15    
     @item_window.contents_opacity += 15    
   elsif  @item_window.x <= 250
     @weapon_window.x = 250
     @armor_window.x = 250
     @item2_window.x = 250  
     @item_window.x = 250  
     @weapon_window.contents_opacity = 250
     @armor_window.contents_opacity = 250
     @item2_window.contents_opacity = 250    
     @item_window.contents_opacity = 250    
   end
   if @target_window.active == false
     if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::LEFT) or
        Input.press?(Input::RIGHT) or  Input.press?(Input::LEFT)
       @weapon_window.x = 640
       @armor_window.x = 640
       @item2_window.x = 640      
       @item_window.x = 640      
       @weapon_window.contents_opacity = 0
       @armor_window.contents_opacity = 0
       @item2_window.contents_opacity = 0      
       @item_window.contents_opacity = 0      
     end
     if Input.trigger?(Input.dir4) or Input.trigger?(Input.dir4) or
        Input.trigger?(Input::L) or Input.trigger?(Input::R)      
       @help_window.x = -200
       @help_window.contents_opacity = 0
     end  
   end
   @back.ox += 1 if MOG::ITEM_FX == 0
   @help_window.update
   @item_window.update
   @item2_window.update
   @weapon_window.update
   @armor_window.update
   @target_window.update
   @type.update
   case @type.index
   when 0
     @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_1)
     if @target_window.active == true
       update_target
       @item_window.active = false  
       @type.active = false
       return
     else  
       @item_window.active = true
       @type.active = true
     end    
     @item2_window.active    = false
     @weapon_window.active   = false
     @armor_window.active    = false
     @item_window.visible    = true
     @item2_window.visible   = false
     @weapon_window.visible  = false
     @armor_window.visible   = false    
   when 1
     @item_com.bitmap        = RPG::Cache.picture(MOG::ITEM_TYPE_2)
     @item_window.active     = false
     @item2_window.active    = false
     @weapon_window.active   = true
     @armor_window.active    = false
     @item_window.visible    = false
     @item2_window.visible   = false
     @weapon_window.visible  = true
     @armor_window.visible   = false    
   when 2
     @item_com.bitmap        = RPG::Cache.picture(MOG::ITEM_TYPE_3)
     @item_window.active     = false
     @item2_window.active    = false
     @weapon_window.active   = false
     @armor_window.active    = true
     @item_window.visible    = false
     @item2_window.visible   = false
     @weapon_window.visible  = false
     @armor_window.visible   = true
   when 3
     @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_4)
     if @target_window.active == true
       update_target
       @item2_window.active = false  
       @type.active = false
       return
     else  
       @item2_window.active = true
       @type.active = true
     end    
     @item_window.active     = false
     @weapon_window.active   = false
     @armor_window.active    = false
     @item2_window.visible   = true
     @item_window.visible    = false
     @weapon_window.visible  = false
     @armor_window.visible   = false    
   end
   return update_item    if @item_window.active
   return update_weapon  if @weapon_window.active
   return update_armor   if @armor_window.active
   return update_item2   if @item2_window.active
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when item window is active)
 #--------------------------------------------------------------------------  
 def update_item2
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new(0)
     return
   end
   if Input.trigger?(Input::C)
     @item = @item_window.item
     unless @item.is_a?(RPG::Item)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     unless $game_party.item_can_use?(@item.id)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     if @item.scope >= 3
       @item_window.active = false
       @target_window.x = (@item_window.index + 1) % 1 * 304
       @target_window.active = true
       @target_window.x = -350              
       if @item.scope == 4 || @item.scope == 6
         @target_window.index = -1
       else
         @target_window.index = 0
       end
     else
       if @item.common_event_id > 0
         $game_temp.common_event_id = @item.common_event_id
         $game_system.se_play(@item.menu_se)
         if @item.consumable
           $game_party.lose_item(@item.id, 1)
           @item_window.draw_item(@item_window.index)
         end
         $scene = Scene_Map.new
         return
       end
     end
     return
   end
 end
end

Oh... it is 'purist' in that it assumes the windows will slide into the default position as the original script.  For your change, look to lines 249 to 266 which YOU can edit.  Ya had it going fine yourself.  Winking  I'm just leaving it 'pure' so to speak.

Thank you.
In order to make the slection row go a little bit to the right, you need to go to line 249 - 266 and change it with this:

Code:
if @item_window.x > 269

      @weapon_window.x -= 20
      @armor_window.x -= 20
      @item2_window.x -= 20   
      @item_window.x -= 20   
      @weapon_window.contents_opacity += 15
      @armor_window.contents_opacity += 15
      @item2_window.contents_opacity += 15    
      @item_window.contents_opacity += 15    
    elsif  @item_window.x <= 269
      @weapon_window.x = 269
      @armor_window.x = 269
      @item2_window.x = 269   
      @item_window.x = 269   
      @weapon_window.contents_opacity = 250
      @armor_window.contents_opacity = 250
      @item2_window.contents_opacity = 250    
      @item_window.contents_opacity = 250    

Then, you're done. 
Btw. just found out that your revised versions changes the item slection menu in battle.
Tried putting it above and under the battle system but, it still changes it.
Reply }
#12
The item system assumes it is for anyone, and does not get the location of a single member of the party. For that, the default item window takes up the entire screen in two columns, unlike the Moghunter system which uses one column.

Likewise, you may not have noticed the SKILL window is the same... so I have an interesting couple of options for you:

Option 1 - Window Follows Actor
Go to the battlesystem.... Scene_Battle_3 page:
GO to the start_item_select method that is around line 405:
Underneath the line that reads:
@item_window = Window_Item.new
paste the following...
@item_window.x = @actor_index * 115

This will give you an item window that goes from left to right with each actor.

And you may not notice that the SKILL select is altered too. You can alter it the same way within the start_skill_select method a couple dozen lines up.




Option 2 - Restore full window in battle
Go to the Item Window class in the moghunter menu... the initialize method around line 346. It should have some code like below:
Code:
if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end

Well... we're going to FORCE it to take up the whole display window as it used to appear, by replacing it with this:
Code:
if $game_temp.in_battle
      @column_max = 2
      self.y = 64
      self.x = 0
      self.height = 256
      self.width  = 640
      self.back_opacity = 160
      refresh
    end
Yeah, forcing it to 2 columns, a full 640 width, etc.

But we're not done yet. The item drawing method is set only for one column... so go into the draw_item method and towards line 405.
When you find the code that reads:
Code:
x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
Paste this BELOW that code:
Code:
if $game_temp.in_battle
      x = 4 + index % 2 * (288 + 32)
      y = index / 2 * 32
    end]

So now it can handle the drawing of 2 column data while in battle.

And you may not notice that the SKILL select is affected the same way, so you may wish to use these techniques to fix up the Skill_Window class in the revised Scene_Skill Nami script too.

Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }
#13
(11-26-2016, 04:35 AM)DerVVulfman Wrote: The item system assumes it is for anyone, and does not get the location of a single member of the party.  For that, the default item window takes up the entire screen in two columns, unlike the Moghunter system which uses one column.  

Likewise, you may not have noticed the SKILL window is the same... so I have an interesting couple of options for you:

Option 1 - Window Follows Actor
Go to the battlesystem....   Scene_Battle_3 page:  
GO to the start_item_select method that is around line 405:
Underneath the line that reads:
@item_window = Window_Item.new
paste the following...
@item_window.x = @actor_index * 115

This will give you an item window that goes from left to right with each actor.

And you may not notice that the SKILL select is altered too.   You can alter it the same way within the start_skill_select method a couple dozen lines up.




Option 2 - Restore full window in battle
Go to the Item Window class in the moghunter menu... the initialize method around line 346.  It should have some code like below:

Code:
   if $game_temp.in_battle
     self.y = 64
     self.height = 256
     self.back_opacity = 160
   end

Well... we're going to FORCE it to take up the whole display window as it used to appear, by replacing it with this:

Code:
   if $game_temp.in_battle
     @column_max = 2
     self.y = 64
     self.x = 0
     self.height = 256
     self.width  = 640
     self.back_opacity = 160
     refresh
   end  
Yeah, forcing it to 2 columns, a full 640 width, etc.

But we're not done yet.  The item drawing method is set only for one column... so go into the draw_item method and towards line 405.
When you find the code that reads:

Code:
   x = 4 + index % 1 * (288 + 32)
   y = index / 1 * 32
Paste this BELOW that code:

Code:
   if $game_temp.in_battle
     x = 4 + index % 2 * (288 + 32)
     y = index / 2 * 32
   end]

So now it can handle the drawing of 2 column data while in battle.

And you may not notice that the SKILL select is affected the same way, so you may wish to use these techniques to fix up the Skill_Window class in the revised Scene_Skill Nami  script too.


Thanks, for the code, I've chosen option  2 because I dont like to edit the battle sytem.
Now, I've two columuns but normally the item window is at the bottom now its in the bottom. Also the window is bigger in height than before.
Reply }
#14
The code I supplied, as I employed it before relaying it to you, returns the classic RMXP Item Window to the battlesystem. The default system uses two columns and fills the space between the help window above and the battlestatus below. And even after battle, I had returned to the Moggy Item window to ensure the Mog-styled Item window remained the same. From my tests, it is working fine. Mogmenu uses its custom Item window, and the battlesystem uses its default window setup.

Changes to the item (and alternately the Skill) window within battle can be made within the area(s) in the blocks of code I showed you, the ones within the if $game_temp.in_battle condition. It controls height, width, and position in the window, and if you have a 2nd column (the @column_max value). But if you decide to return column max to one, remember that I suggested adding a small block of code in the item_draw method that permits 2 columns in battle... something you would likely take back out.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   I want to merge item classification and description extensions. zlsl 7 8,401 11-25-2019, 06:46 AM
Last Post: kyonides
   Handling very long Item Names Melana 4 7,526 09-24-2018, 06:37 PM
Last Post: Melana
   Need help with my menu - Current issue is item grid layout LilyFrog 41 34,087 09-24-2018, 02:03 AM
Last Post: LilyFrog
   using $scene during battles Keeroh 5 7,888 01-17-2018, 04:31 PM
Last Post: Keeroh
Sad  Equip bug (1-scene CMS) Whisper 2 4,815 01-23-2017, 09:20 AM
Last Post: Whisper
Bug Help with a Scene Equip Iqus 7 7,316 03-05-2014, 05:40 PM
Last Post: MechanicalPen
Exclamation  FF7s Hyper/Tranquilizer Item Script Petition Iqus 2 4,606 06-18-2013, 01:26 AM
Last Post: Iqus
   Cold's Bestiary and Item Book Vengan 0 3,182 05-27-2010, 08:59 AM
Last Post: Vengan
   Using animations in a scene (unrelated to battles and maps) PK8 4 8,144 11-17-2009, 10:54 AM
Last Post: PK8
   Timing problem with damage shown on the screen - Scene Battle mageone 2 5,831 10-20-2009, 06:22 PM
Last Post: mageone



Users browsing this thread: