[Resolved!] Actors With Separate Items

Started by Yin, May 21, 2009, 11:27:04 pm

Previous topic - Next topic

Yin

May 21, 2009, 11:27:04 pm Last Edit: June 18, 2009, 01:01:30 pm by Yin
(I need help, this is no longer a request.... Unless you want it to be and can fix this! :P)

Script Request

This is a request for a combination of 2 existing scripts.

Script Title:
Separate Item Bags
RMXP or RMVX:
This is for XP
Detailed Description:

Let me explain. Right now, the script I am using is set up to go to the item menu. You assign items with the 1, 2, 3 and 4 keys. You press shift to enter the item bags of the actors. In this scene, you can see who has what and unassign items.

What I want is the party's item menu underneath it. I want everything to be done in 1 scene. If you are in the actors selection items then you have to press b or escape to get back to the party items menu (which would be on the bottom of that), you do all of the assigning in the party items menu and you will see it updating as you are doing it. I would also like to be able to assign a max items for each actor if possible which would show under their picture. I hope I am clear with my explanation.

Screen shots:
Right now the item script I am using looks like this


I want it to look like this

(I did this with paint)

The script
Here is the script I need combined with the regular item menu.
Code: text
#==============================================================================
# Seperate Items For Actors
#==============================================================================
# SephirothSpawn
# Version 1
# 2.2.05
# Thanks to Near Fantastica for his Keyboard Module, and  Katzbalger for requesting it
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Seperate Items For Actors", "SephirothSpawn", 1, "2.2.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Seperate Items For Actors") == true
 
#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================

module Keyboard
 #--------------------------------------------------------------------------
 @keys = []
 @pressed = []
 Mouse_Left = 1
 Mouse_Right = 2
 Back= 8
 Tab = 9
 Enter = 13
 Shift = 16
 Ctrl = 17
 Alt = 18
 Esc = 27
 Space = 32
 Numberkeys = {}
 Numberkeys[0] = 48
 Numberkeys[1] = 49
 Numberkeys[2] = 50
 Numberkeys[3] = 51
 Numberkeys[4] = 52
 Numberkeys[5] = 53
 Numberkeys[6] = 54
 Numberkeys[7] = 55
 Numberkeys[8] = 56
 Numberkeys[9] = 57
 Numberpad = {}
 Numberpad[0] = 45
 Numberpad[1] = 35
 Numberpad[2] = 40
 Numberpad[3] = 34
 Numberpad[4] = 37
 Numberpad[5] = 12
 Numberpad[6] = 39
 Numberpad[7] = 36
 Numberpad[8] = 38
 Numberpad[9] = 33
 Letters = {}
 Letters["A"] = 65
 Letters["B"] = 66
 Letters["C"] = 67
 Letters["D"] = 68
 Letters["E"] = 69
 Letters["F"] = 70
 Letters["G"] = 71
 Letters["H"] = 72
 Letters["I"] = 73
 Letters["J"] = 74
 Letters["K"] = 75
 Letters["L"] = 76
 Letters["M"] = 77
 Letters["N"] = 78
 Letters["O"] = 79
 Letters["P"] = 80
 Letters["Q"] = 81
 Letters["R"] = 82
 Letters["S"] = 83
 Letters["T"] = 84
 Letters["U"] = 85
 Letters["V"] = 86
 Letters["W"] = 87
 Letters["X"] = 88
 Letters["Y"] = 89
 Letters["Z"] = 90
 Fkeys = {}
 Fkeys[1] = 112
 Fkeys[2] = 113
 Fkeys[3] = 114
 Fkeys[4] = 115
 Fkeys[5] = 116
 Fkeys[6] = 117
 Fkeys[7] = 118
 Fkeys[8] = 119
 Fkeys[9] = 120
 Fkeys[10] = 121
 Fkeys[11] = 122
 Fkeys[12] = 123
 Collon = 186
 Equal = 187
 Comma = 188
 Underscore = 189
 Dot = 190
 Backslash = 191
 Lb = 219
 Rb = 221
 Quote = 222
 State = Win32API.new("user32","GetKeyState",['i'],'i')
 Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
 #--------------------------------------------------------------------------
 def Keyboard.getstate(key)
   return true unless State.call(key).between?(0, 1)
   return false
 end
 #--------------------------------------------------------------------------
 def Keyboard.testkey(key)
   Key.call(key) & 0x01 == 1
 end
 #--------------------------------------------------------------------------
 def Keyboard.update
   @keys = []
   @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
   @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
   @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
   @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
   @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
   @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
   @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
   @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
   @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
   @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
   for key in Keyboard::Numberkeys.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Numberpad.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Letters.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Fkeys.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
   @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
   @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
   @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
   @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
   @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
   @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
   @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
   @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
   @pressed = []
   @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
   @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
   @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
   @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
   @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
   @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
   @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
   @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
   @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
   @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
   for key in Keyboard::Numberkeys.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Numberpad.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Letters.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Fkeys.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
   @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
   @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
   @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
   @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
   @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
   @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
   @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
   @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)
 end
 #--------------------------------------------------------------------------
 def Keyboard.trigger?(key)
   return true if @keys.include?(key)
   return false
 end
 #--------------------------------------------------------------------------
 def Keyboard.pressed?(key)
   return true if @pressed.include?(key)
   return false
 end
end

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

class Bitmap
 #--------------------------------------------------------------------------
 # * Scale Blt
 #--------------------------------------------------------------------------
 def scale_blt(dest_rect, src_bitmap,
   src_rect = Rect.new(0, 0, src_bitmap.width, src_bitmap.height), opacity = 255)
   w, h = src_rect.width, src_rect.height
   scale = [w / dest_rect.width.to_f, h / dest_rect.height.to_f].max
   ow, oh = (w / scale).to_i, (h / scale).to_i
   ox, oy = (dest_rect.width - ow) / 2, (dest_rect.height - oh) / 2
   stretch_blt(Rect.new(ox + dest_rect.x, oy + dest_rect.y, ow, oh),
     src_bitmap, src_rect )
 end
end

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :items
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_gameparty_item_number item_number
 #--------------------------------------------------------------------------
 # * Get Number of Items Possessed
 #     item_id : item ID
 #--------------------------------------------------------------------------
 def item_number(item_id)
   # If In Battle, loads Active Battler Numbers
   if $game_temp.in_battle
     n = 0
     for item in $scene.active_battler.item_cache
       if item.id == item_id
         n += 1
       end
     end
     return n
   else
     # If quantity data is in the hash, use it. If not, return 0
     return @items.include?(item_id) ? @items[item_id] : 0
   end
 end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :item_cache
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_gameactor_setup setup
 #--------------------------------------------------------------------------
 # * Setup
 #--------------------------------------------------------------------------
 def setup(actor_id)
   # Sets Item Cache
   @item_cache = []
   # Original Actor Setup Method
   seph_individualactorcache_gameactor_setup(actor_id)
 end
 #--------------------------------------------------------------------------
 # * Assign Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def assign_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     @item_cache << item
     @item_cache.sort! {|a, b| a.id<=>b.id}
     item_number = $game_party.items.include?(item_id) ? $game_party.items[item_id] : 0
     $game_party.items[item_id] = [[item_number - 1, 0].max, 99].min
   end
 end
 #--------------------------------------------------------------------------
 # * Unassign Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def unassign_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     if @item_cache.include?(item)
       use_item(item_id)
       $game_party.gain_item(item_id, 1)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Use Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def use_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     for i in 0...@item_cache.size
       if item == @item_cache[i]
         @item_cache.delete_at(i)
         break
       end
     end
   end
 end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :active_battler
