Matching a data table to an array

Hi there, I’ve been asking in the UnrealSlackers discord and had some help but it’s not quite there yet and I can’t seem to get any further responses so I figured I’d try here too.

basically: I need to search a data table of recipes for crafting, and match one of the rows to what is in an array.

For context: The array I’m trying to match to the data table item is a set of crafting slots. So when I drop an item from my inventory into the crafting slot, it searches the data table for a row that contains just the items in that specific row and outputs the row as the return.

Here are some images for better explanation -
So here is the menu that includes the inventory on the left and the 4 crafting slots on the right -

So in a data table of crafting recipes I have a variable that I can specify the items required to craft something as seen here -

And this is currently how Im searching the data table to match to what’s in the crafting slots:

318844-capture2.png

The problem as of right now is that when i drop an item into the slot it finds what it could possibly be but only based on 1 of the items it finds. So The recipe for the sword is 1 Health Potion and 1 Mallow Squidge. So if I drop those items in it outputs correctly -

318845-capture6.png

But as soon as I add another mallow squidge on top of that, the output changes from a sword to bread because if you reference the recipe list, bread costs 2 mallow squidge although it doesnt require the health potion, so It shouldnt be outputting bread it should still be outputting the sword despite the extra quantity of ingredients.

So my question. Am I doing this right or is there a more specific way to narrow down items in a data table to match to an array (the crafting slots)?

Thanks for reading this far XD I’m a very explanatory person when I need a question answered.

Hopefully you can help.

Hey buddy,

i’m just taking a look at your implementation now. it seems that what you are doing is when you drop a reagent into the crafting slots is searching your table for items to craft that match then setting the craft-able item to that particular table entry.

i have a few questions about the dynamics of your system, for instance is this a trial and error crafting system by which i mean are craft-able items hidden from the player until they stumble upon the recipe

or

does the player select what they want to craft from a list and know the requirements of the craft-able item?

really this seems to be at its core a prevention issue, perhaps we can sync up on discord or similar to solve this one! :smiley:

let me know

V0x

Hi V0x, thanks for the reply.

It is a trial and error system indeed. The player isn’t given a drop down of any sort to show them recipes. I’m glad you have a good understanding of the issue based on my explanation. Sure we can work it out on discord if you like. I will post the answer here once it is solved for the benefit of others. Maybe send me your discord ID privately?
Thanks

Anyone is welcome to interpret an answer here since I’m still looking for a fix.