Actor Inventory
This script changes the inventory system from a party-based inventory to an actor-based inventory. Each actor now has its own inventory. The inventories are preserved even if you remove an actor from the party and then add them later.
By default, any “gain item” or “remove item” calls will remove items from the party leader. You will need to use script calls to add items to other 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.
Download
Script: download here
Required: Core – Inventory
Here are some modified scenes for the actor inventory based on the default scenes/windows.
Or get the entire scene package here.
Addons
- Actor Trade Scene – trade items between actors
Compatibility patches
If you are using Instance Items, you will need a patch for that. Get it here.
Installation
Place this script below Core – Inventory and above Main. If you are using the Shop Manager, these scripts go above it
Usage
The following script calls are available:
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)
Where id
is the database ID of the object you want to add/remove, 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.
Any inventory limit scripts compatible with this one?
Hi, Hime!
I saw you planned to do a plugin version for RMMV. Is it coming yet?
Is an MV version in the works?
Yes. There are some issues at the moment.
Can’t wait for an MV plugin version of this script!
Hello, I was wondering a couple things that I couldn’t find specifically outlined in your description;
I’m assuming when the “item” command is selected by a player in battle, they only have access to the items in their own inventory?
Also, is it possible to still have a communal inventory but only have certain items sent to a character-specific inventory? This would be ideal for the kind of battle system I am trying to implement.
Yes, during battle, the inventory will be pulled from the actor.
This script assumes that inventory will be handled by actors.
Whenever I use the select key items command it only pulls the item list from the party leader. Is there any way I can get it to show a list of all the items that the party collectively has?
Add this somewhere after the script https://gist.github.com/HimeWorks/778102940f8c70ecf7f38faad4e56cf2
It doesn’t support using items however, so if they are consumable things likely will not work out properly.
That works perfectly! Thank you so much!
I can pass all items of actor[1] to actor[2] inventory?
Are you asking how can you do that?
Well, yes
Is possible do that?
Is it possible to perhaps add a skill equip?
So that an actor can only bring a few skills in each battle.
So even though actor 1 has 6 skills learned, he can only bring in 3 skills per battle.
Yami has such a script. You can search the master script list for it.
Excuse me, but I was trying to use this script with Mr. Bubbles “Too Much Information Item Scene” and, even when items appear in the Trade Scene, they don’t appear in the Item Scene. Is there a way to solve this?
~Sorry for my bad english, and sorry if this sounds rude, I think it sounds rude but I don’t know how to put it with other words >w<~
This script completely changes the way items are handled: instead of the party holding all the items, each actor holds their own items. Other scripts would likely need to be changed accordingly.
Did my question get deleted?
Never mind
Hey Hime,
I was trying to create a addon that limited an actor’s inventory from exceeding X amount, but for some reason the game still exceeds the max amount of items in the actors inventory no matter what I do. Here’s my source code if you think you can help me out with this and if you want you can just apply it to your Actor Inventory script later on.
https://db.tt/2ktRWmP8
Other scripts I’m using are:
Instance Items
Core – Inventory
Core Inventory – Instance Items patch
Actor Inventory
Actor Inventory – Instance Items patch
The item max methods only determines how much you can have of a specific item, not of inventory in general. You will need to add additional logic to gain_item (or in your events) to check whether the max number of items has been exceeded.
Thanks for the reply, I’ll take that into consideration.
I am having some trouble with this script. When I try to add an item to an actor's inventory with either an event command or a script, the menu says that the actor has 0 of that item. When I remove an armour, the menu also says I have 0 but I am still able to equip it again. When I use an event to assign a variable to the number of a certain item in the inventory and then to display that number, it also returns 0. However, the actor trade scene (from your other script) displays the correct number of items and allows trading.
Are you using the custom scenes provided? Those are required to properly display actor inventories.
I updated this script to the version released July 30, 2014 and all the issues were solved. I first downloaded it a little over a month ago and didn't expect there to be an update.
Oh that bug, ya I update scripts from time to time. Sometimes I don't publish any fixes. If you're following me on twitter I usually make smaller announcements there like if I fix a bug or something.
Would you ever consider making a way to determine who gets drops from item chests and such? I'm using GubiD's TBS along with this script for a Fire Emblem-esque game, but it feels odd to have an item go to the party leader's inventory when another member found that item.
I would like to know too.
Is there a way for this to be used with either Yanfly or Neonblack's Skill Cost scripts, specifically with item costs? So that to use an ability the user has to have an item in their inventory?
It might, depending on how they are written. If they require you to type in a formula then you can just check the actor's inventory instead of the party's inventory.
Sorry to bother you again, but I'm still new to scripting in RGSS3. What string would I use to check for the actor's inventory instead of the party's inventory?
I don't know how you would reference the actor but if "self" refers to the actor, you can say
Which checks if item 3 is in your inventory.
Sorry if I missed it… But is there a way to check if a person has something in their inventory? The normal way is broken if you add this. (Either this or the "core" script.) I have conditionals that check if an item is in the inventory… And with these scripts it just assumes everything is in the inventory. So If I put a conditional to check for "Apple" in the inventory, and put a message to say, "I have an apple." Even if you don't have an apple in ANY inventory, it will still run that conditional as true. I apologize if this is mentioned somewhere, but I'm not seeing it.
There was a bug in the code. Should be fixed now.
Hey there – I've found your scripts really helpful.
I do have a small problem with this one though.. Even when my main character (actor id 1) isn't in the party, all of the items go to his inventory instead of the character who's actually the party leader at that time.
Are you sure there are no scripts that change the leader to a fixed actor?
I keep turning up, like a cockroach, or something.
I seem to have run into an issue with at least this script (or, well, the scenes) and the key items prompt. When last you saw me, I was looking into possibly making another person's script compatible with yours, but it seems that the select key items event command won't register any key items in any inventory. Furthermore, attempting to select the empty slot crashes with the error:
Script 'Actor Inventory Scenes' line 72: NoMethodError occurred.
undefined method 'usable?' for nil:NilClass
I've updated it so that it pulls the list from the leader of the party.
I keep getting an error whenever I select an item (Empty Inventory) for an actor and when trading items when only 1 actor exists and no items available. It also gives me the same error during battle. Also I am using Neon Black’s battle engine.
Error:
line30: NoMethodError occurred
undefined method ‘last_item’ for nil:NilClass
Forgot to add the battle addon, that works fine now. But the problem in the menus still persists.
“Trading items”? What does that mean?
With the ‘Actor Trade Scene’ script.
This is a really great script. Thanks a lot!
I’m wondering, could it be possible to add a limit on how much items an individual actor can carry? This would make a game more interesting because the player would need to distribute the items equally.
Sorry for bad english 😛
Ah. I know there’s already some scripts out there that put a limit on the inventory, but they don’t seem to work with this script. Sorry and thanks again.
I have not thought of a good way to enforce inventory limits so you should see if they are willing to add support for the Core: Inventory script that this script relies on.
I have not thought of a good way to enforce inventory limits so you should see if they are willing to add support for the Core: Inventory script that this script relies on.
very interesting, but I don’t agree with you
This is pretty AMAZING man! If their are any Suikoden 1 lovers out there willing and trying to make a Suikoden 1 fan made game, you basically just hit the nail on the head for the actor inventory system 🙂 Well done!