[Resolved!] Actors With Separate Items

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

Previous topic - Next topic

Yin

7:43 PM lol
OK, as I was playing with it some more, I realized that I can assign items even when in the item cache it won't update until you press q though. And I'm trying to make this my item screen so, I removed the other scene item, but now I can't figure out how to make them use the item from the menu.
Newly formed MUGEN, RPG Maker, and BOR forum.
http://cavernofcreativity.com
Opening in September
My Partner in crime = TREXRELL

Seox

Ok, Let me go back and fix it then. Didn't know that you ONLY wanted that item menu.

I know how to let you use items from that screen, easy. Just wait up. The update thing is strange....it updated automatically for me.

WAIT! When you push shift to go to the cache, you have to press Q, which will switch your control to the item menu at the bottom. I can make that a different key, if you want (I'll set it to shift, since the normal item scene won't exist.) THEN you push the number keys over whatever item you want, and it SHOULD instantly fill up the cache.

Ok, getting to work now.

Still getting that error?
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

Yeah, I'm still eliminating things from the list going by most probable to least probable to be causing the problem.
And I mean as soon as you go into the cache menu nobody has any items, but there's items in the party's item section. I can press 1,2,3,4 while still in the cache section and it will add the first item on the list until it can't add anymore then the next until there's no more. I can do that while I'm not even in the party item section and it doesn't update until you press q to switch windows.
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, 10:40:05 pm
Yeah, I'm still eliminating things from the list going by most probable to least probable to be causing the problem.
And I mean as soon as you go into the cache menu nobody has any items, but there's items in the party's item section. I can press 1,2,3,4 while still in the cache section and it will add the first item on the list until it can't add anymore then the next until there's no more. I can do that while I'm not even in the party item section and it doesn't update until you press q to switch windows.


Gotta be a conflicting script problem. On a new project, it works fine. Is there any way that you can make a copy of your project, and then delete ALL music and pictures on that project to "slim it down", then send it to me? I can guarantee you that there's a really good chance of my succeeding if you can do that.


EDIT: So I take it you want to select "items" on the menu and go straight to this?
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

I'd send my scripts.rxdata, but then if you tried to play it, you'd get all types of missing graphics errors. if you want to work on it JUST by looking at the scripts that I have and not playing at all, then I can just send that, but then how would you know if it works? lol
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, 10:47:37 pm
I'd send my scripts.rxdata, but then if you tried to play it, you'd get all types of missing graphics errors. if you want to work on it JUST by looking at the scripts that I have and not playing at all, then I can just send that, but then how would you know if it works? lol


Gotta be a way....

Try to figure out which one it is. I guess that the best/only way is to find the conflicting script. And also, try to figure out which one is preventing you from adding items from the item window at the bottom.

Thanks ^_^


EDIT: Are you SURE that when you open the cache, you're pressing Q FIRST, THEN pushing numbers to assign items? I tried assigning, then Q, and it did exactly what you say is the problem. You know, I just went into it and pressed 11111, then Q, and the first actor got 5 potions. Try reversing it.
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

I can add items perfectly fine, but I am able to do it even when I am not in the item window (the one on the bottom).
Well, that's odd, I just removed all the scripts and put them back in 1 by 1 and no more error...  :???:
Same order and everything. I'm puzzled. :wacko:

EDIT: Just read your edit. Yeah that's what is happening. I can go in and just press 1111 and it will add items. It just won't update until you press q. I should not be able to add items from there. Only unassign.

Oh, and OOOOOne more thing!  :^_^': I know, I know, I'm probably just bugging you now. When the item window is active, can you make it display the description in the help window instead of unassign item?

Just read your other edit.
Yeah, I already got it to go straight to the item cache screen. I just renamed it scene_item.
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, 11:15:04 pm
I can add items perfectly fine, but I am able to do it even when I am not in the item window (the one on the bottom).
Well, that's odd, I just removed all the scripts and put them back in 1 by 1 and no more error...  :???:
Same order and everything. I'm puzzled. :wacko:

