Welcome to the Game Creator support forum! 


This a place to ask questions, discuss ideas and report bugs. Please, provide your Unity and Game Creator versions as well as clear reproduction steps when opening a topic and full console logs.

+4
Under review

Advanced Inventory Module

Duffer123 2 months ago in Inventory updated by Sergei | Analog Limb 2 months ago 9

I set out below the desired features of a new v2 Inventory Module OR an Advanced Inventory Module:-

  • Customisable items at runtime which are loadable and saveable from Inventories (see below) or Containers;
  • Items customisable at runtime in the following ways:-
    1. Socket Items and sockettable items;
  • Multiple Socket item types;
    1. For example, gemstones, runestones, talismans etc
  • Affixes (prefixes, generic affixes, suffixes); and
  • Multiple Affix types (including substance item made from – metals, woods etc);
  • Affixes effect customisable item name (save and loadable) – so a Sword could become a Holy Elven Rangers Steel Fire Sword of the Lion etc.;
  • Enchantments and Upgrades.
  • (a)-(f) effect rarity, price, buy price and sell price, item properties
  • Multiple Inventories (not just one) for Player, Characters or Enemy Characters, NPCs, Monsters, Traders and Merchants;
  • Multiple Currencies and conversion;
    1. Example – 10 bronze pieces = 1 silver piece, 10 silver pieces = 1 gold piece, 10 gold pieces = 1 mithril piece etc etc
  • Craftable Items – from more than two other Items - and Recipes to allow for this;
  • More than 32 Item Types and SubTypes or Categories and SubCategories – so perhaps based upon ScriptableObject ‘types’ – any number of which can apply to an item – and searchable and filterable by types and more than one type;
  • Support for both Fixed Meshes and Skinned Meshes allowing/simplifying Character customisation at runtime; and
  • Wizards/Editors to support all the same and creation of Items, Equippable Items, Currencies, Socket Types, Affix Types in Editor mode.
+2
Under review

What Inventory 2.0 should consider

Necka 2 months ago in Inventory updated by Marti (Lead Developer) 1 month ago 5

Hi Marti, 