end

#==============================================================================
# ** Window_Item
#==============================================================================

class Window_Item < Window_Selectable
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   # For Out Of Battle Use
   unless $game_temp.in_battle
     # Add item
     for i in 1...$data_items.size
       if $game_party.item_number(i) > 0
         @data.push($data_items[i])
       end
     end
     # Adds In Actor Item Cache
     for actor in $game_party.actors
       for item in actor.item_cache
         @data << item unless @data.include?(item)
       end
     end
     # Also add weapons and items if outside of battle
     for i in 1...$data_weapons.size
       if $game_party.weapon_number(i) > 0
         @data.push($data_weapons[i])
       end
     end
     for i in 1...$data_armors.size
       if $game_party.armor_number(i) > 0
         @data.push($data_armors[i])
       end
     end
   # For In Battle Use
   else
     for item in $scene.active_battler.item_cache
       @data << item
     end
   end
   # If item count is not 0, make a bit map and draw all items
   @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

#==============================================================================
# ** Window_ItemCacheHeading
#==============================================================================

class Window_ItemCacheHeading < Window_Base
 #--------------------------------------------------------------------------
 # * Constant
 #--------------------------------------------------------------------------
 DRAW_CHARACTER = true
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(actor_index)
   super(actor_index * 160, 64, 160, 160)
   self.contents = Bitmap.new(width - 32, height - 32)
   @frame = 0
   refresh(@actor = $game_party.actors[actor_index])
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh(actor = @actor)
   self.contents.clear
   @actor = actor
   return if @actor.nil?
   # Draws Actors Name
   self.contents.draw_text(4, 0, contents.width - 8, 32, @actor.name, 1)
   # Draws Actors Sprite
   if DRAW_CHARACTER
     draw_sprite(0, 32, 128, 96, @actor.character_name, @actor.character_hue, 0, @frame)
   else
     bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
     self.contents.scale_blt(Rect.new(0, 32, 128, 96), bitmap)
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   # If Character Sprite
   if DRAW_CHARACTER
     if Graphics.frame_count % 10 == 0
       @frame == 3 ? @frame = 0 : @frame += 1
       refresh
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Sprite
 #--------------------------------------------------------------------------
 def draw_sprite(x, y, w, h, name, hue, stance, frame)
   # Gets Bitmap
   bitmap = RPG::Cache.character(name, hue)
   # Bitmap Division
   cw, ch = bitmap.width / 4,  bitmap.height / 4
   # Gets Animation Offsets
   x_off, y_off = cw * frame, ch * stance
   # Draws Bitmap
   self.contents.scale_blt(Rect.new(x, y, w, h), bitmap, Rect.new(x_off, y_off, cw, ch))
 end
end

#==============================================================================
# ** Window_ItemCache
#==============================================================================

class Window_ItemCache < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(actor_index)
   super(actor_index * 160, 224, 160, 256)
   @actor = $game_party.actors[actor_index]
   refresh
   self.index = 0
   self.active = false
 end
 #--------------------------------------------------------------------------
 # * Get Item
 #--------------------------------------------------------------------------
 def item
   return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   # Adds In Actor Item Cache
   @actor.item_cache.sort! {|a, b| a.id<=>b.id}
   for item in @actor.item_cache
     @data << item
   end
   # If item count is not 0, make a bit map and draw all items
   @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
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(index)
   item, y = @data[index], index * 32
   bitmap = RPG::Cache.icon(item.icon_name)
   self.contents.blt(0, y + 4, bitmap, Rect.new(0, 0, 24, 24))
   self.contents.draw_text(32, y, 212, 32, item.name)
 end
end

#==============================================================================
# ** Scene_ActorCache
#==============================================================================

class Scene_ItemCache
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   @help_window = Window_Help.new
     @help_window.set_text('Select Item To Unassign', 1)
   @scene_objects = [@help_window]
   for i in 0..3
     eval "@actor_#{i}_heading = Window_ItemCacheHeading.new(#{i})"
     eval "@scene_objects << @actor_#{i}_heading"
     eval "@actor_#{i}_cache = Window_ItemCache.new(#{i})"
     eval "@scene_objects << @actor_#{i}_cache"
   end
   @actor_0_cache.active = true
   @actor_index = 0
   # Execute transition
   Graphics.transition
   # Main loop
   while $scene == self
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Updates Scene Objects
     @scene_objects.each {|x| x.update}
     # Frame update
     update
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose Scene Objects
   @scene_objects.each {|x| x.dispose}
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # If B button is pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to menu screen
     $scene = Scene_Menu.new
   end
   # If C button is pressed
   if Input.trigger?(Input::C)
     item = eval "@actor_#{@actor_index}_cache.item"
     if item.nil?
       # Plays Buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decision SE
     $game_system.se_play($data_system.decision_se)
     # Usassins Item
     $game_party.actors[@actor_index].unassign_item(item.id)
     # Refreshes Window
     eval "@actor_#{@actor_index}_cache.refresh"
   end
   # If Left or Right Buttons Are Pressed
   if Input.trigger?(Input::LEFT)
     # Plays Cursor SE
     $game_system.se_play($data_system.cursor_se)
     # Deativates Current Window
     eval "@actor_#{@actor_index}_cache.active = false"
     # Changes Window Index
     @actor_index == 0 ? @actor_index = 3 : @actor_index -= 1
     # Actives New Window
     eval "@actor_#{@actor_index}_cache.active = true"
   elsif Input.trigger?(Input::RIGHT)
     # Plays Cursor SE
     $game_system.se_play($data_system.cursor_se)
     # Deativates Current Window
     eval "@actor_#{@actor_index}_cache.active = false"
     # Changes Window Index
     @actor_index == 3 ? @actor_index = 0 : @actor_index += 1
     # Actives New Window
     eval "@actor_#{@actor_index}_cache.active = true"
   end
   # If A button is pressed
   if Input.trigger?(Input::A)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to Item Cache screen
     $scene = Scene_Item.new
     return
   end
 end
end

#==============================================================================
# ** Scene_Item
#==============================================================================

