Inventory (for Unity Gui) is Available

Discussions, Solutions & How To with Inventory
User avatar
Site Admin
Posts: 106
Joined: 07 Aug 2009, 14:54
Location: London, UK

Inventory (for Unity Gui) is Available

Postby Adam » 27 Apr 2011, 10:33

InventoryManager2.0 is ready:
I am putting this system back in the queue for the asset store and up for sale on out eStore:

The behaviour of this system has significantly changed:

The 'ESC' key acts as a "cancel" key.
If dragging and item/icon, the 'ESC' key will first cancel the current drag.
If not, it will close windows according to a cascade list, starting with the message window.

"B" opens the Bags window, "I" opens Inventory window, "C" opens the Character window.

All items/icons are draggable once looted.
If the user drags but doesn't place the item/icon at the end of the drag, it will be held on the cursor.
Dragging an item/icon over another slot in the current open bag (Inventory) will move its location.
If that slot is full, it will swap items onto the cursor.
Dragging an item/icon over a bag will place it into that bag if possible.
If that bag is full, item/icon will be rejected and held on the cursor.
Dragging an item/icon over a slot in the character window will equip it, if possible.
If that slot type is correct, but full, it will swap items onto the cursor.
If the slot type is incorrect, it will seek an appropriate empty slot.
If that slot is full, the item/icon will be rejected and held on the cursor.
To swap item/icons in a full slot, you must drag or click the correct slot.
Dragging a bag from the Inventory onto an empty slot in the Bags window will Equip the bag.
The Inventory capacity will be increased by the size of that new bag.
Dragging a bag from the Bags window over another bag in the Bags window will swap them.
The "old" bag will be held on the cursor.
This allows changing locations of bags within the Bags window.
Dragging a bag from the Inventory onto an equipped bag will place it into that bag if possible.
This is the same behaviour of any inventory item/icon.
To equip a bag, you must drag over an empty slot or Rt. Click a full bag slot (See Below...).
Dragging an item outside of a window will do nothing until actively clicked.
Clicking (Left Click) outside of a window while holding an icon will prompt a removal message.

Clicking (Left Click) will select or activate items.
In the game-world, this will activate a Lootable Object or Lootable Item.
In the Inventory or Character window it will activate the item/icon, if possible.

Right Clicking:
In the Inventory window this will attempt to equip the item on the character.
If there are two slots of the same type, and one is full, it will seek the empty slot.
If all slots are full, it will swap the item/icon that is equipped back into the inventory.
In the Character window this will attempt to UnEquip the item and place it in the Inventory.
If the inventory is full, the item/icon will remain in the same slot.
In the Bags window:
If the cursor is "empty" and over a bag, that bag will be returned to the Inventory if possible.
The bag must be empty to be "UnEquipped" from the Bags window.
A bag with any contents will be rejected and will stay in that slot.
If the cursor is holding a non-container item/icon, Rt. Clicking will bring that bag into focus.
This allows viewing or detailed placement of the icon being carried into that bag.
If the cursor is holding a container item/icon, it will attempt to "replace" the bag.
The system attempts to move all of the contents of the old bag into the new one.
If the incoming bag contains any items, it will be rejected.
If successful, the old bag is swapped to the cursor.
It can now be placed in a bag, the open Inventory window, or removed.

Current functionality includes:

• An item editor window to add items and edit their attributes in edit-time (see demo below).
• - No parsing text files from external sources.
• - Easy Unity-friendly creation and organization of inventory items.
• LootableObject based loot tables that are both fully editable and prefabbable.
• - Multiple loot tables per object supported for organization and clarity.
• - No need for one long & annoying set of centralized loot tables.
• - Single LootableItem for individual items for ease & simplicity of single object looting.
• Instantiating objects removed from the inventory back into the game world.
• Developer ready "Use Item" methods for using consumable items (potions, etc.).
• Developer ready access to the items equipped for character instantiation.
• Accounting for stat bouses on equipped items when items are equipped and removed.
• Optionally Destroy lootable objects when empty.
• - With an option to fade out before destroying & complete control over fade and fade delay.
•Multiple Bags.
•Swappable Bags, even when full.
• Generally cleaner and quicker than 1.0.
• More things that I can't think of at the moment...

A set of temp icons, a chest model with optional animated lid and gold-pile, sprites, textures and other items will be distributed with the demo-project.

I am releasing the C# code first. Then I will prep the JS code. Finally I will get the video tutorials finished. When I'm done there will be a full set of tutorial videos on setting up and working with the system, the code will be available in both JS and C# and the code will be annotated and understandable.

Features in the pipe include stores/vendors, money, stacking, drop target over-lays and more.

In the future, there will be a companion "quest" system that interfaces with the items in the inventory.

User avatar
Site Admin
Posts: 106
Joined: 07 Aug 2009, 14:54
Location: London, UK

Re: Inventory (for Unity Gui) sneak preview

Postby Adam » 03 May 2011, 23:05

Franbon2005, Forgez, sorry for the late replies, but in the UK we had a Holiday (some silly frilly people getting married in a big church) and then there was the LudumDare #20 ( game contest, which I participated in, so I'm just recovering...

I've had a few requests about implementing communication with databases and/or import/export scripts. This system was originally designed to be simple and complete within Unity, thus storing all of the data in the Item List List<>. I wanted to keep it as simple as possible for those folks who know little about coding beyond what they have learned using Unity.

That being said, my original working inventory and the internal one I have that uses EZGui supports import/export parsing, and I intend to add this to InventoryManager for those who have offline/edit-time external databases. I have FileMaker Pro and found that I could manage all of my quests and inventory items from an FMP database and export files for parsing into InventoryManager and QuestManager, but I felt that I could make a Unity-drive editor that could do much the same thing as I was getting from a simple FMP db.

My next upgrades to InventoryManager will include text-file parsing for import and export, but it will also include increased Inventory Item Editor function, so one won't have to do that externally.

When it comes to synchronizing with something like mysql, I'd like to do that, but I have no experience with mysql yet. I have no issue with finding a way to add mysql support, but I'll either need time, help or both.

Let me look more closely at the code tomorrow when my eyes are not so blurry... and I'll have an answer that's more clear for your particular problem.

Return to “Inventory (for Unity Gui)”

Who is online

Users browsing this forum: No registered users and 1 guest