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 5 months ago in Inventory updated by Sergei | Analog Limb 5 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 5 months ago in Inventory updated by Marti (Lead Developer) 2 weeks 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
Fixed

Important piece of Inventory docs outdated

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

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

+1
Fixed

Inventory Container Bug

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

Not equipped

Akeos 1 week ago in Inventory updated by Marti (Lead Developer) yesterday at 4:25 a.m. 3

Hi. I was faced with the problem that my items are not equips.

I set the types for them, set the Equipable, and set the types of equipment slots.

everything worked until I created my own types of equipment.
What could be the problem? Or what i doing wrong?

Answer
Akeos yesterday at 4:25 a.m.

Well, in general .. the problem was that there was no player in the game (it was not meant). After adding it to the scene, it worked.. Remove this shame.. =)

0
Answered

Durability of items

markusrgb 4 weeks ago in Inventory updated by Timothee Dumarais 2 weeks ago 6

Hello everyone, 


it is possible to give an item (for example an "axe") a durability.

I want it to be usable only 100 times and then break.

I also want to be able to repair it with a grindstone to set the durability back to 100.

Since it is not possible to create multiple slots in the inventory for the same item, I want to make sure that the item with the worst condition is always used first.

I've thought about working with list variables (but I'm not sure if this works)

If the player then puts 2 of 10 axes into a container, the worst one should always be moved first. (The container would have to store this information - if an axe is taken from there, this should be the worst of the 2 axes)

Unfortunately, I have not yet found a practicable solution for this.

Does anyone happen to have an idea how I could implement this?

Thank you.

:)

Answer

Unfortunately this is not possible due to the code architecture of the inventory system. When saving one or more items, we store the ID of the item and the amount of items. Items can't have individual properties that are not shared across the same items.

However, I'm taking note of this and I'll add this to the features to have for a major iteration of the Inventory module.

0
Answered

catalogue in Inventory module, how to save it and create more of them

eagleeyez 4 weeks ago in Inventory updated by Marti (Lead Developer) 4 weeks ago 2

Where is the Catalogue saved? I would like to have different inventory catalogues for different sittuations.

I had also deleted all the items which I had to do one by one as you have no delete all possability .

So clickeing on Game Creator / reinstall did not bring back the Catalogue.

So where is it please. 

0
Answered

Climbing an object

Pandar 1 month ago in Inventory updated by Marti (Lead Developer) 4 weeks ago 3

Hey. Tell me, please, how to implement climbing into the GC?

Answer

There's no climbing support out of the box, but you could use the Play Gesture Action to make the character play a climb gesture when it's near a climbable place.

0
Under review

GC Inventory & Invector cont.

Pandar 1 month ago in Inventory updated 1 month ago 2

Hey. Has anyone tried to use GC Inventory and a character with an Ivector Controller? The character has both a “hook” and a script “PlayerEquipment” - but things from the inventory do not attach.

0
Answered

Limiting items in inventory

Oliver Marshall 1 month ago in Inventory updated by Marti (Lead Developer) 1 month ago 1

Is it possible to limit the number of items supported in the inventory?

 

I can see a weight limit option, but I'm after a number-of-items option. Perhaps where the bag only holds, say, 10 things. 

I could give each one a weight of 1 and limit it to a weight limit of 10, but that also prevents me from using weight in the future.

Olly

Answer

Hi Oliver;

You're correct; there's currently no way to do that without using the Weight. However, you can also limit the amount of items stacked (not sure if this will help).

Games usually have a per-weight limit or per-amount-of-items constraint, but not both (usually, since makes it would make it more difficult to manage).