here are my thoughts about what Inventory 2.0 should handle:

  1. Hotbar/Quick Bar - It's either a quick access or the pockets of your character. I personally use this as where the player can activate a slot (equip an item) while when the inventory is equipped, you can't click to equip in the inventory.
  2. Number of slots available in the inventory - Basically a setting to state that the inventory has a base of XX slots (quite easy, it defines how many Slots are instantiated in the GridLayout on the canvas. And no, people don't like a weight system :D for the dev it involves always calculating and not forgetting. For the player it's just an annoying limit (which can be here anyway for RPGs!) - this point introduce the notion of: Inventory full
  3. Extensibility of the inventory size as mentionned in #1 - Quite basic too, imagine the player picking up a bigger bagpack that will raise the number of inventory slots by +XX
  4. Inventory organization - That is something I also implemented (#1 and #2) and I can share with you the code for that for inspiration. So it allows to move slots in the inventory or from the inventory to the hotbar and vice versa. it goes well with the hotbar concept. Imagine the hotbar having the slot 5 selected (that's your currently selected weapon for example). You can move you item from inventory slot 8 to hotbar slot 5: it will equip that item. move item from equipped slot in the hotbar to empty slot in inventory or hotbar: move the item and unequip. Move from slot to another slot that is already occupied by an item: swap their position. It basically stick the item to your mouse position and then decide on what to do when you click on another slot. It resets it to the original slot if you close the inventory or click outside of it.
  5. Items stats + custom fields - Be creative but give the dev the possibility to set additional fields for item stats (IE: int. +10 // Firepower: 500 for a gun)
  6. Tooltip - this is also extremely important for any rpg/survival game. Think World of Warcraft, Diablo, Divinity, literally any RPG around here
  7. Other way of equipping - An alternative option instead of left clicking an item to equip/consume, it could be a right click button that shows a context menu (useful if we use left click to re-organize items. But you could also have a little lock button in the inventory to allow re-organization of the inventory and keep the left click for consume)
  8. Stacking limit and allowing multiple stack of the same item: This is really important to have. Many many games have that. So it is simply to limit that for example the item Wood can only be stacked 10 times. if you have 10 woods in a slot and pick-up 1 more wood, it will occupy a second slot. It can trigger an inventory full message
  9. Containers: Same rules as inventory - Slots amount limitation, re-organization, stacking limit (should be on the item anyway), naming the container (so the player can have maybe a wood container, a rock container etc. It doesn't limit what kind of items you put in there (even though it could be interesting) but just a name for the player to see 
  10. Containers owned by the player - To be fair I did not play with Containers yet but in case it is not how it is: some defined containers should the Player's inventory extension. So for other systems to look into the player inventory will check also the containers content (example in #11)
  11. Crafting evolved - Crafting should be kept simple but the option should be given to look up for more than 2 items to craft and this should be in an external GUI with blueprints possibility. Blue prints is for example a gray item in the Crafting UI, when you click on it you can see the requirements. The crafting system checks the player inventory (AND ITS CONTAINERS!!) and if the components are there, the crafting button is not greyed out for example
  12. On death prefab drop - simply a prefab item that the dev chose to have when the player dies. It basically drops the content of the inventory on the ground where player died and if the player pick-it up it restores the inventory (the container inventory is of course protected - think Minecraft

I'm sure I forgot things or will have other ideas, but here is my first version

+1
Fixed

Important piece of Inventory docs outdated

mode80 3 weeks ago in Inventory updated by Marti (Lead Developer) 3 weeks ago 1

Docs here claim that the inventory UI prefabs are located at "Assets/Plugins/GameCreator/Inventory/Prefabs/"

But it appears they're actually installed at "Assets/Plugins/GameCreator/Inventory/Skins"

Answer

Thanks for the heads up Mode80! Just fixed this in the documentation.

+1
Fixed

Inventory Container Bug

Eric Mathiasson 2 months ago in Inventory updated by Marti (Lead Developer) 6 days ago 3

I discovered a bug in the inventory module when using the container script.

When you loot all items from a container, switch scene, and open the container again, all items are back.

But if you remove all but one item and do the same, it works as espected.

Scenario (steps to reproduce):

  • Create a container and put some items in them
  • Play the game and loot the container from all items
  • Save game and transition to a new scene
  • Go back to the previous scene and open container
  • Container now holds all original items, as it was re-filled with the default items

I have not tried this with a Loot Table yet, only with pre-defined items in the container

Proposed solution:

File: GameCreator/Inventory/Mono/Container/Container.cs

Update the OnLoad() method to always flush the data variable before looping over the received items as such:

        public void OnLoad(object generic)
        {
            Container.Data newData = generic as Container.Data;
            if (newData == null) return;

            this.data = new Data();  // <--- Add this line

            foreach (KeyValuePair<int, ItemData> item in newData.items)
            {
                int uuid = item.Value.uuid;
                int amount = item.Value.amount;

                if (this.data.items.ContainsKey(uuid))
                {
                    this.data.items[uuid].amount = amount;
                }
                else
                {
                    this.data.items.Add(uuid, new ItemData(uuid, amount));
                }
            }
        }

This seems to fix the issue, since now, the container always resets whenever loaded data exists, and then gets updated with those items that should be there.

Cheers!

Eric

Answer

Fastest bug fix ever. You are 100% correct about clearing data property. Thanks! I'm marking this issue as fixed and it will be available in the upcoming Inventory update 1.0.1.

0
Fixed

Inventory - Drag item is causing Error

IndieGameHustle 3 weeks ago in Inventory updated by Marti (Lead Developer) 6 days ago 5

Hello, 

I recently purchased the Inventory Module. I am getting the below error when I attempt to drag item. 


It was at one point working then all of a sudden stopped working. I am not sure what may be causing this. 

Answer

I've added null checks so that the floating item property is completely optional now. If your custom inventory does't use the drag and drop feature, you won't be receiving any null reference exceptions now. I'm marking this issue as fixed and a ew Inventory version with this patch should be available very soon.

If there are any further issues related to this, feel free to reopen the ticket. Cheers!

0
Under review

Can't Get Inventory to Work

Cr4shBarcode 1 month ago in Inventory updated 1 hour ago 5

I can't get my Inventory Module to work. Items will not add to or appear in inventory. In the sample scene, nothing appears in the merchant list. There is one error, a NullReferenceException. If anyone can instruct me how to get things working, that would be great.

0
Answered

Adding object to inventory

Kevin 2 months ago in Inventory updated by Marti (Lead Developer) 2 months ago 1

Hi.

I'm having trouble removing an object from a scene when it gets added to my inventory. Basically the item displays in the inventory but remains in the scene also.  The object is showing in the hierarchy as a prefab rather than a game object.  Is this the problem?  I notice that in the inventory example, the icons are game objects with prefab child icons.  I'm not sure how to rectify this.

Thanks in advance.

Answer
Marti (Lead Developer) 2 months ago

In order to remove an object from the scene, you can either use the Destroy action or use the "Destroy After Finishing" checkbox at the end of an Actions object. However, make sure you place the Actions component at the root of your prefab. Otherwise, it will only destroy the child game object where the Actions are.

As for the game object looking like a prefab, it's normal. If you create a prefab out of a scene object, it will appear in blue inside your scene.

As for the last question, I'm not sure I fully understand what you mean by "in the Inventory example, the icons are game objects with prefab child icons". The icon of an item is set at the Item's Catalogue configuration window (see documentation: https://docs.gamecreator.io/inventory/inventory/inventory-window/catalogue). When using the "Item" action to add an item to the Player's inventory, it will use the Item's Sprite to display the icon of the item in the Player's Inventory UI window.

Hope this helps. If something's not clear, let me know

0
Answered

Weapon unnattach drops weapon in world and doesnt update inventory.

Andi Rutz 2 months ago in Inventory updated by Marti (Lead Developer) 2 months ago 1
Answer
Marti (Lead Developer) 2 months ago

Sure. Looks like you're using the "Unattach" option when removing an item. Unattach simply removes the connection between the Character and the attachment (sword in this case), leaving it unparented. 

If you want to remove the object, select the "Remove" option, instead of "Unattach". See the image below: