Hi. I am attempting to do an inventory using datatables, I am just struggling to get my head around where to hold everything.
So I have an InventoryActorComponent this has an array which holds an array of InventoryItems.
An InventoryItem is a Struct that contains 2 variables, IDName and CountInt.
I have a datatable containing all my items so far, this has variables such as Name, Desciption, Weight, Equipslot, MaxStackSize, Icon, StaticMesh, SkeletalMesh etc.
I then have a WorldItem which then has an exposed variable, ID, and a Variable for the AllItemsDatatable.
What I am trying to get my head around is where I want to store data. I am planning just to use the ID anywhere I can, then pull the info from the datatable whenever it is needed.
So when you pick up the item in the world, it just passes the ID to the Inventory blueprint which compares the ID to the datatable to know what has just been picked up. Then when you hover over the item in the inventoryUMG those items just essentially hold an ID then check against the datatable to figure out what text to have “eat”, “use” etc, and what icon to display. Is this slow? Do I want my Inventory Array to actually hold an object that has already retrieved all this info on “pickup”?
Also, because weapons have different FireRates, Capacity, Accuracy etc, do I want all potential Item variable names in my AllItemsDatatable? Or is it better to have just the basic info in there, then also have a WeaponsTable which it can pass the same ID to, to retrieve info when the character actually wants to equip it.
Sorry for the rambling, thank you if you got this far! I have been trying to use tutorials, and they seem to want to create a lot of blueprints per object. I am trying to do it as efficiently as possible.