class Scene_Item
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_sceneitem_update update
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Updates Near's Keyboard Module
   Keyboard.update
   # Assign To Player 1
   if Keyboard.trigger?(Keyboard::Numberkeys[1])
     # If Actor is nil
     if $game_party.actors[0].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[0].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 2
   if Keyboard.trigger?(Keyboard::Numberkeys[2])
     # If Actor is nil
     if $game_party.actors[1].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[1].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 3
   if Keyboard.trigger?(Keyboard::Numberkeys[3])
     # If Actor is nil
     if $game_party.actors[2].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[2].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 4
   if Keyboard.trigger?(Keyboard::Numberkeys[4])
     # If Actor is nil
     if $game_party.actors[3].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[3].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # If A button is pressed
   if Input.trigger?(Input::A)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to item screen
     $scene = Scene_ItemCache.new
   end
   # Orginal Update Method
   seph_individualactorcache_sceneitem_update
 end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

It is made by SephirothSpawn

If you have any specific questions, please don't hesitate to ask me. Thank you to anyone who is able and willing to complete this task.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

G_G

Just to let you know this script is bugged. You can assign items you dont even have and it also keeps items in there display 0....this script is messed up and should be fixed before anything.

Yin

Really?  :( I liked the 0 display, but only if it's assigned to someone and not when it's completely not even in the party's inventory. I will try to see what's up with this, thanks for pointing these things out, but I'm no scripter, if anyone is willing to try to fix these thing, then I would appreciate that. Or if anyone can direct me to something like it that maybe has the features requested? Thank you to anyone who is willing and able to help.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

G_G

Yea press 1 on the 0 display thing and it'll keep adding the item to hero 1.

Yin

Yeah I didn't try "over adding" until you mentioned it and I noticed it. Don't I just need to put somewhere add item unless it equals 0 or something like that?
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Yin

May 24, 2009, 12:06:30 am #5 Last Edit: May 25, 2009, 12:04:36 am by Yin
bump?
I fixed it a little! I only need it to show up correctly and be consumed in battle.

#==============================================================================
# Seperate Items For Actors
#==============================================================================
# SephirothSpawn
# Version 1
# 2.2.05
# Thanks to Near Fantastica for his Keyboard Module, and  Katzbalger for requesting it
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
#SDK.log("Seperate Items For Actors", "SephirothSpawn", 1, "2.2.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
#if SDK.state("Seperate Items For Actors") == true
 
#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================

module Keyboard
 #--------------------------------------------------------------------------
 @keys = []
 @pressed = []
 Mouse_Left = 1
 Mouse_Right = 2
 Back= 8
 Tab = 9
 Enter = 13
 Shift = 16
 Ctrl = 17
 Alt = 18
 Esc = 27
 Space = 32
 Numberkeys = {}
 Numberkeys[0] = 48
 Numberkeys[1] = 49
 Numberkeys[2] = 50
 Numberkeys[3] = 51
 Numberkeys[4] = 52
 Numberkeys[5] = 53
 Numberkeys[6] = 54
 Numberkeys[7] = 55
 Numberkeys[8] = 56
 Numberkeys[9] = 57
 Numberpad = {}
 Numberpad[0] = 45
 Numberpad[1] = 35
 Numberpad[2] = 40
 Numberpad[3] = 34
 Numberpad[4] = 37
 Numberpad[5] = 12
 Numberpad[6] = 39
 Numberpad[7] = 36
 Numberpad[8] = 38
 Numberpad[9] = 33
 Letters = {}
 Letters["A"] = 65
 Letters["B"] = 66
 Letters["C"] = 67
 Letters["D"] = 68
 Letters["E"] = 69
 Letters["F"] = 70
 Letters["G"] = 71
 Letters["H"] = 72
 Letters["I"] = 73
 Letters["J"] = 74
 Letters["K"] = 75
 Letters["L"] = 76
 Letters["M"] = 77
 Letters["N"] = 78
 Letters["O"] = 79
 Letters["P"] = 80
 Letters["Q"] = 81
 Letters["R"] = 82
 Letters["S"] = 83
 Letters["T"] = 84
 Letters["U"] = 85
 Letters["V"] = 86
 Letters["W"] = 87
 Letters["X"] = 88
 Letters["Y"] = 89
 Letters["Z"] = 90
 Fkeys = {}
 Fkeys[1] = 112
 Fkeys[2] = 113
 Fkeys[3] = 114
 Fkeys[4] = 115
 Fkeys[5] = 116
 Fkeys[6] = 117
 Fkeys[7] = 118
 Fkeys[8] = 119
 Fkeys[9] = 120
 Fkeys[10] = 121
 Fkeys[11] = 122
 Fkeys[12] = 123
 Collon = 186
 Equal = 187
 Comma = 188
 Underscore = 189
 Dot = 190
 Backslash = 191
 Lb = 219
 Rb = 221
 Quote = 222
 State = Win32API.new("user32","GetKeyState",['i'],'i')
 Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
 #--------------------------------------------------------------------------
 def Keyboard.getstate(key)
   return true unless State.call(key).between?(0, 1)
   return false
 end
 #--------------------------------------------------------------------------
 def Keyboard.testkey(key)
   Key.call(key) & 0x01 == 1
 end
 #--------------------------------------------------------------------------
 def Keyboard.update
   @keys = []
   @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
   @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
   @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
   @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
   @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
   @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
   @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
   @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
   @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
   @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
   for key in Keyboard::Numberkeys.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Numberpad.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Letters.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   for key in Keyboard::Fkeys.values
     @keys.push(key) if Keyboard.testkey(key)
   end
   @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
   @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
   @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
   @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
   @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
   @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
   @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
   @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
   @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
   @pressed = []
   @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
   @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
   @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
   @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
   @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
   @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
   @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
   @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
   @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
   @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
   for key in Keyboard::Numberkeys.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Numberpad.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Letters.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   for key in Keyboard::Fkeys.values
     @pressed.push(key) if Keyboard.getstate(key)
   end
   @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
   @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
   @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
   @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
   @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
   @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
   @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
   @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
   @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)
 end
 #--------------------------------------------------------------------------
 def Keyboard.trigger?(key)
   return true if @keys.include?(key)
   return false
 end
 #--------------------------------------------------------------------------
 def Keyboard.pressed?(key)
   return true if @pressed.include?(key)
   return false
 end
end

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

class Bitmap
 #--------------------------------------------------------------------------
 # * Scale Blt
 #--------------------------------------------------------------------------
 def scale_blt(dest_rect, src_bitmap,
   src_rect = Rect.new(0, 0, src_bitmap.width, src_bitmap.height), opacity = 255)
   w, h = src_rect.width, src_rect.height
   scale = [w / dest_rect.width.to_f, h / dest_rect.height.to_f].max
   ow, oh = (w / scale).to_i, (h / scale).to_i
   ox, oy = (dest_rect.width - ow) / 2, (dest_rect.height - oh) / 2
   stretch_blt(Rect.new(ox + dest_rect.x, oy + dest_rect.y, ow, oh),
     src_bitmap, src_rect )
 end