EDIT: Just read your edit. Yeah that's what is happening. I can go in and just press 1111 and it will add items. It just won't update until you press q. I should not be able to add items from there. Only unassign.


But, if you push Q first, then push numbers, will it AUTOMATICALLY cache them?

I just overwrote Scene_Item. Working on it, no worries ^_^.

I'm glad that there's no error anymore...makes it MUCH easier to deal with.


Go ahead and tell me, in AS MUCH detail as possible, the problems you are having, and what you want me to do as far as fixes (like making it the only item menu)


Oh yeah, and I fixed it so that you can use items in the menu now.


Would you like for you to start where you are in the item menu, or the cache menu?


EDIT:
You think you're bugging me? LOLOLOLOLOLOLOL

Seriously, You're not. I'm having fun trying to solve this problem.


Yeah, about the help window/item description thing. I already did that around 15 mins ago, because it looks WAY better. right now, some unexpected glitches came up. One of em is the unconsumability problem, and the other is the fact that when you get out of battle after having (tried) to use an item, ALL of that item is gone. It keeps EATING 80 something of them. It's ridiculous. I'm working on it now.


But yeah, DO NOT WORRY - just tell me if you need/want ANYTHING else. I'd rather you get EXACTLY what you want, then "preten", just to be polite, especially when I'm actually enjoying working on it. No worries ^_^
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

No, if I press q it switches to the item window and everything works well. I'd like for it to start in the item window first. Right now, since I got rid of the error (somehow), the only problem is the adding items while the cache is active. Everything else you are either working on, or are done with.

EDIT:
LOL, you LOL'd a lot and that made me LOL. But yeah, I won't "pretend." And I wonder why that stuff is happening.  :???: That's weird, it just suddenly happened. Maybe you took something out that you shouldn't have?
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, 11:33:01 pm
I'd like for it to start in the item window first.

Easily done - less than two minutes, once I finish with these glitches.
Quote from: Yin on June 17, 2009, 11:33:01 pm
Right now, since I got rid of the error (somehow), the only problem is the adding items while the cache is active. Everything else you are either working on, or are done with.

A little harder, but I'll figure it out.

^_^

No, but I just figured out EXACTLY why it happened >.>

I just made a REALLY dumb mistake.

Script placement is VERY important.

EDIT: Oh, but it's fixed, I believe, so I'm starting on those last few edits.

EDIT AGAIN: Yeah, that fixed it.

EDIT AGAIN: Ok, like I said, I fixed the starting in the item menu thing in around twenty seconds. Literally. Easy edit ^_^.

Working on the problem of adding items while able to remove them in the cache

EDIT: Yeah, this problem is/was EVIL. I THINK I found a workaround....GOD, I'm a genius, XD. Be done soon.


HOPEFULLY, LAST EDIT:

Ok, Yin. I think this is it:
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.clear
    @pressed.clear
  end
  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
    # 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
