How to create chest storage
I followed this tutorial on creating a simple inventory system in UE4.
I tried expanding it to include a chest storage so that I could place my items into the container. So if my character only had so much inventory space I could off load into the chest.
I have spent a whole day trying to get this done but no luck, I have done a ton of googling around and there are really no tutorials or examples on how to do this. A little frustrating since I feel like it's a basic thing to have in a game.
my blueprint matches the wiki tutorial from above so I wont post my scripts because it's exactly the same. I looked around for other inventory tutorials but this one was the most clear to me.
Thanks for your help
-Here are the screen captures of my setup and how it works. The above post is correct on how you approach doing a chest system. I will leave my original comment to show my progression. Basically my problem with multiple items came from not setting the construction script on the item itself. Everything works just like the inventory on the character but in the chest and I can have multiple items stored and retrieved no issue, like a real chest!
If you get stuck I would recommend walking away for a little bit and thinking about it. that's how I figured it out. I hope my images guide you in the right path.
To put it into practical terms, are you trying to create a Minecraft situation where you have a personal inventory and you want to move items into a chest? If so it basically works the same way I imagine you have your inventory set up right now. Your player has an inventory, your chest has an inventory, and to move the you remove the item from the player's inventory and add the reference to the chest.
Your Inventory setup should be modular (a component). You add the component to any actor and they now have a functional inventory interface. You call a RemoveItem method that returns an InventoryItem (output pin). You take this InventoryItem reference and add it to the other actor's InventoryComponent via AddItem's input pin.
See https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/AddingComponents/Blueprints/ to learn how to deal with components in Blueprints. It is worth noting that I don't believe you can create a custom component solely using blueprints, but you can simulate a similar effect by using interfaces.See https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/ to learn how to use Interfaces.
answered Aug 14 '16 at 04:58 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here