Tab system and opsive inventory

Paramedic

Member
e61731a7a1d7c4c90256b64fe91c9d99.png

Hey, I want to create tab system like on screen above in my game. I want to have quests and other things in tab pages, and also Opsive inventory in one of this tabs. Do Opsive Inventory provides tab system or I have to create my own, if I have to make my own how can I put inventory UI inside my tab canvas? If you provide tab system, how can I edit it to look like this one above? I want to also use keyboard to move left and right in tabs pages
 
Last edited:
Do Opsive Inventory provides tab system
1) The Main Menu is the closest thing we have to tabs. You can have a look at the demo scene to see it in action and decide from there if you plan to use it.

Note we also have some special tabs for within the InventoryGrid but that's not generic, it is specific to show different items within the grid depending on the selected tab (weapons, materials, etc...)

or I have to create my own, if I have to make my own how can I put inventory UI inside my tab canvas?
2) You can of course make your own. To put your Inventory inside you'll need a component that opens the Inventory panel when the Inventory tab is selected. Whether you use the DisplayPanel component or replace it with your own code is up to you. but something needs to set the character Inventory to the InventoryGrid to initialize it.

If you provide tab system, how can I edit it to look like this one above?
Simply move the buttons at the top instead of on the left and replace the sprites. Just like any Unity UI, nothing special about it

I want to also use keyboard to move left and right in tabs pages
That would require some code. The Unity navigation system only selects the UI when you use the navigation buttons (left,right,up,down) to actually press the selectables you use the submit input (enter). To change any of this default Unity behaviour you'll need custom code.

Note the Inventory system uses the Unity naviagation everywhere for the UI but we have custom selectables which allow us to do what we need with the navigation inputs, such as scrolling through the Inventory grid while navigating it.



If you prefer making a custom tab system I recommend you watch this video:
 
Yes I exactly use this tab system, I already placed there UI and it works well. I have another problems and questions.

1. I wanted to create inventory system like in Death Gambit, I will place graphic to it. When you open inventory tab you have visible there inventory grid and equipped items grid. I noticed when I put Equipped grid to the canvas, only one in the same moment is visible, but this is not a big problem to smart open both of them in the same time, I have problem with moving between them. I want to navigate via keyboard on both grid in the same time. When you are on this marked red slot and press left keyboard arrow you switch to equipped grid, and vice versa. Bez tytułu.png2.The another question is, how to remove equipped items from inventory grid, I noticed they are highlighted but not removed.
3.How can I assign also item actions to equipped grid, so I can same like in inventory grid, choose drop,unequip,leave.
4.How can I change grid navigation to another buttons, I use New Input System, I have binding key system, but Opsive Inventory System by default use arrow keys and enter, I want to add this binding possibility too to my settings, so I can navigate in inventory for example using WSAD too.

Thank you for answers!
 
1)
To move between them you must manually set the selectable navigation. This is done on the ItemViewSlots directly
1667216443280.png

You can visualize the navigation by pressing the visualize button

To simplify things we usually have a LayoutGroupNavigation the automatically sets the navigation for you within a grid layout group
1667216538732.png

Disable to remove that component if you don't want/need it.
You can also create your own script for setting the navigation automatically the way you want.

2)
To do this use InventoryGrid Filters
These can easily be added from the UIDesigner Editor

Check out the video tutorials too

3)
Use ItemActions just like the InventoryGrid, Both the equipment and InventoryGrid inherit the ItemViewSlotContainer class so they share a lot of functionality.
You can add actions from the UIDesignerEditor too

4)
We use the Unity navigation for this. So you can change the input on the EventSystem gameobject StandaloneInputModule component


I hope that helps
 
Thank you, this is very helpful and slowly I start to understand how to cooperate with plugin. I have some problems in this moment:
1. I have still problem how to remove this item I equipped from inventory grid, and item I unequipped from equipped grid. I have it:Bez tytułu.png
I assigned it to inventory grid but I dont know how to set it up.

2. I use this plugin in 2D Metroidvania. Actually when player drops an item, there is a prefab dropped on the map but I can't pick it up via keyboard again, how could I do it? I would also like to add something like in Death Gambit, info what item is in actually in our pickup radius. And how to handle situation where there are many items in our radius?
Deaths-Gambit-Journeys-End-10.jpg

