Download

Inventory Item Blueprint Hierarchy And Array Question

Hi I built an inventory system but want to make it more streamlined. I posted a similar post here: Max number of variables in a Struct? - Blueprint Visual Scripting - Unreal Engine Forums but I started a new thread because it’s a different question.

I just wanted to know the best practice to setup the blueprints for an inventory.

I have a BP_MasterItem as the parent class without a struct right now.

What I have so far:
BP_MasterItem
• BP_Edibles
• BP_Weapons
• BP_Wearables
• BP_Craftables
• BP_Materials
• BP_Projectiles
• BP_Medical
• BP_Misc

Each sub class has their own struct, is this what I should do? I only have one main inventory array. This might be an obvious question but I would then need an array for each sub class struct right? I would need to make a master struct with each sub class array variable? and then add that struct to the BP_MasterItem?

Once I figure this out I can build this but for some reason I can’t figure out the best approach right now.

My end goal would be to have a data table for each sub class so making default editing simple and easy. I hope I can still use separate data tables per sub class.

Let me know you ideas and thanks.

It may help if you separate the idea of an inventory entry and the actor it represents. The inventory in an MMORPG (for example) just needs to know some basic information about the item it contains. At the inventory level this will be data such as it’s order/position, quantity etc. (handled by some sort of “add to inventory” function). At the item level the data will be specific to the item, such as its name, icon, mouseover text etc.

If you want to keep all of the actor data corresponding to the inventory entry you do not need to copy all of it over, you can simply save a reference to that actor and hide it from view (ideally disabling any input, event ticks, timers, timelines etc).

Edit: feel free to query for more detail on any point

I get what you are saying about in the first part of your comment, I think I will try that path next. I just had a question on “If you want to keep all of the actor data corresponding to the inventory entry you do not need to copy all of it over, you can simply save a reference to that actor and hide it from view (ideally disabling any input, event ticks, timers, timelines etc).”

Thanks