So I am working on a custom crafting machine, but I want to be able to make semi-shapeless recipes that works very similar to a crafting table. So for example when crafting sticks in a crafting table, there are 6 different possible combinations for the recipe
Now to recreate this function I had a few ideas,
firstly most obviously just create a recipe for each possible recipe, granted this would work, but I like to go hard or go home. So this is really un-appealing and i wouldn't like to do this, especially since I may add more machines later on and I don't want to be defining x amount of recipes per machine as that may get a bit large. Instead I would like a system which it would be able to pull out the important parts of the recipe and match that
examples:
However I have little idea on how to go about doing this and some suggestions would be greatly appreciated
my ideas,
make "patterns" and if the recipe contains the pattern convert it to whatever the pattern says it should convert it to
make a 9 bit converter, be able to recognize useless info and remove it
[doublepost=1504128129,1504112214][/doublepost]Scratch this I figured out that you can just check each row and column in the inventory, and if all of the spots are air, you set it to remove the slot, then check the recipe
o = empty slot
x = filled slot
r1
o o x
o o x
o o o
r2
o x o
o x o
o o o
r3
x o o
x o o
o o o
r4
o o o
o o x
o o x
r5
o o o
o x o
o x o
r6
o o o
x o o
x o o
x = filled slot
r1
o o x
o o x
o o o
r2
o x o
o x o
o o o
r3
x o o
x o o
o o o
r4
o o o
o o x
o o x
r5
o o o
o x o
o x o
r6
o o o
x o o
x o o
Now to recreate this function I had a few ideas,
firstly most obviously just create a recipe for each possible recipe, granted this would work, but I like to go hard or go home. So this is really un-appealing and i wouldn't like to do this, especially since I may add more machines later on and I don't want to be defining x amount of recipes per machine as that may get a bit large. Instead I would like a system which it would be able to pull out the important parts of the recipe and match that
examples:
input
x o x
x x x
o o o
output
x o x
x x x
x o x
x x x
o o o
output
x o x
x x x
input
o o o
x o x
o o o
ouput
x o x
o o o
x o x
o o o
ouput
x o x
input
x o o
o o o
o o x
output
x o o
o o o
o o x
x o o
o o o
o o x
output
x o o
o o o
o o x
my ideas,
make "patterns" and if the recipe contains the pattern convert it to whatever the pattern says it should convert it to
make a 9 bit converter, be able to recognize useless info and remove it
[doublepost=1504128129,1504112214][/doublepost]Scratch this I figured out that you can just check each row and column in the inventory, and if all of the spots are air, you set it to remove the slot, then check the recipe