Tsukihime

Actor Inventory

33 posts in this topic

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

Get it at Hime Works!

Screenshots

These are a few scenes/windows I've customized for actor inventories.

Modified shop buying/selling. Press page up/page down to change the current actor.

The current actor will buy the item.

actorinventoryscenes1.jpg

Modified battle item usage. The items are selected from the current actor's inventory.

actorinventoryscenes2.jpg

Installation

Place this script below Core – Inventory and above Main. If you are using the Shop Manager, these scripts go above it

All custom menus should be placed below the actor inventory scenes.

Usage

The following script calls are available if you want to add or remove items for specific actors.

 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.

Notes

More scripts will be required to make this a fully functional system, including

1. A way to exchange items between actors

2. A better item scene to indicate who the current actor is

You are free to submit your own scripts to improve the system.

Edited by Tsukihime
Tetsune and Dymdez like this

Share this post


Link to post
Share on other sites

So when used in battle, will each party member use items only from their own inventory?

Share this post


Link to post
Share on other sites

Yes. I have updated the description to explain how the customized scenes work.

Share this post


Link to post
Share on other sites

They're just added to the party leader. Additional scripts will be required if you wish to choose who takes the drops.

Share this post


Link to post
Share on other sites

Tsukihime,

Every time I want to add a new script to my game it seems as though you have the closest thing to what I need.  So I am looking to make a Shining-Forcesque game and I need to have a system that allows me to have actor inventory for each character (which you have), ability to trade between characters (which you have), set item limits for each character (not sure if yours does this yet,  Kreeds actor inventory did), and the ability to buy items in a shop and decide which character gets it.  Can your scripts do all this?  One other thing that would be nice would be to have the shop, if you are buying a weapon, ask you if you want to assign the weapon to the actor and if you say yes ask if you want to sell your old weapon to him.  That was a nice feature in Shining Force 3, it sped up the shopping scenes a lot.

Share this post


Link to post
Share on other sites

I don't know what you mean by "item limit for each character". Do you mean that one person can only carry 500 items while another can carry 1000?

How does Kread's script handle item gaining when an actor's inventory is full?

The modified shop scene I provided assumes the leader gets the item, but it can be modified to allow the player to choose which actor will take it.

The "equip weapon/armor" should be done as an add-on.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Sorry for not clarifying.  I am thinking much smaller.  And the limit would be the same for all characters.  Let's say 4 items each can be taken into battle.  The preference would be if your inventory is full that you need to discard something in order to carry the current one.

Here is a link to Kreed's script:

http://grimoirecastle.wordpress.com/rgss3-scripts/gameplay-scripts/actor-inventory/

I can't check right now the script as I am at work but will look later to see what I can find.

Share this post


Link to post
Share on other sites

Kread's actor inventory is different. It requires you to equip items for use in battle.

My actor inventory just converts it from party inventory to actor inventory, so each actor can only use whatever they have.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Sorry if this seems like a silly question, but what is the difference?  In your actor inventory aren't you taking it into battle?  Is there a way to limit your inventory per actor to 4?  I guess I am not looking to have a party inventory but instead have a storage area that between battles can be accessed and traded from.  So I guess that would be the party inventory per say.

Share this post


Link to post
Share on other sites

If you limit your actor's inventory to 4 that means you can only ever carry 4 items per actor. That's all this script does. It doesn't add an extra "battle inventory" or anything.

There would be no separate party inventory where your actors could re-stock in between battles since there is no more party inventory.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Yes sir that is correct.  But that is what the item storage is for.  If you want your character to carry something else you go to your headquarters and you exchange items, or trade with other players.

Share this post


Link to post
Share on other sites

I have a request for your actor inventory, could you make it so that the characters name or picture appears on their inventory screen? Since we can cycle through inventories it would be nice to know for sure which one we are on.

Share this post


Link to post
Share on other sites

The most logical way to do it and probably least time consuming would be in the bar that appears at the top of the screen.  It was empty for me at least and could easily fit the characters name and maybe even their class.  Added their face would be harder, unless you could have it be behind the main window with a semi transparent background.  Just an idea.

Share this post


Link to post
Share on other sites

I think it would be better to request for an item scene that provides actor details on the screen. The default scene really doesn't provide any place to put it.

The bar at the top is the help window and displays item descriptions.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Seriously?  Once again, my bad.  The forum behaves oddly.

Edited by Hyomoto

Share this post


Link to post
Share on other sites

Ugh, double post.

Edited by Hyomoto

Share this post


Link to post
Share on other sites

So this was a while ago, hope you'll get this.  I was looking through the script, and I'm sure I can muscle this out eventually but it may turn out more fruitful just to ask.  Your actor inventory returns

def weapons    @inventory.weapons  end
Which comes from,
 def weapons    @weapons.keys.sort.collect {|id| $data_weapons[id] }  end
 
But the game default returns,
def weapons    @equips.select {|item| item.is_weapon? }.collect {|item| item.object }  end

Which means that instead of returning what your character had equipped, it returns the weapons in their inventory.  My question is simply, was that intentional or did you make a mistake?  If you try to get the characters equipped weapon via the above method, it will obviously not work, so it breaks compatibility with anything that used this method.  But, I may just not be reading into it far enough or misunderstand how it worked to begin with.  Commenting it out fixes it, but now I have to see what I broke in your scripts.

Edited by Hyomoto

Share this post


Link to post
Share on other sites

I forgot that getting party weapons and getting actor weapons meant two different things.

This..makes it a bit more difficult.

Share this post


Link to post
Share on other sites

Trying to work my way through this, can't tell right now what's causing it though, everything looks like it should work.  When I unequip something it just disappears from the universe.  Everything uses the trade_item_with_party, which you've replaced but for some reason it doesn't work out that way.  I'm using a blank project to test it out now, I'll let you know if I figure it out but my post is twofold: one to let you know its happening, and two in case you know why.

 

I'm simply using Core Inventory, Actor Inventory, and Inventory Scenes for purposes of testing.

 

EDIT: Hah, duh.  Rather obvious, eh?  Commenting out the previous line did it, I'm a dunce.  It's returning my equips instead.  I found at least one thing I broke.  Digging in I see what you mean, it has a rather nasty effect, doesn't it?

 

EDIT2: I think the easiest way would be to leave it as is, and just create other methods for equips.  It seems easier to overwrite those methods than try to kajigger everything else, should be easier to wiggle it into compatibility?  Maybe.  Its ugly either way, eh?

 

EDIT3: Well, unless I come up with something else that broke (probably), this seems easiest.

  def inv_items    @inventory.items  end    def inv_weapons    @inventory.weapons  end    def inv_armors    @inventory.armors  end=begin  def weapons    @inventory.weapons  end    def armors    @inventory.armors  end=end  def equip_items    inv_weapons + inv_armors  end   def all_items    inv_items + equip_items  end

Obviously the commented out part is what gets deleted.  I'm sure you'll be more elegant, I'm just brute forcing it.

Edited by Hyomoto

Share this post


Link to post
Share on other sites

A different way to access an actor's inventory weapons will be needed. It will require modifications to several other windows...which gets annoying.

The reason why I chose the "weapons" and "armors" names is because that's how the party defined it, and all windows accessed it that way.

But I guess since actor inventory is a new concept anyways I might as well just overwrite the other windows.

https://github.com/Hime-Works/Requests/issues/135

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Tsukihime did you ever figure out the solution to this script?  I still love this idea for a script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.