end

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :items
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_gameparty_item_number item_number
 #--------------------------------------------------------------------------
 # * Get Number of Items Possessed
 #     item_id : item ID
 #--------------------------------------------------------------------------
 def item_number(item_id)
   # If In Battle, loads Active Battler Numbers
   if $game_temp.in_battle
     n = 0
     for item in $scene.active_battler.item_cache
       if item.id == item_id
         n += 1
       end
     end
     return n
   else
     # If quantity data is in the hash, use it. If not, return 0
     return @items.include?(item_id) ? @items[item_id] : 0
   end
 end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :item_cache
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_gameactor_setup setup
 #--------------------------------------------------------------------------
 # * Setup
 #--------------------------------------------------------------------------
 def setup(actor_id)
   # Sets Item Cache
   @item_cache = []
   # Original Actor Setup Method
   seph_individualactorcache_gameactor_setup(actor_id)
 end
 #--------------------------------------------------------------------------
 # * Assign Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def assign_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     @item_cache << item
     @item_cache.sort! {|a, b| a.id<=>b.id}
     item_number = $game_party.items.include?(item_id) ? $game_party.items[item_id] : 0
     $game_party.items[item_id] = [[item_number - 1, 0].max, 99].min
   end
 end
 #--------------------------------------------------------------------------
 # * Unassign Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def unassign_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     if @item_cache.include?(item)
       use_item(item_id)
       $game_party.gain_item(item_id, 1)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Use Item
 #     item_id : Items ID #
 #--------------------------------------------------------------------------
 def use_item(item_id)
   item = $data_items[item_id]
   unless item.nil?
     for i in 0...@item_cache.size
       if item == @item_cache[i]
         @item_cache.delete_at(i)
         break
       end
     end
   end
 end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :active_battler
end

#==============================================================================
# ** Window_Item
#==============================================================================

class Window_Item < Window_Selectable
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   # For Out Of Battle Use
   unless $game_temp.in_battle
     # Add item
     for i in 1...$data_items.size
       if $game_party.item_number(i) > 0
         @data.push($data_items[i])
       end
     end
     # Adds In Actor Item Cache
     for actor in $game_party.actors
       for item in actor.item_cache
         @data << item unless @data.include?(item)
       end
     end
     # Also add weapons and items if outside of battle
     for i in 1...$data_weapons.size
       if $game_party.weapon_number(i) > 0
         @data.push($data_weapons[i])
       end
     end
     for i in 1...$data_armors.size
       if $game_party.armor_number(i) > 0
         @data.push($data_armors[i])
       end
     end
   # For In Battle Use
   else
     for item in $scene.active_battler.item_cache
       @data << item
     end
   end
   # If item count is not 0, make a bit map and draw all items
   @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

#==============================================================================
# ** Window_ItemCacheHeading
#==============================================================================

class Window_ItemCacheHeading < Window_Base
 #--------------------------------------------------------------------------
 # * Constant
 #--------------------------------------------------------------------------
 DRAW_CHARACTER = true
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(actor_index)
   super(actor_index * 160, 64, 160, 160)
   self.contents = Bitmap.new(width - 32, height - 32)
   @frame = 0
   refresh(@actor = $game_party.actors[actor_index])
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh(actor = @actor)
   self.contents.clear
   @actor = actor
   return if @actor.nil?
   # Draws Actors Name
   self.contents.draw_text(4, 0, contents.width - 8, 32, @actor.name, 1)
   # Draws Actors Sprite
   if DRAW_CHARACTER
     draw_sprite(0, 32, 128, 96, @actor.character_name, @actor.character_hue, 0, @frame)
   else
     bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
     self.contents.scale_blt(Rect.new(0, 32, 128, 96), bitmap)
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   # If Character Sprite
   if DRAW_CHARACTER
     if Graphics.frame_count % 10 == 0
       @frame == 3 ? @frame = 0 : @frame += 1
       refresh
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Sprite
 #--------------------------------------------------------------------------
 def draw_sprite(x, y, w, h, name, hue, stance, frame)
   # Gets Bitmap
   bitmap = RPG::Cache.character(name, hue)
   # Bitmap Division
   cw, ch = bitmap.width / 4,  bitmap.height / 4
   # Gets Animation Offsets
   x_off, y_off = cw * frame, ch * stance
   # Draws Bitmap
   self.contents.scale_blt(Rect.new(x, y, w, h), bitmap, Rect.new(x_off, y_off, cw, ch))
 end
end

#==============================================================================
# ** Window_ItemCache
#==============================================================================

class Window_ItemCache < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(actor_index)
   super(actor_index * 160, 224, 160, 256)
   @actor = $game_party.actors[actor_index]
   refresh
   self.index = 0
   self.active = false
 end
 #--------------------------------------------------------------------------
 # * Get Item
 #--------------------------------------------------------------------------
 def item
   return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   # Adds In Actor Item Cache
   @actor.item_cache.sort! {|a, b| a.id<=>b.id}
   for item in @actor.item_cache
     @data << item
   end
   # If item count is not 0, make a bit map and draw all items
   @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
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(index)
   item, y = @data[index], index * 32
   bitmap = RPG::Cache.icon(item.icon_name)
   self.contents.blt(0, y + 4, bitmap, Rect.new(0, 0, 24, 24))
   self.contents.draw_text(32, y, 212, 32, item.name)
 end
end

#==============================================================================
# ** Scene_ActorCache
#==============================================================================

class Scene_ItemCache
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   @help_window = Window_Help.new
     @help_window.set_text('Select Item To Unassign', 1)
   @scene_objects = [@help_window]
   for i in 0..3
     eval "@actor_#{i}_heading = Window_ItemCacheHeading.new(#{i})"
     eval "@scene_objects << @actor_#{i}_heading"
     eval "@actor_#{i}_cache = Window_ItemCache.new(#{i})"
     eval "@scene_objects << @actor_#{i}_cache"
   end
   @actor_0_cache.active = true
   @actor_index = 0
   # Execute transition
   Graphics.transition
   # Main loop
   while $scene == self
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Updates Scene Objects
     @scene_objects.each {|x| x.update}
     # Frame update
     update
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose Scene Objects
   @scene_objects.each {|x| x.dispose}
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # If B button is pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to menu screen
     $scene = Scene_Menu.new
   end
   # If C button is pressed
   if Input.trigger?(Input::C)
     item = eval "@actor_#{@actor_index}_cache.item"
     if item.nil?
       # Plays Buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Plays Decision SE
     $game_system.se_play($data_system.decision_se)
     # Usassins Item
     $game_party.actors[@actor_index].unassign_item(item.id)
     # Refreshes Window
     eval "@actor_#{@actor_index}_cache.refresh"
   end
   # If Left or Right Buttons Are Pressed
   if Input.trigger?(Input::LEFT)
     # Plays Cursor SE
     $game_system.se_play($data_system.cursor_se)
     # Deativates Current Window
     eval "@actor_#{@actor_index}_cache.active = false"
     # Changes Window Index
     @actor_index == 0 ? @actor_index = 3 : @actor_index -= 1
     # Actives New Window
     eval "@actor_#{@actor_index}_cache.active = true"
   elsif Input.trigger?(Input::RIGHT)
     # Plays Cursor SE
     $game_system.se_play($data_system.cursor_se)
     # Deativates Current Window
     eval "@actor_#{@actor_index}_cache.active = false"
     # Changes Window Index
     @actor_index == 3 ? @actor_index = 0 : @actor_index += 1
     # Actives New Window
     eval "@actor_#{@actor_index}_cache.active = true"
   end
   # If A button is pressed
   if Input.trigger?(Input::A)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to Item Cache screen
     $scene = Scene_Item.new
     return
   end
 end