#==============================================================================
# ** 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_Item
  #--------------------------------------------------------------------------
  # * 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 = true
    @item_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    @scene_objects = [@help_window, @item_window, @target_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 = false
    @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
    active_cache = @cache_objects.collect {|ob| ob.active == true}
    if active_cache.include?(true) then @help_window.set_text('Select Item To Unassign', 1) ; end
   
    keyboard
    # If target window is active: call update_target
    if @target_window.active
      update_target
      return
    end


   
   
    # 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 the L button is pressed
    if Input.trigger?(Input::A)
      # 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"
      if active.include?(true) then @transfers = nil ; end
        end
    end
       
    # Only accept these commands if the active window is the item window
    if @item_window.active == true
      @transfers = true
       # If B button was 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(0)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the item window
      @item = @item_window.item
      # If not a use item
      unless @item.is_a?(RPG::Item)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If it can't be used
      unless $game_party.item_can_use?(@item.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # If effect scope is an ally
      if @item.scope >= 3
        # Activate target window
        @item_window.active = false
        @target_window.x = (@item_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        # Set cursor position to effect scope (single / all)
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      # If effect scope is other than an ally
      else
        # If command event ID is valid
        if @item.common_event_id > 0
          # Command event call reservation
          $game_temp.common_event_id = @item.common_event_id
          # Play item use SE
          $game_system.se_play(@item.menu_se)
          # If consumable
          if @item.consumable
            # Decrease used items by 1
            $game_party.lose_item(@item.id, 1)
            # Draw item window item
            @item_window.draw_item(@item_window.index)
          end
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  end
def keyboard
    # Updates Near's Keyboard Module
    Keyboard.update
    # Assign To Player 1
    if Keyboard.trigger?(Keyboard::Numberkeys[1])
      window = @item_window.active == true
      # If Actor is nil
      if $game_party.actors[0].nil?
        $game_system.se_play($data_system.buzzer_se) if window
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se) if window
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se) if window
      # Assigns Item
      $game_party.actors[0].assign_item(@item_window.item.id) if window
      @actor_0_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 2
    if Keyboard.trigger?(Keyboard::Numberkeys[2])
      window = @item_window.active == true
      # If Actor is nil
      if $game_party.actors[1].nil?
        $game_system.se_play($data_system.buzzer_se) if window
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se) if window
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se) if window
      # Assigns Item
      $game_party.actors[1].assign_item(@item_window.item.id) if window
      @actor_1_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 3
    if Keyboard.trigger?(Keyboard::Numberkeys[3])
      window = @item_window.active == true
      # If Actor is nil
      if $game_party.actors[2].nil?
        $game_system.se_play($data_system.buzzer_se) if window
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se) if window
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se) if window
      # Assigns Item
      $game_party.actors[2].assign_item(@item_window.item.id) if window
      @actor_2_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    # Assign To Player 4
    if Keyboard.trigger?(Keyboard::Numberkeys[4])
      window = @item_window.active == true
      # If Actor is nil
      if $game_party.actors[3].nil?
        $game_system.se_play($data_system.buzzer_se) if window
        return
      end
      if $game_party.item_number(@item_window.item.id) < 1
        $game_system.se_play($data_system.buzzer_se) if window
        @item_window.refresh
        return
      end
      # Plays Decison SE
      $game_system.se_play($data_system.decision_se) if window
      # Assigns Item
      $game_party.actors[3].assign_item(@item_window.item.id) if window
      @actor_3_cache.refresh
      # Refreshs Window
      @item_window.refresh
    end
    end

 
  #--------------------------------------------------------------------------
  # * Frame Update (when target window is active)
  #--------------------------------------------------------------------------
  def update_target
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # If unable to use because items ran out
      unless $game_party.item_can_use?(@item.id)
        # Remake item window contents
        @item_window.refresh
      end
      # Erase target window
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If items are used up
      if $game_party.item_number(@item.id) == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If target is all
      if @target_window.index == -1
        # Apply item effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      # If single target
      if @target_window.index >= 0
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      # If an item was used
      if used
        # Play item use SE
        $game_system.se_play(@item.menu_se)
        # If consumable
        if @item.consumable
          # Decrease used items by 1
          $game_party.lose_item(@item.id, 1)
          # Redraw item window item
          @item_window.draw_item(@item_window.index)
        end
        # Remake target window contents
        @target_window.refresh
        # If all party members are dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If common event ID is valid
        if @item.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @item.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If item wasn't used
      unless used
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end

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


Put it below all of the other Scene_(insert name here) scripts, but above everything else, or you'll get that error that I MAGICALLY got. I tested it A LITTLE, and it seems to be working fine. Items are being consumed, drawing right, not taking extra. Help window shows item description in the item window, and "blah blah unassign" in the cache window. You can't add items FROM the cache, only unassign. The normal item menu has been replaced with this one. I think that's all, but there may well be a stupid little bug hiding somewhere. If that's the case, tell me, and I'll gladly jump on it. I would test it more (and I will, tomorrow), but I'm dead tired. Sorry, Yin >.<