3. When I try to equip item, item is moved to Equipped grid but I have error in console:
Prefab Attribute is undefined for Attribute EquipmentPrefab.
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Opsive.UltimateInventorySystem.Equipping.Equipper:CreateItemObject (Opsive.UltimateInventorySystem.Core.Item) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Equipping/Equipper.cs:615)
Opsive.UltimateInventorySystem.Equipping.Equipper:Equip (Opsive.UltimateInventorySystem.Core.Item,int) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Equipping/Equipper.cs:262)
Opsive.UltimateInventorySystem.Equipping.Equipper:OnAddedItemToInventory (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Equipping/Equipper.cs:210)
Opsive.Shared.Events.InvokableAction`2<Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack>:Invoke (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack)
Opsive.Shared.Events.EventHandler:ExecuteEvent<Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack> (object,string,Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection:NotifyAdd (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:453)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:SetItemAmount (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,bool) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:287)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:AddItemInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:238)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:AddItem (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:202)
Opsive.UltimateInventorySystem.ItemActions.MoveToCollectionItemAction:InvokeActionInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/ItemActions/MoveToCollectionItemAction.cs:103)
Opsive.UltimateInventorySystem.ItemActions.ItemAction:InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,Opsive.UltimateInventorySystem.ItemActions.ItemUser) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ItemActionPanel:InvokeActionInternal (int) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ItemActionPanel.cs:84)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ActionPanel`1<Opsive.UltimateInventorySystem.ItemActions.ItemAction>:InvokeAction (int) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ActionPanel.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ActionPanel`1/<>c__DisplayClass18_0<Opsive.UltimateInventorySystem.ItemActions.ItemAction>:<OpenInternal>b__0 () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ActionPanel.cs:77)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:press () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:88)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnSubmit (UnityEngine.EventSystems.BaseEventData) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:273)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)
 
1) Well you want to hide the items that are equipped so simpl set you equipment itemCollection name in the list of ItemCollection to hide.

2) That is completely up to you. You can use our Interactable system or you can use your own.
Take a look at those two pages.

3) It seems you are using the Equipper component. This expects Items that are equipped to spawn a prefab on the Character.
The prefab is a GameObject that you set in an Attribute with a matching name (in this case "EquipmentPrefab")
If that's not what you want you should remove or replace the Equipper script
 
Yes this was also helpful, I just struggle with pick up.

1) I know how to assign pickup prefab but, I dont know how to set up this UI elements that show items picked and shows item name that we collide with, like in this tutorial:

2. I also use new input system and I have interaction key assigned to E with possibility to rebind it. But I can't figure it out how to interact with this item to pick it up. I can use auto pick up and then it works, but I want to use my New Input Key to pick them up.
 
1)The ItemPickup has a field for an ItemView. In the demo scene we use a World Space canvas with an ItemView inside such that the pickup can tell it what to show.
I'd recommend you check out the itempickup in the demo scene and look at all the components it uses, that's the best way to learn

2) Have you downloaded the new input system integration? Make sure to follow the instructions
Make sure you read these pages too
Have a look at your Inventory Interactor and see if the input mataches
 
1)The ItemPickup has a field for an ItemView. In the demo scene we use a World Space canvas with an ItemView inside such that the pickup can tell it what to show.
I'd recommend you check out the itempickup in the demo scene and look at all the components it uses, that's the best way to learn
Yes, I just have problem because this canvas with name and ammount is not showing when Player is close to the item, this canvas is always hidden. I also use 2 Inventory System Canvas, one is for inventory in another game object, and second is for picked items popup panels, but I noticed they can't cooperate together, panel owner is assigned only to one of them and I get the error, how could I solve that?

2) Have you downloaded the new input system integration? Make sure to follow the instructions
Make sure you read these pages too
Have a look at your Inventory Interactor and see if the input mataches
I interacted New Input System exactly like in the tutorial. I have Inventory Interactor, Input type Button Down and Input Name: Action. Actually I wanted change this Input Name to Interact. because I have this input maps assigned to the player. But I get the error :
Button "Interact" is not setup. Please create a button mapping within the Unity Input Manager.
I have no idea which Input Actions Interactor uses, I noticed it takes it from Inventory but I also dont know where Inventory gets this input actions.
1667390967324.png1667390923014.png
 
1)
You do not need a DisplayPanelManager or PanelOwner for the pickup canvas.
Once again I recommend you have a look at the pickup in the demo scene and look at how it is setup.
You can also have a look at the Pickup feature scene which goes in detail on all types of pickups

2)
It would seem that despite installing the new input sytem you are still using the "old" Unity InputManager.
ARe you sure you remove the UnityInput component by the UnityInputSystem component as the documentation steps said you should

Send me a screen shot of all the components on your character, that might help me identify what the issues is.

Also in the future allways share the full error, not just the first line, this gives me context about the error and helps me identify it with more ease
 
1667501396428.png

Well, when I use E key player pick ups the items from the ground, when this is set up like here:
1667501447483.png
But I have my own InputActions with interaction keys:
1667501494457.png
So I dont know from where this Action E key is. So when I change Input Name to: Interact I have this error below.
Button "Interact" is not setup. Please create a button mapping within the Unity Input Manager.
UnityEngine.Debug:LogError (object)
Opsive.Shared.Input.StandaloneInput:GetButton (string,Opsive.Shared.Input.InputBase/ButtonAction) (at Assets/Plugins/Opsive/Shared/Input/StandaloneInput.cs:36)
Opsive.Shared.Input.UnityInput:GetButtonInternal (string) (at Assets/Plugins/Opsive/Shared/Input/UnityInput.cs:196)
Opsive.Shared.Input.PlayerInput:GetButton (string) (at Assets/Plugins/Opsive/Shared/Input/PlayerInput.cs:143)
Opsive.UltimateInventorySystem.Input.SimpleInput:CheckInput (Opsive.Shared.Input.PlayerInput) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Input/SimpleInput.cs:81)
Opsive.UltimateInventorySystem.Interactions.InventoryInteractor:Update () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Interactions/InventoryInteractor.cs:101)


I also have to say that I can't open documentation in link : https://opsive.com/support/documentation/ultimate-inventory-system/integrations/input-system/ when I click Character Controller integration documentation, page is just refreshing.
 

Attachments

  • 1667501269494.png
    1667501269494.png
    83.9 KB · Views: 1
  • 1667501332116.png
    1667501332116.png
    31.6 KB · Views: 1
Last edited:
Has also plugin an oprion to compare item with equipped item?
How could I add colored names to items, so names when in inventory and dropped items would be red for some of them and blue for another?
How to put action list toolttip near item I selected? I created one in UI Designer and made it smaller but it totally spawn in wrong places.
 
Last edited:
I mentioned this before
You need to replace the Unity Input component by the UnityInputSystem component.
That's detailed in the integration steps you said you followed
1667806919244.png
Step 2 and 3



Has also plugin an oprion to compare item with equipped item?
Sorry I don't understand the question

How could I add colored names to items, so names when in inventory and dropped items would be red for some of them and blue for another?
Check out the ItemViews you can make your own custom ones. This video is a good starting point

How to put action list toolttip near item I selected? I created one in UI Designer and made it smaller but it totally spawn in wrong places.
You need to play around with the tooltip panel settings, you can do so in the inspector after the tooltip component was added. You have to choose the anchor point, offset, etc... until it looks good for you
 
Sorry I don't understand the question
Sorry, I mean system that's compare items in inventory with equipped items, but I already see it exist in demo scene. I set it up in my project, but my character does not use Equipper component, my project is in 2D so there is no need to show equipped items on player, but seems like this compare system expect this component because I get warning: Player character or it's equipper was not found for attribute stat comparision.

Should I set Equipper with this spawning game objects for Player or there is any other solution?
 
I'd recommend you make your own comparing script.
It should be easy to do, simply copy paste the one that works with the Equipper and replace the Equipper with your own equipping solution such that you can get that stats from them.
You'll need a function to check that stats without the item, and preview the stats as if the item was equipped before it is actually equipped.

I hope that helps
 
Top