end

#==============================================================================
# ** Scene_Item
#==============================================================================

class Scene_Item
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_individualactorcache_sceneitem_update update
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Updates Near's Keyboard Module
   Keyboard.update
   # Assign To Player 1
   if Keyboard.trigger?(Keyboard::Numberkeys[1])
     # If Actor is nil
     if $game_party.actors[0].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     if $game_party.item_number(@item_window.item.id) < 1
       $game_system.se_play($data_system.buzzer_se)
       @item_window.refresh
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[0].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 2
   if Keyboard.trigger?(Keyboard::Numberkeys[2])
     # If Actor is nil
     if $game_party.actors[1].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     if $game_party.item_number(@item_window.item.id) < 1
       $game_system.se_play($data_system.buzzer_se)
       @item_window.refresh
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[1].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 3
   if Keyboard.trigger?(Keyboard::Numberkeys[3])
     # If Actor is nil
     if $game_party.actors[2].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     if $game_party.item_number(@item_window.item.id) < 1
       $game_system.se_play($data_system.buzzer_se)
       @item_window.refresh
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[2].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # Assign To Player 4
   if Keyboard.trigger?(Keyboard::Numberkeys[4])
     # If Actor is nil
     if $game_party.actors[3].nil?
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     if $game_party.item_number(@item_window.item.id) < 1
       $game_system.se_play($data_system.buzzer_se)
       @item_window.refresh
       return
     end
     # Plays Decison SE
     $game_system.se_play($data_system.decision_se)
     # Assigns Item
     $game_party.actors[3].assign_item(@item_window.item.id)
     # Refreshs Window
     @item_window.refresh
   end
   # If A button is pressed
   if Input.trigger?(Input::A)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to item screen
     $scene = Scene_ItemCache.new
   end
   # Orginal Update Method
   seph_individualactorcache_sceneitem_update
 end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
#end


I fixed the fact that when you are adding items, it won't over add in the menu. But in battle something is wrong and I don't know what to edit. I guess this is more of support than a request now. If anyone can help, thank you.

This is what I mean.

Why do the items show up like that? Notice I have 2 Potions and it's there twice. And when I use them they are never consumed.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Yin

Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Do you need SDK to make this work?

Let me know and I'll try. I'm almost positive that I can figure this out. It'll just take me some time.

EDIT: Messing with it. I'm pretty sure that I can fix this. Just give me some time.

Also, how do you select which item to add to the actor's inventory? I place the cursor over the item, then go into the cache and press the button, but it always adds the first item.
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

I just commented the sdk because I'm not using it. If you can figure this out, that would be great.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 16, 2009, 06:46:22 pm
I just commented the sdk because I'm not using it. If you can figure this out, that would be great.


Ok, I figured out adding items.

Don't worry, Yin. I'll fix it. That's a definite.

So you want me to combine the two scenes, and fix the items's showing up in battle and consumption?



I have NO LIFE, XD, and I am pretty much working on scripting ALL DAY. I LOOOOVE this stuff, and I'm trying my best to learn it to the greatest of my ability. I've come pretty far. Point being, I can work on this all day for the next several days. With any luck, should be done anytime between today and the next two or three. Sorry for the wait ><

^_^


EDIT:

Ok Yin, I think I just figured out why it's drawing multiple entries of the same item. Very simple mistake, really. Just trying to come up with a solution. I tried some different numbers of items, and if you'll notice, it draws the item the amount of times that the item exists in that actors cache.

Meaning, in your screenie, you have two potions. Potion shows up twice. If you had twelve, it would show up twelve times.


EDIT AGAIN:

I was right. I've also just fixed that problem. That was fairly easy. I only had to add five letters, too, XD.

Next up is item consumption, which is still occurring. Then, I have to combine the scenes, which'll take a little while.

ANOTHER EDIT (XD):

Think I just figured out why items aren't being consumed. It's because they're not being consumed.

Seriously, I don't think that the script tells the game to take the item from the user's cache, OR the inventory. After the battle, both numbers remain unchanged. Point being, the number display works fine. It's just not using them. Working on it now.


EDIT:

Ok, that part took WAAAAAY longer, but I fixed it (as far as I know.) I've been testing as I go along, and haven't hit any bumps.

Editing the scene now. It's gonna take a while. That picture REALLY helps, though. ^_^

EDIT:

Very nearly done, just have to make the item window display changes to itself as they happen in the new scene, then test the whole system for bugs.

If you can, please let me know whether you want to be able to assign items the old way as well. That's how it's configured atm. You can still go in and "speed assign."

You can still use items like normal. Just push shift, or the A button (configured for A. Shift is default.), just like normal, and 'Q' to toggle between the item menu and the actor's menu. Again, nearly done.


EDIT:

Ok, Yin. I MAY be wrong, but I think that this is what you're wanting:

Spoiler: ShowHide
#==============================================================================
# Seperate Items For Actors
#==============================================================================
# SephirothSpawn
# Version 1
# 2.2.05
# Thanks to Near Fantastica for his Keyboard Module, and  Katzbalger for requesting it
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
#SDK.log("Seperate Items For Actors", "SephirothSpawn", 1, "2.2.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
#if SDK.state("Seperate Items For Actors") == true
 
#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================

