Extra Inventory Space

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
Hi People

Before I start my story, I have to say that this is post, on my first forum, so if it is in the wrong place, I apologize beforehand

I've been working on a RPG, In which magic is very important.

One of the things I want to create is some sort of alchemy.

For example:

You own a paper that has fire adds fire elemental damage too the spell, A paper that adds 5% of poison damage etc.

somewhere you can combine those papers together to a spell which get consumed once you cast the spell.

I know this means I have to make a lot of spells and that isn't the problem

I can use conditional branches and variables to give you the right spell. (common event)

Now if you obtain all those loose papers, in all those colors and shapes, your inventory is turning in some sort of jungle

Is there some way to create a new inventory, which will open when you (for example) click a box or a chest that is already inside your original inventory.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You're either looking at getting a script done to allow multiple inventories, or doing it via eventing (assign a common event to the box or chest in your inventory that then opens a new evented menu showing your loose papers and things).


A script would probably be better, but if you don't know how to script, it could be hard finding someone to do it for you.


State whether you'd prefer to do this with scripting or eventing, and I'll move it to the proper forum if necessary.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
An easier thing to do would be to create a new category inside the inventory, where you only show the papers. So, instead of having "Items / Weapons / Armors / Key Items", you would have something like "Items / Papers / Weapons / Armors / Key Items".

That can be achieved with just a couple of script lines. I can write it for you if you want.
 

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
those script lines "Hudell" they can be found by "window-> Winsow_itemlist", right?

i think i can make that extra category, at least, if i only need to edit this line, and make it like:


   when :item

      item.is_a?(RPG::Item) && !item.key_item?  

   when :alchemy

      item.is_a?(RPG::Item) 

when etc.

 

but that means that all the items would be displayed there, right? do i need to change something somewhere, so that when i create a new "paper" i can select item/key item/paper? 



and one more question, up to how many categories can i make? do they go to the next line, or will they just continue, and continue, of the screen? after 5 categories or so?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
There are three different things you need to do:

First: To show a new category, you have to overwrite Window_ItemCategory.make_command_list. It would be like this:

class Window_ItemCategory < Window_HorzCommand  def make_command_list    add_command(Vocab::item,     :item)    add_command('Alchemy', :alchemy)    add_command(Vocab::weapon,   :weapon)    add_command(Vocab::armor,    :armor)    add_command(Vocab::key_item, :key_item)  endend 

 

Then you have to decide how you want to display this extra category. Since it is just one more, I think you can just make the game show 5 categories side by side instead of 4:

Code:
class Window_ItemCategory < Window_HorzCommand  def col_max    return 5  endend
 

Other options would be: Leave it as it was (the game would then scroll the menu horizontally) or resize the window to show two rows of options (this would need quite a few changes).

 

Finally, you have to make the new category work. This is exactly the change you made (Window_ItemList.include?). But the way you did, you're showing all regular and key items in there. You need to test if it is one of your items.

There are many different ways to do this:

You can make a list of items that should be displayed in this category, or you can use a note tag on the database. Let's go with the second:

 

This will add a method on the item class to check wether an item is alchemy related or not:

Code:
class RPG::Item < RPG::UsableItem  def is_alchemy?    return @is_alchemy unless @is_alchemy.nil?     @is_alchemy = !@note.index('<alchemy>').nil?    return @is_alchemy  endend
 

Now, all that's left is to change the filters:

 

Code:
class Window_ItemList < Window_Selectable  def include?(item)    case @category    when :item      item.is_a?(RPG::Item) && !item.key_item? && !item.is_alchemy?    when :weapon      item.is_a?(RPG::Weapon)    when :armor      item.is_a?(RPG::Armor)    when :key_item      item.is_a?(RPG::Item) && item.key_item? && !item.is_alchemy?    when :alchemy      item.is_a?(RPG::Item) && item.is_alchemy?    else      false    end  endend
 

 

And there it is.

I've not tested any of this, so let me know if any problem shows up.

And you don't have to edit any of the original files, just add these snippets of code in a new file after "Materials"
 
Last edited by a moderator:

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
really quick question ... first you say:

First: To show a new category, you have to overwrite Window_ItemCategory.make_command_list. It would be like this:

A.K.A. overwrite

and then you say place after materials ... which one is it?
 

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
ALRIGHT, I tried placing this below materials

the new category works  :)

but in this new category all items are placed, both key items and normal items

its not like i created a new way to select if an item is a key item, or a normal item, or a item made for the TAB alchemy...
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
really quick question ... first you say:

First: To show a new category, you have to overwrite Window_ItemCategory.make_command_list. It would be like this:

A.K.A. overwrite

and then you say place after materials ... which one is it?
Both would work.

"overwrite" is a term we use when we do just that: We recreated the funcion in a new file, replacing the one that existed previously.

ALRIGHT, I tried placing this below materials

the new category works  :)

but in this new category all items are placed, both key items and normal items

its not like i created a new way to select if an item is a key item, or a normal item, or a item made for the TAB alchemy...
My mistake. Change this:

    when :alchemy      item.is_a?(RPG::Item) && !item.is_alchemy?for this:

    when :alchemy      item.is_a?(RPG::Item) && item.is_alchemy?Remember to add "<alchemy>" to the note tag of the items in the database that you want to show in this new category.
 
Last edited by a moderator:

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
Thank you very much

there is only 1 little thing that would help if you could solve it, though if you can't, I need a little bit more help

everything works now, only the alchemy items get displayed in both alchemy and items. so it still is messy in the item TAB

can we make it that the alchemy items disappear out of the item TAB, or do I have to create another TAB same as alchemy, but then for all the other items?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
My mistake once again:

change this:

    when :item      item.is_a?(RPG::Item) && !item.key_item?for this:

Code:
    when :item      item.is_a?(RPG::Item) && !item.key_item? && !item.is_alchemy?
 

winqau009

Villager
Member
Joined
Jan 9, 2015
Messages
9
Reaction score
0
First Language
Netherlands
Primarily Uses
Thank you so very much  BD
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top