Hi all, How can I distinguish 2 items that use the same row in a data table?
I have an inventory system where I can pick up items, but when I pick up the same weapon twice, how can I distinguish them? They are the same BP
I do have an array index (The print string at the end), maybe someone knows how to do it with that?
Thanks help is appreciated
Hey there @Faze_Kaas! The answer is somewhat dependent on your inventory system. Most developers have an itemID or some other form of metadata applied to the item itself and where it’s stored.
Oh I think I see what may be happening. Are you using a data table as the inventory or just as an Item database? Wherever you’re storing your item specific data like durability, modifiers, etc is where you would also handle the item instance’s data. Looks like your inventory itself is running off of an array likely, and that’s referencing the DataTable right? When you pull out an item it’s just reading from the data table and not looking at anything else?
No worries! Just asking enough questions to see how you handled it to make my recommendations without being as general.
So your item struct, you should have whatever metadata in the object included in that. When you open the item, you could be applying the data of it to that struct to the item info from the data table and that is what constitutes your item right?
Basically when I reference metadata it’s just basically variables in whatever struct you have for the items that describe the item. Say, for a picture, metadata are the little tags like when it was taken, when the file was last used, camera type etc. For reference with items it’s just different pieces of information that let’s you identify what item it is, what it does, durability, buffs, whatever. I noticed you marked it as resolved, did you get it?