Im trying to develop an inventory within UE4 using blueprints. First ill explain in detail what Im trying to accomplish, and then ill have screenshots below of what I have so that maybe somebody with more experience can help out. (Currently still learning)
SO, I want to make an inventory system similar to skyrim, however this is not a first person game, so keep in mind that ive been using the third person template. Within this inventory, i intend to have tabs on the top left, which are categories for each item, and as you click on each category, the corresponding items are then shown directly below that. Then for each item, i have a details panel to the right, and then i also intend to implement a 3d inspection widget to the right of the details panel. But right now im just focused on adding items to the inventory.
When an item is picked up, an inventory slot widget (“inventory button”), is created for each item, IF that item doesnt already exist. If it does exist in the inventory already, the quantity is then changed and no extra slot is made. Whenever a slot is created, the items name is displayed as the button. This “item_name” variable is the binding to the text block thats parented to the button, within the inventory button widget.
So what ive tried doing here in these screenshots, is a check to see if the item exists, and if it doesnt, itll create the inventory button widget and add it to the corresponding category. (Right now im only adding the items to the “all” tab)
Here are the blueprints ive put together, with the help of some resources online. I will admit, i dont 100% understand every node, so if something looks goofy to anyone, please point it out so i can fix it! Also, if you require more details, i will be happy to provide them.
Dude making an inventory system its a hard and lengthy process I did it a few times and each time it was annoying and hard. You can’t just dump here your progress and say I need help with this, sigh well from what I can tell from you BPs is that I can’t help with your project but I do can help you with your code(too little information and you need to be more specific on what you need).
First of all, you are using structs you can use Set Member and you won’t need to connect hundreds of line each time you change a variable. Second, why are you using structs? You have an item actor and most likely always will have those items in your world, structs needed to easily save the information and while you need to save data without actors but you do have actors so just use the items actor array instead. Maybe you will need structs when you go through levels but better just use it there and not always because you will just make your system too complex for no reason.
If you need some help with something else try to be more specific like I am stuck at A B and C, what will be better to do D or G?.
Sheesh, dumping my progress huh? I just wanted some advice on how I was doing in terms of adding an item to the inventory, hence the sentence “But right now I’m just focused on adding items to the inventory.” I don’t intend to “dump” my work, and have somebody do it for me.
I am very new to this, and i will admit, this took me all week to figure out. But, i did end up figuring it out. When it comes to the structs, I’m using them to store the data that will be displayed within the inventory’s UI, and i also included the mesh (skeletal or static) because i didn’t know if i would need it for the 3D item inspection view that ill be implementing later.
Hi, instead of putting all the item info into your blueprint and structures it might be easier to just use an “item key” and then create a data table where you save all the item info (a datatable using your item struct) and access that information via the “item key”.
Then you would only need to have the “item key” and the amount. That would save you all the variables inside the item blueprint and you wouldn’t need to copy structs around.
Also I always find it easier to separate the logic from what is visually displayed to the player. So I only create the inventory widget with the items shown when the player opens the inventory and remove it afterwards.
Also for the 3d view I wouldn’t use skeletal meshes (only if you want to display animations) and just do everything with static meshes (you can create a static mesh from a skeletal mesh). Then you won’t need to do your logic twice for static mesh and skeletal mesh.