module Keyboard
  #--------------------------------------------------------------------------
  @keys = []
  @pressed = []
  Mouse_Left = 1
  Mouse_Right = 2
  Back= 8
  Tab = 9
  Enter = 13
  Shift = 16
  Ctrl = 17
  Alt = 18
  Esc = 27
  Space = 32
  Numberkeys = {}
  Numberkeys[0] = 48
  Numberkeys[1] = 49
  Numberkeys[2] = 50
  Numberkeys[3] = 51
  Numberkeys[4] = 52
  Numberkeys[5] = 53
  Numberkeys[6] = 54
  Numberkeys[7] = 55
  Numberkeys[8] = 56
  Numberkeys[9] = 57
  Numberpad = {}
  Numberpad[0] = 45
  Numberpad[1] = 35
  Numberpad[2] = 40
  Numberpad[3] = 34
  Numberpad[4] = 37
  Numberpad[5] = 12
  Numberpad[6] = 39
  Numberpad[7] = 36
  Numberpad[8] = 38
  Numberpad[9] = 33
  Letters = {}
  Letters["A"] = 65
  Letters["B"] = 66
  Letters["C"] = 67
  Letters["D"] = 68
  Letters["E"] = 69
  Letters["F"] = 70
  Letters["G"] = 71
  Letters["H"] = 72
  Letters["I"] = 73
  Letters["J"] = 74
  Letters["K"] = 75
  Letters["L"] = 76
  Letters["M"] = 77
  Letters["N"] = 78
  Letters["O"] = 79
  Letters["P"] = 80
  Letters["Q"] = 81
  Letters["R"] = 82
  Letters["S"] = 83
  Letters["T"] = 84
  Letters["U"] = 85
  Letters["V"] = 86
  Letters["W"] = 87
  Letters["X"] = 88
  Letters["Y"] = 89
  Letters["Z"] = 90
  Fkeys = {}
  Fkeys[1] = 112
  Fkeys[2] = 113
  Fkeys[3] = 114
  Fkeys[4] = 115
  Fkeys[5] = 116
  Fkeys[6] = 117
  Fkeys[7] = 118
  Fkeys[8] = 119
  Fkeys[9] = 120
  Fkeys[10] = 121
  Fkeys[11] = 122
  Fkeys[12] = 123
  Collon = 186
  Equal = 187
  Comma = 188
  Underscore = 189
  Dot = 190
  Backslash = 191
  Lb = 219
  Rb = 221
  Quote = 222
  State = Win32API.new("user32","GetKeyState",['i'],'i')
  Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
  #--------------------------------------------------------------------------
  def Keyboard.getstate(key)
    return true unless State.call(key).between?(0, 1)
    return false
  end
  #--------------------------------------------------------------------------
  def Keyboard.testkey(key)
    Key.call(key) & 0x01 == 1
  end
  #--------------------------------------------------------------------------
  def Keyboard.update
    @keys = []
    @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
    @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
    @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
    @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
    @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
    @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
    @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
    @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
    @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
    @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
    for key in Keyboard::Numberkeys.values
      @keys.push(key) if Keyboard.testkey(key)
    end
    for key in Keyboard::Numberpad.values
      @keys.push(key) if Keyboard.testkey(key)
    end
    for key in Keyboard::Letters.values
      @keys.push(key) if Keyboard.testkey(key)
    end
    for key in Keyboard::Fkeys.values
      @keys.push(key) if Keyboard.testkey(key)
    end
    @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
    @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
    @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
    @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
    @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
    @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
    @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
    @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
    @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
    @pressed = []
    @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
    @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
    @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
    @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
    @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
    @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
    @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
    @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
    @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
    @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
    for key in Keyboard::Numberkeys.values
      @pressed.push(key) if Keyboard.getstate(key)
    end
    for key in Keyboard::Numberpad.values
      @pressed.push(key) if Keyboard.getstate(key)
    end
    for key in Keyboard::Letters.values
      @pressed.push(key) if Keyboard.getstate(key)
    end
    for key in Keyboard::Fkeys.values
      @pressed.push(key) if Keyboard.getstate(key)
    end
    @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
    @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
    @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
    @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
    @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
    @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
    @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
    @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
    @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote)
  end
  #--------------------------------------------------------------------------
  def Keyboard.trigger?(key)
    return true if @keys.include?(key)
    return false
  end
  #--------------------------------------------------------------------------
  def Keyboard.pressed?(key)
    return true if @pressed.include?(key)
    return false
  end
end

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

class Bitmap
  #--------------------------------------------------------------------------
  # * Scale Blt
  #--------------------------------------------------------------------------
  def scale_blt(dest_rect, src_bitmap,
    src_rect = Rect.new(0, 0, src_bitmap.width, src_bitmap.height), opacity = 255)
    w, h = src_rect.width, src_rect.height
    scale = [w / dest_rect.width.to_f, h / dest_rect.height.to_f].max
    ow, oh = (w / scale).to_i, (h / scale).to_i
    ox, oy = (dest_rect.width - ow) / 2, (dest_rect.height - oh) / 2
    stretch_blt(Rect.new(ox + dest_rect.x, oy + dest_rect.y, ow, oh),
      src_bitmap, src_rect )
  end
