Solved special crafting

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

cheatchki

Supporter ++
Jun 26, 2017
49
1
8
24
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
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

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
input
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
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
 
Status
Not open for further replies.