Grid Inventory Version: 1.0f Author: modern algebra Date: August 22, 2010 Version History
<Version 1.0f> 08.22.2010 - A bug fix with regard to non-consumable items becoming unusable after one use <Version 1.0e> 06.16.2010 - A bug fix with regard to selling items within a non-lead actor's inventory <Version 1.0d> 05.22.2010 - Several bug fixes, including the bug when opening loot after battle <Version 1.0b> 08.03.2009 - Several Bug Fixes including disappearing items when unequipping, and a false disabling of the Unequip option occasionally. Also, a game crashing bug would occur when trying to draw the capacity stats of an inventory. If that problem occurs to you, redownload the script. <Version 1.0> 07.31.2009 - Original Release Description
This script does multiple things. First: it gives each actor their own inventory. Second: that inventory is displayed through a grid, with each item taking up a specific amount of squares. How many squares is completely customizable for each and every item.
You are also able to set a maximum number of instances of that item each slot can hold. This means that for each item, say for instance, arrows, you can define how many arrows could fit into one displayed slot of arrows. See the demo for clarification.
You can also set a picture graphic for each item, though if you do not it will default to using the item's icon. Beyond that, you can easily set up permanent storage events, each of which are easy to set up and save what items are stored in them at any given time. When received, items will be automatically distributed amongst the party in order, meaning that they will be given to the first party member, then the second once the first party member's inventory is full, and so on. If, upon gaining an item, you cannot fit that item or items into the party member's inventories, it will call up a loot inventory and the player can decide which items to discard and which to keep. As well, you can customize the size of each actor's inventory and you can modify that at any time with a simple script call.
A good system to compare this to is the system from Betrayal at Krondor, as that is what it was based on, but as that is not very well known, this system is similar to the item system of the Diablo series.
Features
Actors have individual inventories that are based on a grid system, much like Betrayal at Krondor Items can be assigned a width and height, as well as a maximum stack size You can use Item Graphics created by grafikal or create your own, and you can also set the hue so that the same graphic can be used for multiple items Has a full Information screen that allows the player to see the actual stats of an item You can Use, Equip, Unequip, Transfer, Discard, and Move items around all from the Inventory. The player has full control over his inventories. You can create permanent storage items to hold the party's items and give them new ones If the party gains too many items, it will automatically open a loot inventory as a temporary inventory until all the items can be arranged Screenshots The options when selecting an item in an actor's inventory
The options when selecting an item in Loot
The options when selecting a blank space in an actor's inventory
The Information Screen
Instructions All of the item setup is done in the Notes box of the item you are setting up. There are six commands you can use:
\width[integer]
integer : any positive integer. This represents how many squares the item requires horizontally
\height[integer]
integer : any positive integer. This represents how many squares the item requires vertically
\maxstack[integer]
integer : any positive integer. This represents how many of the same item can occupy the same space before a new slot for the item has to be created.
\picture[filename]
filename : a name of a picture file in the Inventory folder. This will be the picture of the item in the inventory. if you don't set a picture, it will use the icon of the item instead.
\picture_hue[integer]
integer : any positive or negative integer. This allows you to change the hue of the picture used.
\nondiscard
this option sets the item as undiscardable through the inventory scene. Bear in mind that it does not prevent the player from storing the item, and if the item is in Loot, then it can still be destroyed.
\colour[red, green, blue, alpha]
this option allows you to give any item a unique colour, and not just the default colour for its type. The arguments to pass are self-explanatory. alpha for the default colours is 160.
To open a storage unit, you can simply use this code in a call script:
open_storage (storage_id[, items[, name[, icon[, size]]]])
storage_id : the ID of the storage box to open
items : the items array, each entry: [type, id, amount]
name : the name of the storage box being opened
icon : the name of the bitmap associated with this storage item
size : the size array for this item => [width, height]
items, name, icon, and size can be excluded when opening the storage and the storage will start with default settings. Further, they are only valid the very first time the storage is accessed. Thus, if you set up items to have three items in it, the only time those will be added is the first time the storage has been opened. If you wish to add items to the storage after having opened it, then you must use the command:
add_to_storage (storage_id, items)
storage_id : the ID of the storage box to open
items : the items array, each entry: [type, id, amount]
You can also resize inventories with the commands:
resize_actor_inventory (actor_id, width, height)
actor_id : the actor whose inventory is to be resized
width, height : the new size parameters for the inventory
resize_storage_inventory (storage_id, width, height)
storage_id : the actor whose inventory is to be resized
width, height : the new size parameters for the inventory
resize_loot_inventory (width, height)
width, height : the new size parameters for the inventory
If you want a specific actor to receive an item, you can use this code in a call script:
actor_gain_item (actor_id, item_type, item_id, amount)
actor_id : ID of actor to receive item
item_type : 0 => Item, 1 => Weapon, 2 => Armor
item_id : Id of item
amount : the amount of that item to receive.
For the system and vocabulary settings, please see the editable regions at lines 107, 167, and 904
Script
See the
Attached Text Document It is recommended, however, that you retrieve the script from the demo as that way you can see how it works.
Note that this script
REQUIRES the
Paragraph Formatter and the
Bitmap Addons script is
RECOMMENDED . Both can be retrieved from the demo.
Credit
modern algebra grafikal, if you use the item graphics included with this script Thanks
Zeriab, for his table-debuggging script and for his help with the paragraph formatter Support
Please post here in this topic if you encounter any bugs at all
Known Compatibility Issues
Spoiler for Tankentai ATB + Grid Inventory Compatibility :
Thanks to Mr. Bubble for making these scripts compatible. Just follow the directions he gives here:
[T]his script can be made compatible with the Tankentai ATB with technically one change. On line 3215, find this line:@item_window.ma_inventory = @active_battler.inventory
Replace that line with this: if $imported != nil && $imported["TankentaiATB"] @item_window.ma_inventory = @commander.inventory else @item_window.ma_inventory = @active_battler.inventory end
It'll work with the latest version of the ATB. This is not needed without ATB. Spoiler for Composite Characters + Grid Inventory Compatibility Patch :
Equipment does not refresh upon exiting the Inventory, so this patch fixes that. Place it in its own section below the Grid Inventory script, but still above Main.
#============================================================================== # Composite Characters + Grid Inventory Compatibility Patch # Author: modern algebra #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # Place this in its own slot beneath the Grid Inventory script #============================================================================== # ** Scene GridInventory #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - return_scene #============================================================================== class Scene_GridInventory #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Return Scene #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias monalg_compchar_gridinry_ptch_rtrnscn_2jj3 return_scene def return_scene (*args) # Run Original Method monalg_compchar_gridinry_ptch_rtrnscn_2jj3 (*args) $game_player.refresh end end
Spoiler for ziifee's WGB + Grid Inventory Patch :
An error will popup in battle if you are using the Wait-Guage battle. The code below fixes that error. Just place the Grid Inventory script into a slot BELOW ziifee's scripts and then put the following code in its own slot BELOW Grid Inventory.
#============================================================================== # Grid Inventory + ziifee's WGB Compatibility Patch #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Place Grid Inventory below ziifee's scripts and this patch beneath the # Grid Inventory #============================================================================== #============================================================================== # ** Scene Battle #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # overwritten method - start_item_selection #============================================================================== class Scene_Battle #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Start Item Selection #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def start_item_selection (*args) # Run Original Method modalr_invgrid_slctitm_windo_4h21 (*args) return unless ModernAlgebra::GI_PERSONAL_ITEM_USE # Setup inventory @item_window.ma_inventory = @select_battler.inventory @item_window.refresh end end
I imagine it would have some problems with exotic CMSes and scripts that alter Equip and Item significantly. Note that it is possible to not hide the Item and Equip scenes, if that is something you require.
It ought to work with Scene Menu REDUX as long as it is UNDER the Scene Menu Redux Script and all other scripts that utilize the Scene Menu REDUX. It should not need to be setup - it should work as soon as it is plugged in.
Though I have not tested them, it should work with KGC Custom Commands as long as you follow the same directions as for Scene Menu REDUX
I imagine it will have menu problems with my Quest Journal and my Integrated Reserve Party if you choose to hide Item and Equip, so I will be writing compatibility patches for both those scripts eventually.
Please put it Above Main but below any other custom scripts you have.
Demo
Grid Inventory System Attached Author's Notes
I wrote this script for RMXP a long long time ago and it was riddled with bugs. I then decided to rewrite it, but VX came out and it slipped away from me, so I was left with a half-finished version of this script for XP. When I tried to go back to it, I found it hard to figure out what I was doing, and so I thought it might be a good idea to convert what I had to VX and that way I would figure out what I had done and do something productive in the process. So that is where we are now - I don't expect it to be bug-free, but I am committed to resolving any bugs you might find, so please please please report them to me! I am not taking another two years before this script finally comes out.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License .