In order to display the content of the inventory in the content browser settings, enable the display of the content of the engine and plugins.
Inventory content folder is in this path.
You can also open a demo level with a demonstration of the inventory capabilities.
Open your character blueprint.
Click "Add Component" and add "BP Inventory Component" (If you are making a multiplayer project, I advise you to add a component to the PlayerController).
Set up controls like this:
Block movement if inventory is open:
Add any collision to the character so that we can determine what items hit it.
Set up interaction with objects as follows. Specify the "Actor" in the class filter.
Сlick on the BP_InventoryComponent and make sure that the settings file is selected in the setting tab.
First part completed. You can already use inventory on standard settings. For more customization, go to part two.
Open the Content Browser and check the box "Show Plugin Content"
Open the settings file.
Adjust the size of the inventory, store and chest.
Open BP_InventoryActor.
In the construction script, connect the nodes to display the slots. Select in them the type and size that you have chosen in the settings. Don't forget to disable them after setup to avoid errors.
Slots displayed in the viewport.
Adjust their location by moving these components.
You can also add any components to the background to give the impression that the items are in a chest or drawer.
Adjust the camera height.
Set the lighting you want. Lighting channel 2 must be set in each lighting component, otherwise the light will not work.
Remove all nodes from the construction script.
In the inventory component in your character or player controller, enable debug mode.
Start the game in the viewport and open inventory. Stop game.
Open WB_Inventory.
The current location of your inventory should appear on the screen, if this does not happen, start the game in the viewport again, open the inventory and stop the game.
Fine-adjust the size box components so that they completely cover the slots.
From the "Plugins/Inventory3D/Content/Inventory3D/Actors/Blueprints/" folder, put the Shop and Chest actors on the stage.
Start the game, open the Shop and stop the game so that the slots are displayed in the widget. Adjust ShopSlotsSizeBox to your desired size.
Repeat the same with the chest.
!!!Disable debug mode.
You may have noticed that when you drag an element, it either lags far behind the mouse or rushes.
Adjust the setting in the settings so that the item follows the mouse clearly.
Second part completed
Create a new blueprint inherited from "BP_ItemActor" or "ItemActor".
You can also create an item through the context menu.
In the default class settings, select all the item settings you need. After you select a mesh, it will be displayed on the stage.
Adjust to desired size.
Add to the stage BP_WorldItem.
In it, select the class of the newly created item and its amount.
You can also add an item to your inventory with a node.
My item is taking up more space than it should.
I returned to the blueprint of the created item and adjusted its size.
Part Three Completed.
Open BP_InventoryActor.
Add Child Actor Component
Drag it to "Root Of Equipment Slots"
Select child actor class "BP_InventorySlotActor"
IMPORTANT!!! The index must contain a number that takes into account the number of hardware slots already available. If you have one slot, the number should be 0. If you have two slots, then one is 0 and the other is 1.
I already have 4 equipment slots. I add 5th so my number will be 4.
Adjust size.
Open WB_Inventory.
Enable the debug mod in the inventory component. Play game in viewport, open inventory and stopgame.
Add WB Inventory Slot to EquipmentSlotsCanvas
Resize to fit the new slot.
Also set the index number.
In the settings of any item in the equipment settings tab, check the "Can Equip" box and select those slots in the array in which you can put the item.
Set the rotation with which the item will lie in the slot.
Everything worked out. Disable the debug mod in the inventory component.
Part Completed.
You must enable replication in all inventory, shop and storage components.
Be sure to check the validity of the link to the inventory so that there are no errors before it is replicated.
Add any collision to the character or use the one you used to pick up items.
Attach such logic to the event tick.
Add PostProcessVolume to the map
Turn it on to cover the whole map.
Add PP_Outliner_Inst to Post Process Material Array.
To change the color, open Add PP_Outliner_Inst and change the color.
Add the Storage component to your blueprint.
Add your blueprint to the scene, select the Storage Component in it, and generate a new GUID. This is necessary for the save to work correctly.
Generate a new GUID for each object with a Storage Component in the scene.
Add the items and their amount that will initially lie in your chest.
It's all. For the shop component, do the same. To make your chests light up when you approach them, add a new "Interactions" interface to your blueprint.
Write the following logic for new events, where the cube is your chest static mesh.
You need to override the function "ThrowAwayLocation" in BP_Inventory Component.
Video instructions