Multiple Inventory (Problems)

I'm currently trying to rig a multiple inventory system into RPGVXA, but I'm limited on what scripts I could find, and the only one that seems worthy has very confusing installation instructions: Himes Actor Inventory Script (with the Menu, Battle, and Shop Window edits).

I'm not sure if there is a better way to segment the inventory between two actors, other than the script I am trying above. In particular with Himes Actor Inventory, I'm not understanding what to change or replace with the (Menu, Battle, and Shop Window settings), as trying to crashes the game when I go through with it. Without the MBS changes, the script on its own does not function correctly if I try to rely on its script calls instead either, so I'm assuming I need to change all the settings for it to behave as intended.

Here are the text scripts I am working with.

Availible Script Calls:
gain_weapon(id, amount, actor_id)
gain_armor(id, amount, actor_id)
gain_item(id, amount, actor_id)
lose_weapon(id, amount, actor_id)
lose_armor(id, amount, actor_id)
lose_item(id, amount, actor_id)

I started first with the "Core Inventory" followed by "ActorInventory." The remaining 3 are not exactly standalone scripts from my understanding, but rather changes to other script windows. Problem is, what to replace, where to replace, and how much of something to replace/add is unclear to me. It feels like I'm doing it wrong, and the crash window tells me as much.

Also, I'm not sure if this is included with the changes, but if possible, I want the gold to be separated by actors as well. It's not the end of the world if it can't be though.

Source files: https://himeworks.com/2013/07/actor-inventory/
The order the scripts are on TsukiHime's page is generally the order they go in.
You also missed a link as you could have obtained those scenes into one file.
Not that you should post the scripts here, that just leads to the possibility of changed code getting distributed making things difficult for others if they were to use the altered code instead of the original on Hime's site.
But the order would be
Core inventory
Actor inventory
Menu
Battle
Shop
scripts you add always go below materials and above main in the script list.
You also missed a link as you could have obtained those scenes into one file.
Thank you. I went back and saw that, installed it as a script. Now I wonder if the gold can be devided in the same way, but it's not the end of the world if it cannot; there are ways around that I'm sure.
Not that you should post the scripts here, that just leads to the possibility of changed code getting distributed making things difficult for others if they were to use the altered code instead of the original on Hime's site.
I disagree. I already specified in this post that whatever I was doing was being done incorrectly. Posting the scripts was to show what process I was gunning for as a means of troubleshooting for those that understand them better than I do, and in the end, it led to someone (you) noticing an easy and careless mistake on my part; that I should look at everything more carefully and less rushed.

That being said, any scripts that are directly posted in threads here usually are modified (or different from personal copies of the scripts) as you suggest. But I'm one to expect these differences all the time since scripts generally do get chnaged around for personal project use.