end

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :items
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_individualactorcache_gameparty_item_number item_number
  #--------------------------------------------------------------------------
  # * Get Number of Items Possessed
  #     item_id : item ID
  #--------------------------------------------------------------------------
  def item_number(item_id)
    # If In Battle, loads Active Battler Numbers
    if $game_temp.in_battle
      n = 0
      for item in $scene.active_battler.item_cache
        if item.id == item_id
          n += 1
        end
      end
      return n
    else
      # If quantity data is in the hash, use it. If not, return 0
      return @items.include?(item_id) ? @items[item_id] : 0
    end
  end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :item_cache
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_individualactorcache_gameactor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup(actor_id)
    # Sets Item Cache
    @item_cache = []
    # Original Actor Setup Method
    seph_individualactorcache_gameactor_setup(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Assign Item
  #     item_id : Items ID #
  #--------------------------------------------------------------------------
  def assign_item(item_id)
    item = $data_items[item_id]
    unless item.nil?
      @item_cache << item
      @item_cache.sort! {|a, b| a.id<=>b.id}
      item_number = $game_party.items.include?(item_id) ? $game_party.items[item_id] : 0
      $game_party.items[item_id] = [[item_number - 1, 0].max, 99].min
    end
  end
  #--------------------------------------------------------------------------
  # * Unassign Item
  #     item_id : Items ID #
  #--------------------------------------------------------------------------
  def unassign_item(item_id)
    item = $data_items[item_id]
    unless item.nil?
      if @item_cache.include?(item)
        use_item(item_id)
        $game_party.gain_item(item_id, 1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Use Item
  #     item_id : Items ID #
  #--------------------------------------------------------------------------
  def use_item(item_id)
    item = $data_items[item_id]
    unless item.nil?
      for i in 0...@item_cache.size
        if item == @item_cache[i]
          @item_cache.delete_at(i)
          break
        end
      end
    end
  end
end

=begin
#==============================================================================
# ** Game_Actors
#==============================================================================
class Game_Actor
 
  def item_can_use?(item_id)
    for index in 0...actor.item_cache.size
      if actor.item_cache[index].id == item_id then item_cache_id = index
      else next
      end
    end
    if item_cache_id = nil then return false ; end
    # If item quantity is 0
    if actor.item_cache.values_at(item_cache_id).to_s == 0
      # Unusable
      return false
    end
    # Get usable time
    occasion = $data_items[item_id].occasion
    # If in battle
    if $game_temp.in_battle
      # If useable time is 0 (normal) or 1 (only battle) it's usable
      return (occasion == 0 or occasion == 1)
    end
    # If useable time is 0 (normal) or 2 (only menu) it's usable
    return (occasion == 0 or occasion == 2)
  end
end
=end
#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :active_battler

# Redefines the method that consumes items, instead taking from the actor.
def make_item_action_result
  def make_item_action_result
    # Get item
    @item = $data_items[@active_battler.current_action.item_id]
    # If unable to use due to items running out
    unless $game_party.item_can_use?(@item.id)
      # Shift to step 1
      @phase4_step = 1
      return
    end
    # If consumable
    if @item.consumable
      # Stores ONE of the indices of the item being used.
      index = @active_battler.item_cache.index(@item)
      # Turns that item into nil...
      @active_battler.item_cache[index] = nil
      # Cuts the nil out of the inventory. This way, you only lose one item
      # And not the whole stack.
      @active_battler.item_cache.compact!
    end
    # Display item name on help window
    @help_window.set_text(@item.name, 1)
    # Set animation ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # Set common event ID
    @common_event_id = @item.common_event_id
    # Decide on target
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # Set targeted battlers
    set_target_battlers(@item.scope)
    # Apply item effect
    for target in @target_battlers
      target.item_effect(@item)
    end
  end
  end
  end
#==============================================================================
# ** Window_Item
#==============================================================================

class Window_Item < Window_Selectable
  # Redefines initialize, allowing specification of the window size and position
   def initialize(x=0, y=64, wid=640, hei=416)
    super(x, y, wid, hei)
    @column_max = 2
    refresh
    self.index = 0
    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # For Out Of Battle Use
    unless $game_temp.in_battle
      # Add item
      for i in 1...$data_items.size
        if $game_party.item_number(i) > 0
          @data.push($data_items[i])
        end
      end
      # Adds In Actor Item Cache
      for actor in $game_party.actors
        for item in actor.item_cache
          @data << item unless @data.include?(item)
        end
      end
      # Also add weapons and items if outside of battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    # For In Battle Use
    else
      for item in $scene.active_battler.item_cache
        @data << item
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.uniq.size
    @data.uniq!
    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

#==============================================================================
# ** Window_ItemCacheHeading
#==============================================================================

class Window_ItemCacheHeading < Window_Base
  #--------------------------------------------------------------------------
  # * Constant
  #--------------------------------------------------------------------------
  DRAW_CHARACTER = true
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor_index)
    super(actor_index * 160, 64, 160, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @frame = 0
    refresh(@actor = $game_party.actors[actor_index])
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(actor = @actor)
    self.contents.clear
    @actor = actor
    return if @actor.nil?
    # Draws Actors Name
    self.contents.draw_text(4, 0, contents.width - 8, 32, @actor.name, 1)
    # Draws Actors Sprite
    if DRAW_CHARACTER
      draw_sprite(0, 32, 128, 96, @actor.character_name, @actor.character_hue, 0, @frame)
    else
      bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
      self.contents.scale_blt(Rect.new(0, 32, 128, 96), bitmap)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If Character Sprite
    if DRAW_CHARACTER
      if Graphics.frame_count % 10 == 0
        @frame == 3 ? @frame = 0 : @frame += 1
        refresh
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Sprite
  #--------------------------------------------------------------------------
  def draw_sprite(x, y, w, h, name, hue, stance, frame)
    # Gets Bitmap
    bitmap = RPG::Cache.character(name, hue)
    # Bitmap Division
    cw, ch = bitmap.width / 4,  bitmap.height / 4
    # Gets Animation Offsets
    x_off, y_off = cw * frame, ch * stance
    # Draws Bitmap
    self.contents.scale_blt(Rect.new(x, y, w, h), bitmap, Rect.new(x_off, y_off, cw, ch))
  end
end

#==============================================================================
# ** Window_ItemCache
#==============================================================================

class Window_ItemCache < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor_index)
    super(actor_index * 160, 224, 160, 5 * 32)
    @actor = $game_party.actors[actor_index]
    refresh
    self.index = 0
    self.active = false
  end
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Adds In Actor Item Cache
    @actor.item_cache.sort! {|a, b| a.id<=>b.id}
    for item in @actor.item_cache
      @data << item
    end
    # If item count is not 0, make a bit map and draw all items
    @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
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item, y = @data[index], index * 32
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(0, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(32, y, 212, 32, item.name)
  end
end

#==============================================================================
# ** Scene_ActorCache
#==============================================================================

class Scene_ItemCache
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
      @help_window.set_text('Select Item To Unassign', 1)
      # Create the item window, and fit it to the remaining portion of the screen
      @item_window = Window_Item.new(0, 224 + 5*32, 640, 480 - 64 - 160 - (5*32))
    @item_window.active = false
    @scene_objects = [@help_window, @item_window]
    # Creates a new array to store the actor inventories in
    @cache_objects = []
    for i in 0..3
      eval "@actor_#{i}_heading = Window_ItemCacheHeading.new(#{i})"
      eval "@scene_objects << @actor_#{i}_heading"
      eval "@actor_#{i}_cache = Window_ItemCache.new(#{i})"
      eval "@scene_objects << @actor_#{i}_cache"
      eval "@cache_objects << @actor_#{i}_cache"
    end
    @actor_0_cache.active = true
    @actor_index = 0
    # Execute transition
    Graphics.transition
    # Main loop
    while $scene == self
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Updates Scene Objects
      @scene_objects.each {|x| x.update}
      # Frame update
      update
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose Scene Objects
    @scene_objects.each {|x| x.dispose}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If B button is pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new
    end
    # Only carry out these commands if the item window is NOT active,
  unless @item_window.active == true
    # If C button is pressed
    if Input.trigger?(Input::C)
      item = eval "@actor_#{@actor_index}_cache.item"
      if item.nil?
        # Plays Buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Plays Decision SE
      $game_system.se_play($data_system.decision_se)
      # Usassins Item
      $game_party.actors[@actor_index].unassign_item(item.id)
      @item_window.refresh
      # Refreshes Window
      eval "@actor_#{@actor_index}_cache.refresh"
    end
    # If Left or Right Buttons Are Pressed
    if Input.trigger?(Input::LEFT)
      # Plays Cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Deativates Current Window
      eval "@actor_#{@actor_index}_cache.active = false"
      # Changes Window Index
      @actor_index == 0 ? @actor_index = 3 : @actor_index -= 1
      # Actives New Window
      eval "@actor_#{@actor_index}_cache.active = true"
    elsif Input.trigger?(Input::RIGHT)
      # Plays Cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Deativates Current Window
      eval "@actor_#{@actor_index}_cache.active = false"
      # Changes Window Index
      @actor_index == 3 ? @actor_index = 0 : @actor_index += 1
      # Actives New Window
      eval "@actor_#{@actor_index}_cache.active = true"
    end
  end
    # If A button is pressed
    if Input.trigger?(Input::A)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Item Cache screen
      $scene = Scene_Item.new
      return
    end
    # if the L button is pressed
    if Input.trigger?(Input::L)
      # determine whether any of the actor item windows are active
      active = @cache_objects.collect do |object|
        eval "object.active == true"
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Swap the control of the windows
      if @item_window.active == true then @item_window.active = false
      elsif @item_window.active == false then @item_window.active = true
      end
      # If the active window is any of the caches, make it inactive. Swap the activity.
       if active.include?(true) then @cache_objects.each {|obj| obj.active = false}
        elsif !active.include?(true) then eval "@actor_#{@actor_index}_cache.active = true"
      end
    end
   
    # Only accept these commands if the active window is the item window
    if @item_window.active == true
     
     
    # Updates Near's Keyboard Module
    Keyboard.update
    # Assign To Player 1
    if Keyboard.trigger?(Keyboard::Numberkeys[1])
      # If Actor is nil
      if $game_party.actors[0].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[0].assign_item(@item_window.item.id)
      @actor_0_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 2
    if Keyboard.trigger?(Keyboard::Numberkeys[2])
      # If Actor is nil
      if $game_party.actors[1].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[1].assign_item(@item_window.item.id)
      @actor_1_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 3
    if Keyboard.trigger?(Keyboard::Numberkeys[3])
      # If Actor is nil
      if $game_party.actors[2].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[2].assign_item(@item_window.item.id)
      @actor_2_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 4
    if Keyboard.trigger?(Keyboard::Numberkeys[4])
      # If Actor is nil
      if $game_party.actors[3].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[3].assign_item(@item_window.item.id)
      @actor_3_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    end
  end
end

#==============================================================================
# ** Scene_Item
#==============================================================================

class Scene_Item
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_individualactorcache_sceneitem_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Updates Near's Keyboard Module
    Keyboard.update
    # Assign To Player 1
    if Keyboard.trigger?(Keyboard::Numberkeys[1])
      # If Actor is nil
      if $game_party.actors[0].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[0].assign_item(@item_window.item.id)
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 2
    if Keyboard.trigger?(Keyboard::Numberkeys[2])
      # If Actor is nil
      if $game_party.actors[1].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[1].assign_item(@item_window.item.id)
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 3
    if Keyboard.trigger?(Keyboard::Numberkeys[3])
      # If Actor is nil
      if $game_party.actors[2].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[2].assign_item(@item_window.item.id)
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 4
    if Keyboard.trigger?(Keyboard::Numberkeys[4])
      # If Actor is nil
      if $game_party.actors[3].nil?
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se)
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se)
      # Assigns Item
      $game_party.actors[3].assign_item(@item_window.item.id)
      # Refreshs Window
      @item_window.refresh
    end
    # If A button is pressed
    if Input.trigger?(Input::A)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to item screen
      $scene = Scene_ItemCache.new
    end
    # Orginal Update Method
    seph_individualactorcache_sceneitem_update
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
#end