Good luck with it ^_^. Tell me if it's what you need. Again, don't feel bad. You're only hurting yourself to do that, because you don't get the script which you originally wanted. Don't be afraid to ask for a fix or addition - it's my pleasure.

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

Yin

Thanks! Good Night. I'll be sure to test it again. and thoroughly. I'll post my results tomorrow because I'm a bit tired too.
Again, thanks!

EDIT: So far, no problems! I think I can handle the rest of the little tweaks. Like having the status window for target select only appear on the right side. I fixed that already.
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 18, 2009, 12:45:12 am
Thanks! Good Night. I'll be sure to test it again. and thoroughly. I'll post my results tomorrow because I'm a bit tired too.
Again, thanks!


Crap! Sorry, Yin. I was dead tired last night. Remember to DELETE THE OLD SCENE_ITEM, or you'll probably get some crazy errors. However, DO NOT put this script in the same spot, or, again, crazy errors. It needs to go at the bottom of all of the Scenes. Specifically, it needs to go UNDER scene_battle. That's what threw those crazy errors for me.

That should work, and it's no problem at all ^_^. If you ever need any additions to this, or help with edit-ing another script, don't hesitate to ask me. I had fun - you're not a jerk, like some people who "request" demand.



Besides, I checked the dates on this. I wanted to help someone who had waited a decent length of time. You fit the bill ^_^. Thank you for your patience!
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)

Yin

No, thank YOU! I don't know how I can repay you! I'm not really good at anything lol. Well, I can probably whip you up a game over screen or something. If you need anything like that, I'll be willing to help. Some examples of my work are here: http://punkid89.b1.jcink.com/index.php?showtopic=896
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 18, 2009, 12:22:30 pm
No, thank YOU! I don't know how I can repay you! I'm not really good at anything lol. Well, I can probably whip you up a game over screen or something. If you need anything like that, I'll be willing to help. Some examples of my work are here: http://punkid89.b1.jcink.com/index.php?showtopic=896


Actually, I COULD use something like that. Graphically, I suck!

I'll check it out, and thanks for the offer ^_^.

Really though, what you just said is exactly what I did this for. All I wanted was to use my newfound talents to help someone in need, and that you appreciate it is all the payment that I could EVER ask for. I really did enjoy working with you - you're very gracious, and not at all bothersome. Thank you for giving me work, and being very friendly during it. Next time you get a request, PM me a link. I really did have fun!

^_^

                                -Seox

EDIT:

If you don't mind, I could REALLY use a title screen.

http://images.google.com/images?hl=en&q=huguenot%20cross&um=1&ie=UTF-8&sa=N&tab=wi

Those are pictures of the huguenot cross. In my game, it's a medal known as The Valor Dove. It's worth WAY more than the medal of honor, and signifies the valor of a soldier, but the docile nature of a dove, in that they fought like they should have, but kept their humanity and did not BUTCHER. In short, they displayed AMAZING honor and will.

The name of the game is also The Valor Dove. I'd just like the huguenot cross, and the title, with maybe a really cool background or something. I dunno. Point being, the words and the picture, and, other than that, surprise me.


If you don't like titles, I still don't have a good game over screen. My game is a post-modern military RPG. I was thinking maybe a DARK gray metallic looking screen, that maybe slightly gradients. It says in cold, hard, (stenciled, maybe?) letters, "GAME OVER", with, possibly, some bullet holes in the metal surface.

That's if you don't mind ^_^. Don't at all feel obligated!

Thank you for the offer, at any rate ^_^/
... (<<<<<<<<<<<<<<< TEH DOTS OF DOOM. Hey, kinda catchy. :naughty:)