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.

+5
Under review

Advanced Inventory Module

Duffer123 6 months ago in Inventory updated by Sergei | Analog Limb 6 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.
+4
Under review

What Inventory 2.0 should consider

Necka 6 months ago in Inventory updated by Marti (Lead Developer) 2 months ago 10

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
Planned

Cursor lock on Inventory UI exit button

Brian 2 weeks ago in Inventory updated by Marti (Lead Developer) 1 week ago 3

How would I lock & hide the cursor during runtime after closing the Inventory UI using the "X" button at the top right?

I've created a variable bool for when the inventory is Open / Closed according to the action options in Game Creator.

So I can press "I" to open the inventory and again to close it, which works peachy using the "change cursor parameters" actions.

It doesn't work when I use the mouse on the UI "X" button to close it. 

I believe I will need to either: 


A. find a way to set my global bool variable inside the InventoryRPG prefab by referencing it within the InventoryUIManager script (i wouldn't know where to begin with this)

B. write a few lines of code inside the InventoryUIManager script alongside the "is.Open" or "changeState" functions (I don't know how to code that well yet)

Maybe there's an easier way I'm missing? I suppose the easiest way would be to get rid of any clickable close buttons in all UI, but I feel like I'll have to figure it out at some point. 

Answer

Hi. This is a good question. There's currently no "easy way" of doing this. However, I'm opening a ticket to add a new Trigger called "On Inventory UI" that will detect when the inventory UI changes its state. You'll be able to to choose between when the inventory UI is opened or closed.

This should solve the problem, since you can simply call the Action "Cursor" when the inventory closes and lock the cursor on screen.

The same will be done with the Merchant.

+1
Answered

Equipment armor and clothing

Stanislav 1 month ago in Inventory updated by Marti (Lead Developer) 4 weeks ago 5

probably there is some kind of documentation but on the official website, I did not find anything about it. In the new version there is armor that can be equipped directly with the character. How can I do that? If it is possible in more detail, when I used the ORK Framework there was a script that allowed me to equip clothes for a player using UMA. How can this be solved with the help of GC? As I understand it, scripts are not needed here.

+1
Fixed

Important piece of Inventory docs outdated

mode80 5 months ago in Inventory updated by Marti (Lead Developer) 5 months 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
Marti (Lead Developer) 5 months ago

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

+1
Fixed

Inventory Container Bug

Eric Mathiasson 6 months ago in Inventory updated by Marti (Lead Developer) 5 months 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
Marti (Lead Developer) 5 months ago

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

Issue with Inventory : Changing scenes remove Weapons from slots

IndieGameHustle 16 hours ago in Inventory updated 9 hours ago 1

Hello, 

I am noticing a issue that when I equip weapons into the weapons slots and change scenes, it is not keeping the weapon icon in place. 

However the weapons are still attached to the player and if you click on the area where for example the sword or hat would be it then would remove the item and refresh the others making it visible. 

I hope that make some sense. 

0
Under review

On drop item

Stanislav 3 days ago in Inventory updated yesterday at 9:59 a.m. 2

In item triggers there is a useful function "on drop item". But why does it work on only one subject? If I put the same trigger on an item, the trigger does not work on the second item. And even if I put another collider it does not help.

0
Not a bug

How to Customize Inventory Skin

Cr4shBarcode 1 week ago in Inventory updated by Marti (Lead Developer) 5 days ago 2

This may not be a "bug", per se, but I still need to know how to fix this:

I have a custom skin made from a duplicate of the default Adventure Inventory skin. I've been wanting to change it so that the names of the inventory items pop up as text beneath the whole menu instead of in little orange bubbles that the text won't fit in. Today I decided to do it, even though from experience, making too many changes inside the inventory prefab at one time makes things stop working properly.

I switched to a practice duplicate of the Adventure Inventory skin. I found the ItemInfo object inside the ItemAdventure prefab, copied it, and pasted it in my preferred place inside the practice skin. It didn't appear when I tested it on play, so I restarted the scene to discard changes and start over. 


It looks like the prefabs have saved my changes automatically, so I tried to put things back the way they were manually. The thing is, the ItemInfo no longer appears during play no matter what I do. I also noticed that the object box in the ItemInfo Inspector is now white instead of blue. I think this means it's disabled.

1) How can I get the ItemInfo to appear again without re-importing GC (I don't want to mess with all the Inventory already worked into my game)

2) How can I achieve what I wanted, which was to have the ItemInfo appear beneath the menu instead of on the top of the items?

Answer

The blue icon means it's a prefab root object. A white one means it s a normal game object. An Inventory skin is composed of two prefabs:

  • The Inventory UI
  • The Item UI

The first one is the UI you see when you open the inventory. The Item UI is a prefab that adapts to the item type you want to display. If you have two items: a potion and a sword in your inventory, two instances of these prefabs will be instantiated inside the Inventory UI's content field.

Having this in mind, to customize the Item UI, you can drag it inside the Inventory UI, make the changes you want, but then, you need to save it back to the Item UI prefab (by dragging and dropping it) and also remove it from the Inventory UI prefab.


Your Item UI, in play mode, disappears because as soon as you start, the Inventory UI clears any child objects from its "content" field, where the Item UI instances will be placed.


Hope this helps!

0
Answered

quantity of items

Stanislav 2 weeks ago in Inventory updated by Marti (Lead Developer) 1 week ago 1

How can I write the quantity of items in my inventory into a numerical variable?

Answer

Currently there's no no-coding solution for this. However, if you have a little of coding experience, you can access the amount of items in your inventory by accessing the following value:

InventoryManager.Instance.playerInventory.items.Count

Cheers!