Just replace what you had SAVE A COPY OF THE OLD VERSION, just in case you want me to make any changes, so that I have a "backup".

Well, wait....there's already one in your earlier post.

Ok then, just replace what you had. That should work just fine. I tested it myself.

When you are in the Scene that lets you assign items to the characters, press Q to toggle between the item window and the character window. Once you're on the item window, you can press the numbers to assign. You can still assign things the old way, as a "speed method", just in case you need/want the option.

Please tell me if you have any problems, or want anything else. That was actually really fun, and I learned a lot. Thanks, Yin ^_^.


And, btw, you're officially my first script help-ee.

^_^
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

OK, I've been trying to say thank you since this.
-
ANOTHER EDIT (XD):

Think I just figured out why items aren't being consumed. It's because they're not being consumed.

Seriously, I don't think that the script tells the game to take the item from the user's cache, OR the inventory. After the battle, both numbers remain unchanged. Point being, the number display works fine. It's just not using them. Working on it now.
-

My internet has been acting like a bitch. So hopefully this post goes through.
Thank YOU! You are getting done in a few seconds what I couldn't even figure out in weeks.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 16, 2009, 10:08:29 pm
OK, I've been trying to say thank you since this.
-
ANOTHER EDIT (XD):

Think I just figured out why items aren't being consumed. It's because they're not being consumed.

Seriously, I don't think that the script tells the game to take the item from the user's cache, OR the inventory. After the battle, both numbers remain unchanged. Point being, the number display works fine. It's just not using them. Working on it now.
-

My internet has been acting like a bitch. So hopefully this post goes through.
Thank YOU! You are getting done in a few seconds what I couldn't even figure out in weeks.


Yes, that got through. It's ABOSLUTELY no problem at all. It gave me something to do, taught me a good bit, and allowed me to help someone out ^_^.

If you have anything else, just drop me a line.

Please remember to test it and see if it works to your specifications. If not, tell me, and I'll fix it. Now that I know my way around the script, and have layed framework, it shouldn't take long to fix any potential problems.
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

I'll test it out now, and I'm glad to have helped you and get help at the same time lol.

Works perfectly when in a new project, but in mine, I get a no method error for nil class on line 571. Line 571 is
@actor.item_cache.sort! {|a, b| a.id<=>b.id}
Maybe it's just not compatible with my setup.  :'(
I'll see what I can do to fix it.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 16, 2009, 10:29:05 pm
I'll test it out now, and I'm glad to have helped you and get help at the same time lol.


^_^

Just lemme know when you're done. Again, if you need anything fixed, or would like anything added, lemme know. It's no trouble at all ^_^
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 16, 2009, 10:55:10 pm
Lol, I editted my post while you was writing that.


XD

Ok, I'm not entirely sure on this one, so I'll need one of two things:

1. Is there any way that you can PM me a link to your project? That would be optimal.

If you don't want to do that, then I need several questions answered, which STILL may not be enough. One is Sure-Fire.

2. How many actors are in the party? Which scripts do you have included in your game, and what are they? (IE CMS, CBS, Fishing system, etc). When are you receiving the error? Instantly? When you try to add items? When you add 1,337 items?

The more info the better ^_^

Not sure how much you know about scripting, but your game is pretty much saying that the method sort! (or id), which works on arrays, doesn't work on nil. What that means is that either item_cache, @actor, a, or b is nil, for some reason.

Curious.

Especially since I didn't add that line. Meaning it was already there. Meaning, if that worked BEFORE my edit, something that I did is returning nil.


Again, if you can send me your project, then I can probably fix it within 10 mins-1 hr.




Beyond that, how was it in the new project? Was it what you needed/wanted?
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

In the new project it was perfect! Do you mind if I have that demo tomorrow, I took nyquil and it's starting to kick in. :>.<:
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 16, 2009, 11:20:23 pm
In the new project it was perfect! Do you mind if I have that demo tomorrow, I took nyquil and it's starting to kick in. :>.<:


XD, if anyone should have to ask about putting it off, it should be me. (You're the one having it done, so you don't have to ask.)

Sure, upload it at your leisure, and I'll check it. ^_^

G'night.
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

OK! I'm up! It's 7:43 lol. That nyquil had me out cold. I'll put the demo up in a bit.

I've been doing process of elimination, and I know it is not the battle system that is causing the problem. When I get to the source, I'll post it because if I put it in a demo, it's gonna be like 400 mb lol. So, yeah... I'll send it when I find out what's causing this.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Quote from: Yin on June 17, 2009, 07:43:53 pm
OK! I'm up! It's 7:43 lol. That nyquil had me out cold. I'll put the demo up in a bit.

I've been doing process of elimination, and I know it is not the battle system that is causing the problem. When I get to the source, I'll post it because if I put it in a demo, it's gonna be like 400 mb lol. So, yeah... I'll send it when I find out what's causing this.

Thank you, and thank you for doing that part for me.

7:43?!?!?!

AM?!?!?

It's 8ish PM over here.
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)