It's worth reading through every reply to see what the progression if any is in any thread of interest.
I can now say that the use of CoreInventory, ActorInventory, and the 1-file Scenepackage script
(http://himeworks.com/redirect.php?type=script&name=Actor_Inventory_Scenes)
installed in that order works and solves most of the problems.
{Update}
I've played with this a bit, and the shop scene is not allowing a two-actor party to buy for either actor, only the party leader. The menu item selection works as intended, just not for shop processing. If I select buy, I would like to determine who I am buying items for. I'm not sure what in the script is missing...
I haven't used the scripts personally, but can you swap actors in the shop with L and R buttons?
I haven't used the scripts personally, but can you swap actors in the shop with L and R buttons?
Nope. I've tried the pageup/page down buttons, followed by several random keys to see if any other unknown keybindings were mapped to that function. Nothing.
As soon as the shop processing begins, I am prompted to buy, sell, and cancle. When I select buy, the right side of the screen shows the current (party leader) actor name and items in posession (which is new from before the script was installed). But there appears to be no way from either setting to change the actor that is buying items. Both actors are together (in the party).

{Update}:
Hold on, something new just happened.
This time I confirmed that the pageup/down keys were working (they weren't working before due to a windows setitng), and used them after the inventory shop window was open (after selecting buy). From there, if I use these keys, the game freezes up entirely. Strangely, when I repeat this process after the crash and open the buy window again, the chosen actor on purchase is automatically set to the second actor (without input.) (I'm loading from a new game each time, so it should not remember this position). Of course, any input on page up or page down crashes the game entirely. No error code, just 100% frozen.
That should at least be more telling than what was going on before.
You have something that is causing a conflict. Try putting these scripts at the bottom of the other custom scripts.
And I just tested these scripts and the shop processing worked fine with pageup and down. no errors
Although you do have to be in the buy or sell window before it works.
Now I wonder if the gold can be devided in the same way
This does what you asked.
Spoiler: Actor Gold Inventory
Ruby:
=begin
#===============================================================================
 Title: Actor Inventory - Gold
 Author: Roninator2
 Latest Revision Date: Mar 29, 2022
--------------------------------------------------------------------------------
 ** Change log
 Mar 29, 2022
   - Removed improper reference
 Mar 28, 2022
   - Fixed lose gold error and added Battle gold/item fix
 Mar 27, 2022
   - Fixed lose gold and added Menu gold fix
 Mar 23, 2022
   - Initial release
--------------------------------------------------------------------------------
 ** Terms of Use
 * Follow Tsukihime's original terms of use
--------------------------------------------------------------------------------
 ** Description
 
 This script is an add on to Hime's Actor Inventory script
 
 You will need to use script calls to add gold to members.
 
 This script does not provide any scenes or windows so you will need to
 install other scripts that will provide those. This script also does not
 provide a way to exchange items between actors.
 
--------------------------------------------------------------------------------
 ** Required
 
 Core - Inventory
 (http://himeworks.wordpress.com/2013/07/27/core-inventory/)
 Actor Inventory
 Shop Inventory
 
--------------------------------------------------------------------------------
 ** Installation
 
 Place this script below Shop Inventory and above Main
 All custom menus should be placed below the actor inventory scenes.

--------------------------------------------------------------------------------
 ** Usage
 
 The following script calls are available:
 
   gain_gold(amount, actor_id)
   lose_gold(amount, actor_id)

 Where `amount` is the amount of you want to add/remove, and
 `actor_id` is the actor that you want to add to or remove from.
 
 Option to show the player name in the shop. Change setting below
 to turn it on or off.
 
#===============================================================================
=end

module R2_Gold_Shop_Actor
 
  Show_Name = true
  Gold_Actors = 4
end

$imported = {} if $imported.nil?
$imported["TH_ActorInventory_Gold"] = true
#===============================================================================
# ** Rest of script
#===============================================================================

class Game_Interpreter
  def gain_gold(amount, actor_id)
    $game_actors[actor_id].gain_gold(amount)
  end
  def lose_gold(amount, actor_id)
    $game_actors[actor_id].lose_gold(amount)
  end
end

class Game_ActorInventory < Game_Inventory
  attr_accessor :gold
  alias r2_actor_inventory_gold_addon initialize
  def initialize(actor)
    r2_actor_inventory_gold_addon(actor)
    @gold = 0
  end
  def gain_gold(amount)
    @gold += amount
  end
end

class Game_Actor < Game_Battler
  def inventory_gold
    @inventory.gold
  end
  def gain_gold(amount)
    @inventory.gain_gold(amount)
  end
  def lose_gold(amount)
    @inventory.gold -= amount
  end
end

class Scene_Shop < Scene_MenuBase
  alias :r2_actor_inventory_gold_start :start
  def start
    r2_actor_inventory_gold_start
    create_dummy_actor_window if R2_Gold_Shop_Actor::Show_Name
  end
  def do_buy(number)
    $game_actors[@actor.id].lose_gold(number * buying_price)
    @actor.gain_item(@item, number)
  end
  def do_sell(number)
    $game_actors[@actor.id].gain_gold(number * selling_price)
    @actor.lose_item(@item, number)
  end
  def create_dummy_actor_window
    x = @gold_window.x
    y = @gold_window.y - @gold_window.height + 10
    w = @gold_window.width
    h = @gold_window.height - 10
    @dummy_actor_window = Window_ActorStatus.new(x, y, w, h)
    @dummy_actor_window.viewport = @viewport
    @dummy_actor_window.actor = @actor
  end
  alias :r2_actor_gold_create_gold_window :create_gold_window
  def create_gold_window
    r2_actor_gold_create_gold_window
    @gold_window.actor = $game_party.leader
  end
  alias :r2_actor_inventory_create_command_window :create_command_window
  def create_command_window
    r2_actor_inventory_create_command_window
    @command_window.set_handler(:pagedown, method(:next_com_actor))
    @command_window.set_handler(:pageup,   method(:prev_com_actor))
  end
  alias :r2_actor_inventory_create_category_window :create_category_window
  def create_category_window
    r2_actor_inventory_create_category_window
    @category_window.set_handler(:pagedown, method(:next_cat_actor))
    @category_window.set_handler(:pageup,   method(:prev_cat_actor))
  end
  def on_actor_command_change
    @gold_window.actor = @actor
    @gold_window.refresh
    @dummy_actor_window.actor = @actor if R2_Gold_Shop_Actor::Show_Name
    @dummy_actor_window.refresh if R2_Gold_Shop_Actor::Show_Name
    @status_window.actor = @actor
    @command_window.activate
  end
  def on_actor_category_change
    @gold_window.actor = @actor
    @gold_window.refresh
    @dummy_actor_window.actor = @actor if R2_Gold_Shop_Actor::Show_Name
    @dummy_actor_window.refresh if R2_Gold_Shop_Actor::Show_Name
    @status_window.actor = @actor
    @sell_window.actor = @actor
    @sell_window.refresh
    @category_window.activate
  end
  alias :r2_on_actor_change_gold  :on_actor_change
  def on_actor_change
    @gold_window.actor = @actor
    @gold_window.refresh
    @dummy_actor_window.actor = @actor if R2_Gold_Shop_Actor::Show_Name
    @dummy_actor_window.refresh if R2_Gold_Shop_Actor::Show_Name
    r2_on_actor_change_gold
    @buy_window.money = money
    @buy_window.refresh
    @sell_window.refresh
  end
  def next_com_actor
    @actor = $game_party.menu_actor_next
    on_actor_command_change
  end
  def prev_com_actor
    @actor = $game_party.menu_actor_prev
    on_actor_command_change
  end
  def next_cat_actor
    @actor = $game_party.menu_actor_next
    on_actor_category_change
  end
  def prev_cat_actor
    @actor = $game_party.menu_actor_prev
    on_actor_category_change
  end
end

class Window_Gold < Window_Base
  def initialize
    super(0, 0, window_width, fitting_height(1))
  end
  def value
    $game_actors[@actor.id].inventory_gold
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
end

class Window_ActorStatus < Window_Base
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item = nil
    @page_index = 0
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  def refresh
    contents.clear
    draw_actor_info
  end
  def draw_actor_info
    change_color(normal_color)
    draw_text(0, 0, 160, line_height, @actor.name, 1)
  end
  def line_height
    return 24
  end
  def standard_padding
    return 5
  end
end

class Scene_Menu < Scene_MenuBase
  def create_gold_window
    @gold_window = Window_MenuGold.new
    @gold_window.x = 0
    @gold_window.y = Graphics.height - @gold_window.height
  end
end

class Window_MenuGold < Window_Base
  def initialize
    super(0, 0, window_width, fitting_height(R2_Gold_Shop_Actor::Gold_Actors))
    refresh
  end
  def window_width
    return 160
  end
  def standard_padding
    return 5
  end
  def refresh
    contents.clear
    @memb = R2_Gold_Shop_Actor::Gold_Actors
    for i in 0..@memb - 1
      next if $game_party.members[i].nil?
      id = $game_actors[$game_party.members[i].id].id
      actor = $game_actors[id]
      change_color(normal_color)
      draw_text(0, line_height * i, 160, line_height, actor.name, 0)
      draw_currency_value(value(id), currency_unit, 4, line_height * i, contents.width - 8)
    end
  end
  def value(id)
    $game_actors[id].inventory_gold
  end
  def currency_unit
    Vocab::currency_unit
  end
  def open
    refresh
    super
  end
end

module BattleManager
  def self.gain_gold
    if $game_troop.gold_total > 0
      div = $game_party.battle_members.size
      funds = ($game_troop.gold_total / div).to_i
      text = sprintf(Vocab::ObtainGold, funds)
      $game_message.add('\.' + text)
      $game_party.battle_members.each do |actor|
        actor.gain_gold(funds)
      end
    end
    wait_for_message
  end
  def self.gain_drop_items
    div = $game_party.battle_members.size
    $game_troop.make_drop_items.each do |item|
      act = rand(div)
      $game_party.battle_members[act].gain_item(item, 1)
      $game_message.add(sprintf(Vocab::ObtainItem, item.name))
    end
    wait_for_message
  end
end
You have something that is causing a conflict. Try putting these scripts at the bottom of the other custom scripts.
And I just tested these scripts and the shop processing worked fine with pageup and down. no errors
Although you do have to be in the buy or sell window before it works.
I moved it around to ensure these were at the bottom. No real change, other than the game running 5% slower for some reason. Something is causing conflict, I'm just not sure what...

I read some of the script you added in your post after this one, and have more related questions.
** Required Core - Inventory (http://himeworks.wordpress.com/2013/07/27/core-inventory/) Actor Inventory Shop Inventory
This script says that it requires "shop inventory." That itself sounds different from how I have mine set up. Remember the full scene package I missed last time? I downloded and installed that as a single script placed after actor inventory. But if there is a slightly different version of this, they may be part of the problem.
Your link goes to wordpress, and I don't yet have an account there, so it would take me some time to test that out, if they are somehow different.
But basically, I have Core Inventory, then Actor Inventory, then Actor Inventory Scenes in this order. Above these, I have some other scripts which I don't think are responcible, but one of them is Yanfly engine Ace (equipment manager), if it matters.
So if you didn't have the combined scene script, then you will need the shop scene script.

The link is not mine, it's the one from Hime from the original script.

There should not be any lag caused by these scripts. so depending on how many scripts you have, and what they do, there may be something causing a lag.
I have the same issue in my game, but I would have to eliminate more than half my scripts to speed the game up.
So if you didn't have the combined scene script, then you will need the shop scene script.
Ok. I wanted to be sure that wasn't any other condition. I do have the combined scene script.

There should not be any lag caused by these scripts. so depending on how many scripts you have, and what they do, there may be something causing a lag.
Something else was causing lag. Every 100 boots or so the machine I run this on slows to a crawl sometimes. The lag was not been repeated after that day, so it's not the scripts after all.

As for troubleshooting, this still leads me to a deadend. I tried disabling the other custom scripts with this running only to get the same result. I don't know why it's only the shop manager of all things.
I'll keep looking over every aspect. It won't be soon, but I will eventually begin learning what everything in scripts actually means ~ and I mean everything. But that will take a long time to learn. Maybe I find the problem then, much later on. Maybe it is specific to the second actor and not the first. Something somewhere is choking up the entire process.

Also, I tried that gold manager script you sent me too, which is going to be very helpful.
But the gold does not show in the menu. I'm assuming that is because that itself also needs its own scene to be displayed for both actors, right?
I fixed that just now. Script updated.

How are you doing the commands? I have changed nothing in the original scripts and it works perfectly.
1648414767631.png


Can you repeat what the issue is, I kind of lost track, because for me it was the switching actors.
I fixed that just now. Script updated.

How are you doing the commands? I have changed nothing in the original scripts and it works perfectly.
View attachment 221185

Can you repeat what the issue is, I kind of lost track, because for me it was the switching actors.
I'm unclear what you just fixed. This screenshot shows how gold is added to either actor, as well as items. I've gotten this to work and somewhat proven that it does (using remove gold if gold = variable) event.

The problem anyway is more specific to the shop inventory. I'm using the combined scene script, so it should include all 3 (menu, shop, and battle inventory) scenes in one. I've yet to test battling and don't care to yet. Main menu separates inventory as follows: On select "Items" choose actor(s) before displaying what items are availible. ~ This works just fine out of the box.

> When opening a shop to buy, the only actions on screen are "buy," "sell," and "cancle." On select buy: open shop processing for the actor currently displayed (defaulted to current control actor).
Only buttons that switch the actor (before selecting buy) is "Pg Dn" or "Pg Up".
When either of these buttons are pressed, the scene does change to the other actor, and even plays the SE associated with that (default sounds for now). But as soon as this happens, the game freezes. No official crash or error message, just totally frozen.

I've been meaning to ask... Does the Pg Up/down command change the "control" actor rather than just changing who is buying in the shop window?
Because if the "control" actor (actor being controlled by the player) is what is being changed in that moment, then I think it narrows down the problem to some kind of in-area event control conflict. Otherwise, I got no idea.

As for the gold script, it works all fine, minus the gold not being displayed in the now empty frame of the menu, though less significant as it is probably just a missing scene issue.
Can you send me your project? You are doing something wrong.
I can't help you as I've tested the scripts and all is working fine.

But you did raise another thing that would have to be changed - gaining gold in battle.
Each battle member should gain a portion of the gold.

I can work on that after you get me a demo of your project so that I can diagnose and tell/show you what was wrong.

I ask this because you are saying that it does not switch when pressing the pageup or down.
My script has added in that functionality in all areas. buy, sell, category and the default is already controlled - inventory window. (all of this in the shop scene)

you must be having a script conflict. And I would then ask if you've changed any of the default scripts?
If you did you need to have all of those changes documented so that they can be undone and added as separate scripts.

Pageup and down will change the focus of which actor is currently shopping, it will not change the formation.

When you say gold script, are you referring to my script? Did you copy the latest version I posted? I have the menu scene working for showing the players gold count.

*update I made a correction to my script for losing gold. And added on gaining gold and items in battle.

Next I think I need to do a scene for gold swap between members.
I ask this because you are saying that it does not switch when pressing the pageup or down.
My script has added in that functionality in all areas. buy, sell, category and the default is already controlled - inventory window. (all of this in the shop scene)
To be as precise as possible, the window does actually switch. The error occurrs during or after the window has switched, causing the crash. On only two out of 40 occasions, I've somehow managed to get the window to switch and not crash, though the repeat of the process within the same window test crashed it afterwards. I'm mentioning this to make narrowing down the problem easier.
you must be having a script conflict. And I would then ask if you've changed any of the default scripts?
If you did you need to have all of those changes documented so that they can be undone and added as separate scripts.
I will send you as much as I can. Sending a demo would be somewhat difficult since the project is kind of in a state of open surgury; lots of image and audio data is imported, so currently it ranks at about 4.4 GB in size.
I have not changed any of the default scripts to my knowledge, but just to be 110% certain, I will attempt to test this shop issue in another newer project (which would prove no defaults have been altered).
I will send you all of the custom scripts I have added (all of them are activated, deactivating them did nothing, though the Event Export is deactive since I only need it selectivly).
I had strange things happen with the gold manager, so I kept it disabled for a while, just to prove that the root of the problem must be somewhere in the Scene Manager script. And with the Gold Manager Script, I was referring to the one you sent me.
> Found something in Gold Manager, where line 170 looked wierd. It crashed my game, and I added an @ in front of this line (activate_current_window), which stabalized it again. Not sure if this is to anything else, but since the game crashes with the gold script out of the picture, I think it is somehting else.
Pageup and down will change the focus of which actor is currently shopping, it will not change the formation.
Yes, it took me some time to be sure of this. Since it does not change formation, the problem can't be related to any running events in the map. I tripple checked anyway.
When you say gold script, are you referring to my script? Did you copy the latest version I posted? I have the menu scene working for showing the players gold count.
Latest version huh? I copied the one in your post here, where in the script, the author is Hime, and the date is March 23, 2022. But you can check this anyway in the attatchments, as this is included.
Next I think I need to do a scene for gold swap between members.
Good idea. My current project won't need this, but I have intention to start 2 new projects afterwards, and one of which will have a special trading system. It would be of great help to have a trading method this early.

Each battle member should gain a portion of the gold.
Not sure what you meant by this. I have yet to begin testing this, but I imagined using a script call for each end of battle to just add gold individually to each participating character if the battle was won and nobody is dead.
{UPDATE}
I did some more testing and found something interesting, mostly good news.
When I open the shop window, when prompted to buy/sell, using Pg Up and Pg Dn switches actors without crashing. If I however have the buy/sell window already open (showing the list of what is for sale), and then use the same buttons, the game crashes.
Why is it good news? > Because it means what I need is basically possible at present provided I am careful, even if the code is clunky.
Why is it strange? > Because I am 100% certain that I tested Pg Up and Down buttons before opening the shop item list, to have nothing happen on multiple occasions. Only when I tried it in a new project did it work this way in the old one too.
Why were the buttons only toggling after opening the buy window before today? > I have no idea...

Still, if I goof up in the middle of the game, or if I wanted to later polish and sell this, that bug would be a big problem.
Spoiler: Actor Gold Swap
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor Trade Gold             ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function: For trading gold between  ║   Date Created     ║
# ║actors. Requires Hime Actor Inventory╠════════════════════╣
# ║   and Roninator2 Gold Inventory     ║    29 Mar 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to Trade gold between actors                      ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Set the variable below to one you will not use         ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝
module R2_Gold_Trade
  Variable = 10
end

class Scene_Menu < Scene_MenuBase
  alias r2_menu_command_gold_trade  create_command_window
  def create_command_window
    r2_menu_command_gold_trade
    @command_window.set_handler(:trade_gold,    method(:command_trade_gold))
  end
  def command_trade_gold
    SceneManager.call(Scene_Trade_Gold)
  end
end

class Window_MenuCommand < Window_Command
  alias r2_trade_gold_menu_command  add_original_commands
  def add_original_commands
    r2_trade_gold_menu_command
    add_command("Trade Gold",   :trade_gold)
  end
end

class Window_Gold_Trade_Command < Window_HorzCommand
  def initialize(x, y, width)
    @window_width = width
    super(x, y)
    activate
  end
  def window_width
    @window_width
  end
  def col_max
    return 2
  end
  def make_command_list
    add_command("Trade Gold", :trade)
    add_command("Cancel",     :cancel)
  end
end

class Window_Number_Trade < Window_Selectable
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @number = 0
    @digits_max = 1
    @index = 0
    start
  end
  def start
    @digits_max = 7
    @number = $game_variables[R2_Gold_Trade::Variable]
    @number = [[@number, 0].max, 10 ** @digits_max - 1].min
    @index = 6
    create_contents
  end
  def cursor_right(wrap)
    if @index < @digits_max - 1 || wrap
      @index = (@index + 1) % @digits_max
    end
    deactivate
  end
  def cursor_left(wrap)
    if @index > 0 || wrap
      @index = (@index + @digits_max - 1) % @digits_max
    end
    deactivate
  end
  def update
    super
    process_cursor_move
    process_digit_change
    process_handling
    update_cursor
  end
  def process_cursor_move
    if !active
      activate
      return
    end
    return unless active
    last_index = @index
    cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
    cursor_left(Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
    Sound.play_cursor if @index != last_index
  end
  def process_digit_change
    return unless active
    if Input.repeat?(:UP) || Input.repeat?(:DOWN)
      Sound.play_cursor
      place = 10 ** (@digits_max - 1 - @index)
      n = @number / place % 10
      @number -= n * place
      n = (n + 1) % 10 if Input.repeat?(:UP)
      n = (n + 9) % 10 if Input.repeat?(:DOWN)
      @number += n * place
      refresh
    end
  end
  def process_handling
    return unless active
    return process_ok     if Input.trigger?(:C)
    return process_max    if Input.trigger?(:X)
    return process_cancel if Input.trigger?(:B)
  end
  def process_ok
    Sound.play_ok
    $game_variables[R2_Gold_Trade::Variable] = @number
    deactivate
    close
    SceneManager.scene.on_number_ok
  end
  def process_max
    Sound.play_ok
    @number = @actor.inventory_gold
    refresh
  end
  def process_cancel
    Sound.play_cancel
    $game_variables[R2_Gold_Trade::Variable] = 0
    deactivate
    close
    SceneManager.scene.on_number_cancel
  end
  def item_rect(index)
    Rect.new(index * 20, 0, 20, line_height)
  end
  def refresh
    contents.clear
    change_color(normal_color)
    if @number > @actor.inventory_gold
      @number = @actor.inventory_gold
    end
    s = sprintf("%0*d", @digits_max, @number)
    @digits_max.times do |i|
      rect = item_rect(i)
      rect.x += 1
      draw_text(rect, s[i,1], 1)
    end
  end
  def update_cursor
    cursor_rect.set(item_rect(@index))
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
end

class Window_ActorGold < Window_Selectable
  attr_reader :actor
  def initialize(actor)
    super(0, 0, window_width, window_height)
    @actor = actor
    refresh
  end
  def window_width
    return 200
  end
  def window_height
    return 150
  end
  def standard_padding
    return 10
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  def refresh
    contents.clear
    draw_text(0, 0, width, line_height, @actor.name)
    draw_actor_face(@actor, 40, 30)
    draw_actor_gold(@actor, 0, 0)
    draw_left_arrow(0, 70)
    draw_right_arrow(140, 70)
  end
  def value(id)
    $game_actors[id].inventory_gold
  end
  def currency_unit
    Vocab::currency_unit
  end
  def draw_actor_gold(actor, x, y)
    change_color(normal_color)
    draw_currency_value(value(@actor.id), currency_unit, x, y, contents.width - 8)
  end
  def draw_left_arrow(x, y)
    change_color(system_color)
    draw_text(x, y, 40, line_height, "L <-", 0)
  end
  def draw_right_arrow(x, y)
    change_color(system_color)
    draw_text(x, y, 40, line_height, "-> R", 2)
  end
end

class Scene_Trade_Gold < Scene_MenuBase
  def start
    super
    create_scene_window
    create_command_window
    @actor1 = $game_party.battle_members[0]
    @actor2 = $game_party.battle_members[1]
    create_actor_select_window
    create_actor_trade_window
    create_number_window
  end
  def create_scene_window
    @scene_gold_trade_window = Window_Base.new(0, 0, Graphics.width, Graphics.height)
    @scene_gold_trade_window.viewport = @viewport
    @scene_gold_trade_window.deactivate
  end
  def create_command_window
    @command_window = Window_Gold_Trade_Command.new(150, 10, 250)
    @command_window.viewport = @viewport
    @command_window.activate
    @command_window.set_handler(:trade,    method(:command_trade))
    @command_window.set_handler(:cancel, method(:return_scene))
  end
  def create_actor_select_window
    @actor_status_window = Window_ActorGold.new(@actor1)
    @actor_status_window.viewport = @viewport
    @actor_status_window.x = 30
    @actor_status_window.y = 100
    @actor_status_window.actor = @actor1
    @actor_status_window.deactivate
    @actor_status_window.hide
    @actor_status_window.set_handler(:ok,     method(:on_actor_ok))
    @actor_status_window.set_handler(:pageup,   method(:change_actor_before))
    @actor_status_window.set_handler(:pagedown, method(:change_actor_after))
    @actor_status_window.set_handler(:cancel, method(:on_actor_cancel))
  end
  def create_actor_trade_window
    @trade_status_window = Window_ActorGold.new(@actor2)
    @trade_status_window.viewport = @viewport
    @trade_status_window.x = 300
    @trade_status_window.y = 100
    @trade_status_window.actor = @actor2
    @trade_status_window.deactivate
    @trade_status_window.hide
    @trade_status_window.set_handler(:ok,     method(:on_trade_ok))
    @trade_status_window.set_handler(:pageup,   method(:change_actor_before))
    @trade_status_window.set_handler(:pagedown, method(:change_actor_after))
    @trade_status_window.set_handler(:cancel, method(:on_trade_cancel))
  end
  def create_number_window
    @number_window = Window_Number_Trade.new(200, 300, 170, 48)
    @number_window.viewport = @viewport
    @number_window.hide
    @number_window.deactivate
    @number_window.actor = @actor1
    @number_window.set_handler(:ok,     method(:on_number_ok))
    @number_window.set_handler(:max,    method(:max_number_ok))
    @number_window.set_handler(:cancel, method(:on_number_cancel))
  end
  def command_trade
    @command_window.deactivate
    @actor_status_window.show
    @actor_status_window.activate
    @actor_status_window.select(0)
  end
  def on_actor_ok
    @actor1 = @actor_status_window.actor
    @actor_status_window.unselect
    @actor_status_window.deactivate
    @trade_status_window.show
    @trade_status_window.activate
    @trade_status_window.select(0)
  end
  def on_actor_cancel
    @actor_status_window.deactivate
    @actor_status_window.hide
    @command_window.activate
  end
  def on_trade_ok
    text = "Press A to select Max currency"
    @scene_gold_trade_window.draw_text_ex(100, 348, text)
    @actor2 = @trade_status_window.actor
    @trade_status_window.unselect
    @trade_status_window.deactivate
    @number_window.show
    @number_window.open
    @number_window.activate
  end
  def on_trade_cancel
    @trade_status_window.deactivate
    @trade_status_window.hide
    @actor_status_window.activate
    @actor_status_window.select(0)
  end
  def on_number_ok
    trade_gold($game_variables[R2_Gold_Trade::Variable])
    end_number_input
  end
  def on_number_cancel
    Sound.play_cancel
    end_number_input
  end
  def max_number_ok
  end
  def trade_gold(number)
    return if @trade_status_window.active
    $game_actors[@actor1.id].lose_gold(number)
    $game_actors[@actor2.id].gain_gold(number)
    @actor_status_window.refresh
    @trade_status_window.refresh
  end
  def end_number_input
    @scene_gold_trade_window.create_contents
    @number_window.close
    @number_window.deactivate
    @trade_status_window.activate
    @trade_status_window.select(0)
  end
  def change_actor_before
    if @chkwindow == 1
      id = $game_party.members.index(@actor_status_window.actor)
    else @chkwindow == 2
      id = $game_party.members.index(@trade_status_window.actor)
    end
    size = $game_party.members.size
    id -= 1
    id = size - 1 if id < 0
    if @chkwindow == 1
      @actor1 = $game_party.members[id]
      @actor_status_window.actor = @actor1
      @actor_status_window.activate
    elsif @chkwindow == 2
      @actor2 = $game_party.members[id]
      @trade_status_window.actor = @actor2
      @trade_status_window.activate
    end
    @number_window.actor = @actor1
  end
  def change_actor_after
    if @chkwindow == 1
      id = $game_party.members.index(@actor_status_window.actor)
    else @chkwindow == 2
      id = $game_party.members.index(@trade_status_window.actor)
    end
    size = $game_party.members.size
    id += 1
    id = 0 if id > size - 1
    if @chkwindow == 1
      @actor1 = $game_party.members[id]
      @actor_status_window.actor = @actor1
      @actor_status_window.activate
    elsif @chkwindow == 2
      @actor2 = $game_party.members[id]
      @trade_status_window.actor = @actor2
      @trade_status_window.activate
    end
    @number_window.actor = @actor1
  end
  alias r2_trade_gold_update  update
  def update
    r2_trade_gold_update
    if @command_window.active
      @chkwindow = 0
    elsif @actor_status_window.active
      @chkwindow = 1
    elsif @trade_status_window.active
      @chkwindow = 2
    end
  end
end

You are missing part of the scene inventory script.
Spoiler: Scene Inventory
Ruby:
=begin
#===============================================================================
 Title: Actor Inventory Scenes
 Author: Hime
 Date: Mar 10, 2014
--------------------------------------------------------------------------------
 ** Change log
 Mar 10, 2014
   - key item list is pulled from the leader
 Jul 27, 2013
   - Initial release
-------------------------------------------------------------------------------- 
 ** Terms of Use
 * Free to use in non-commercial projects
 * Contact me for commercial use
 * No real support. The script is provided as-is
 * Will do bug fixes, but no compatibility patches
 * Features may be requested but no guarantees, especially if it is non-trivial
 * Credits to Hime Works in your project
 * Preserve this header
--------------------------------------------------------------------------------
 ** Description
 
 This script provides scenes and windows to complement the Actor Inventory
 system. It is based on the default scenes and windows.
 
--------------------------------------------------------------------------------
 ** Required
 
 Actor Inventory
 (http://himeworks.com/2013/07/27/actor-inventory/)
 
--------------------------------------------------------------------------------
 ** Installation
 
 Place this script below Actor Inventory and above Main

--------------------------------------------------------------------------------
 ** Usage
 
 Plug and play.
 
#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_ActorInventoryScenes"] = true
#===============================================================================
# ** Rest of script
#===============================================================================
#-------------------------------------------------------------------------------
# Basic actor inventory scene and windows. Change it so that you first select
# an actor before opening the item menu. The item windows must obtain the data
# from the actor's inventory
#-------------------------------------------------------------------------------
class Window_ItemList < Window_Selectable
 
  alias :th_actor_inventory_initialize :initialize
  def initialize(x, y, width, height)
    th_actor_inventory_initialize(x, y, width, height)
    @actor ||= $game_party.leader
  end
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
 
  def make_item_list
    @data = @actor.all_items.select {|item| include?(item) }
    @data.push(nil) if include?(nil)
  end
 
  def enable?(item)
    @actor.usable?(item)
  end
 
  def select_last
    select(@data.index(@actor.last_item.object) || 0)
  end
 
  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", @actor.item_number(item)), 2)
  end
end

class Scene_Item < Scene_ItemBase
 
  alias :th_actor_inventory_create_category_window :create_category_window
  def create_category_window
    th_actor_inventory_create_category_window
    @category_window.set_handler(:pagedown, method(:next_actor))
    @category_window.set_handler(:pageup,   method(:prev_actor))
  end
 
  alias :th_actor_inventory_create_item_window :create_item_window
  def create_item_window
    th_actor_inventory_create_item_window
    @item_window.actor = @actor
    @item_window.set_handler(:pagedown, method(:next_actor))
    @item_window.set_handler(:pageup,   method(:prev_actor))
  end
 
  #-----------------------------------------------------------------------------
  # Replace
  #-----------------------------------------------------------------------------
  def user
    @actor
  end
 
  #-----------------------------------------------------------------------------
  # Replace
  #-----------------------------------------------------------------------------
  def on_item_ok
    @actor.last_item.object = item
    determine_item
  end
 
  def on_actor_change
    @item_window.actor = @actor
    activate_current_window
  end
 
  #-----------------------------------------------------------------------------
  # Activate the appropriate window depending on which window is currently
  # active
  #-----------------------------------------------------------------------------
  def activate_current_window
    if @item_window.index > -1
      @item_window.activate
    else
      @category_window.activate
    end
  end
end

#-------------------------------------------------------------------------------
# Need to change these as well
#-------------------------------------------------------------------------------
class Scene_Menu < Scene_MenuBase
  def command_item
    command_personal
  end
 
  alias :th_actor_inventory_on_personal_ok :on_personal_ok
  def on_personal_ok
    return SceneManager.call(Scene_Item) if @command_window.current_symbol == :item
    th_actor_inventory_on_personal_ok
  end
end
#-------------------------------------------------------------------------------
# Need to change these as well
#-------------------------------------------------------------------------------
class Window_BattleItem < Window_ItemList
  
  #--------------------------------------------------------------------------
  # * Include in Item List?
  #--------------------------------------------------------------------------
  def include?(item)
    @actor ? @actor.usable?(item) : false
  end
end

class Scene_Battle < Scene_Base
 
  alias :th_actor_inventory_command_item :command_item
  def command_item
    @item_window.actor = BattleManager.actor
    th_actor_inventory_command_item
  end
 
  alias :th_actor_inventory_on_item_ok :on_item_ok
  def on_item_ok
    th_actor_inventory_on_item_ok
    BattleManager.actor.last_item.object = @item
  end
end
#-------------------------------------------------------------------------------
# You must first choose who is going to buy
#-------------------------------------------------------------------------------
class Window_ShopStatus < Window_Base
 
  alias :th_actor_inventory_initialize :initialize
  def initialize(x, y, width, height)
    @actor = nil
    th_actor_inventory_initialize(x, y, width, height)
  end
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
 
  def draw_current_actor(x, y)
    rect = Rect.new(x, y, contents.width - 4 - x, line_height)
    change_color(system_color)
    draw_text(rect, @actor.name)
  end
 
  alias :th_actor_inventory_draw_possession :draw_possession
  def draw_possession(x, y)
    if @actor
      draw_current_actor(x, y)
      rect = Rect.new(x, y + line_height, contents.width - 4 - x, line_height)
      change_color(system_color)
      draw_text(rect, Vocab::Possession)
      change_color(normal_color)
      draw_text(rect, @actor.item_number(@item), 2)
    end
  end
end

class Window_ShopBuy < Window_Selectable
 
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
 
  def enable?(item)
    item && price(item) <= @money && @actor && [email protected]_max?(item)
  end
end

class Window_ShopSell < Window_ItemList
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
end

class Scene_Shop < Scene_MenuBase
 
  alias :th_actor_inventory_start :start
  def start
    th_actor_inventory_start
    @actor = $game_party.leader
  end
 
  alias :th_actor_inventory_create_status_window :create_status_window
  def create_status_window
    th_actor_inventory_create_status_window
    @status_window.actor = @actor
  end
 
  alias :th_actor_inventory_create_buy_window :create_buy_window
  def create_buy_window
    th_actor_inventory_create_buy_window
    @buy_window.actor = @actor
    @buy_window.set_handler(:pagedown, method(:next_actor))
    @buy_window.set_handler(:pageup,   method(:prev_actor))
  end
 
  alias :th_actor_inventory_create_sell_window :create_sell_window
  def create_sell_window
    th_actor_inventory_create_sell_window
    @sell_window.set_handler(:pagedown, method(:next_actor))
    @sell_window.set_handler(:pageup,   method(:prev_actor))
    @sell_window.actor = @actor
  end
 
  #-----------------------------------------------------------------------------
  # Overwrite
  #-----------------------------------------------------------------------------
  def max_buy
    max = @actor.max_item_number(@item) - @actor.item_number(@item)
    buying_price == 0 ? max : [max, money / buying_price].min
  end
 
  #-----------------------------------------------------------------------------
  # Overwrite
  #-----------------------------------------------------------------------------
  def max_sell
    @actor.item_number(@item)
  end
 
  #-----------------------------------------------------------------------------
  # Overwrite
  #-----------------------------------------------------------------------------
  def do_sell(number)
    $game_party.gain_gold(number * selling_price)
    @actor.lose_item(@item, number)
  end
 
  def on_actor_change
    @status_window.actor = @actor 
    @buy_window.actor = @actor
    @sell_window.actor = @actor
    activate_current_window
  end
 
  def activate_current_window
    case @command_window.current_symbol
    when :buy
      @buy_window.activate
    when :sell
      @sell_window.activate
    end
  end
end

And you didn't keep up to date with my gold inventory script. The date you listed is the original publish date not the revised update date. Copy it from above again. and I'll change the date to make it more clear
You are missing part of the scene inventory script.
Recopied and fixed.

The date you listed is the original publish date not the revised update date. Copy it from above again.
Copied, tested, and it all works, including the trade gold script.
You sir are the best! I can't thank you enough, and this helps me resolve so many issues I was having earlier with certain purchase events.

It won't come up till much later, but whenever the day comes where I may sell the game, do you want me to credit you (in the credits) for the scripts you have provided/edited?
Of course credit is appreciated.
I understand fully with won't come up till much later. I'm trying to push myself to work on my own project and have it out this year. It's only been 5 years now.
Of course credit is appreciated.
I understand fully with won't come up till much later. I'm trying to push myself to work on my own project and have it out this year. It's only been 5 years now.
5 years is a long time. I'm aiming to have mine complete in 1 year. Not sure how naive that is yet.
One bigger challenge is also going to be finding out when, where, and how to secure some graphic+sound assets for project #2, sicne that one will be sold first if any will.

Original thread: https://forums.rpgmakerweb.com/threads/multiple-inventory-problems.146001/