Jump to content
Fomar0153

Multiple Inventories

Recommended Posts

Multiple Inventories

Version 1.0

by Fomar0153

 

Introduction

Allows you to easily handle multiple inventories in game.

 

Features

+ Can create as many inventories as you need.

+ Can merge inventories.

 

How to Use

First copy the script into your scripts section then consult further instruction located at the top of the script.

 

Script

The most update version of this script can always be found on my blog.

 

F.A.Q.

No questions asked.

 

Credits and Thanks

Fomar0153

Share this post


Link to post
Share on other sites

It is possible also to control (or switch to) multiple actors in a map with different inventories?

Do you mean controlling 2 different parties at the same time e.g. swapping parties by pushing a button?

If so that depends if you've got another script which implements multiple parties.

Share this post


Link to post
Share on other sites

Started a new game with test zone. Added gold for test, removed old party and put new party member and called the script.

 

I also can't load because it makes the game crash immediattely when you press continue before even bringing up the load screen.

Edited by MISTER BIG T

Share this post


Link to post
Share on other sites

Started a new game with test zone. Added gold for test, removed old party and put new party member and called the script.

 

I also can't load because it makes the game crash immediattely when you press continue before even bringing up the load screen.

You might not be able to load old files I've never checked.

It could be a script incompatibility, try it in a new project and if it works it is an incompatibility. If it doesn't work then your setup is wrong.

Share this post


Link to post
Share on other sites

Made a new game with first map, with the same settings (Adding gold, removing main hero and replacing with another and then running the script) and it gave the exact same bug.

Edited by MISTER BIG T

Share this post


Link to post
Share on other sites

Just occurred to me your script event does look like:

$game_party.change_inventory("inv1")

right?

 

Oh, it didn't have quotation marks. Your instructions didn't say you need to put them in between them.

 

By the way, it does not seem to work with gold. The gold is shared in the test that I did.

Share this post


Link to post
Share on other sites

Simple add-on that demonstrates inventory switching in the item menu for anyone that wants that kind of logic.

Only useful for reference.

 


class Game_Party < Game_Unit
 #--------------------------------------------------------------------------
 # â— Set the name of your starting inventory here.
 #   Only use numbers
 #--------------------------------------------------------------------------
 START_INVENTORY = 0
 Max_Inventory = 5

 def next_inventory
   change_inventory([@current_inventory + 1, Max_Inventory].min)
 end

 def prev_inventory
   change_inventory([0, @current_inventory - 1].max)
 end
end

class Scene_Item < Scene_ItemBase

 #--------------------------------------------------------------------------
 # * Add additional handlers
 #--------------------------------------------------------------------------
 alias tsuki_multiInv_category_window create_category_window
 def create_category_window
   tsuki_multiInv_category_window
   @category_window.set_handler(:pageup, method(:next_inventory))
   @category_window.set_handler(:pagedown, method(:prev_inventory))
 end

 def next_inventory
   $game_party.next_inventory
   @item_window.refresh
   @category_window.activate
 end

 def prev_inventory
   $game_party.prev_inventory
   @item_window.refresh
   @category_window.activate
 end
end

Share this post


Link to post
Share on other sites

can i use this in commercial and non-commercial game because i'm joining a competition and wanted to use your script in my game...

 

please reply

Share this post


Link to post
Share on other sites

So, is $game_party.change_inventory(name) all I need to switch inventoryes? Dont I need to make a list of inventoryes or something?

 

It works!

$game_party.change_inventory("inv1")

 

EDIT:

It stopped working. Same error as in post 8

Edited by wariolandgoldpiramid

Share this post


Link to post
Share on other sites

Epic script man!

It looks uncompatible with Yanfly's Ace Save Engine

Every time I open the save scene, I get this error:

 

Script 'Multiple Inventories' line 97: TypeError occurred.

can't convert nil into Integer

 

Is there a way to fix this? I would really like to use this script in my project!

Share this post


Link to post
Share on other sites

Is anyone here? BUMP!

 

Epic script man!
It looks uncompatible with Yanfly's Ace Save Engine
Every time I open the save scene, I get this error:

Script 'Multiple Inventories' line 97: TypeError occurred.
can't convert nil into Integer

Is there a way to fix this? I would really like to use this script in my project!

 

Someone help me!

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.

×