I'm working on a crafting mechanism that allows the user to combine door keys based on the primary colors (red, yellow, blue) into new keys based on secondary colors (red+blue=purple, yellow+blue=green....) but part of the puzzle is that need to be able to "uncraft" an item back to its component parts(e.g. break down a purple key back to red and blue)
I can get the inventory management working using custom action lists, but I can't figure out a way to change the crafting output window to display multiple items (even using a custom action list, it still seems to just display whatever is listed in the "Resulting Item" drop down in the recipe manager.
Is there a way? Should I code a custom crafting UI instead?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @frankyp.
The crafting system is limited to one "created" item per recipe. A custom UI may be necessary (though this should be made easier by the updated inventory API in v1.72.0), but it may be possible to cheat things a little bit.
Taking your example of uncrafting purple to red and blue, I can think of a couple of hacky ways you could go about it:
It should be a case of hooking into the OnInventoryAdd_Alt custom event, which can be used to run custom code in the event that the Player added an item to the crafting table. If so, check which Recipe is now valid - and update a RawImage texture with a specific item if so:
In this test script, it'll check if Recipe 2 is valid, and then displays Inventory Item 3 in a Raw Image component. You can change the numbers / put things into a custom data set if that's the approach you want, but this is just a quick proof of concept.
I’m new to Unity, but not to programming in general, already Adventure Creator has saved me countless hours, and was well worth the price!