I have one recipe with three ingredients. I've put them in a "special" items category.
On "create recipe" (actionlist) I've tried different things - removing the items separately as well as removing all items from the item category. After crafting, the ingredients are still shown in my inventory.
Wondering if its something I have to restart the game for and play until that step, instead of loading a save game right before crafting and trying it directly. But I'm not very optimistic that I won't get the same result.
Will give an update if I find out more about this.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I have managed to remove the items via the "Create" actionlist in the Crafting menu - I've removed them with "remove all items in category", depending on another variable I had set up.
But I don't think this is how it should work, since the menu should work generic for all kinds of recipes and not just this one. For my little game jam project its fine for now, but it would be cool to know how to actually fix it.
Crafting a Recipe should always result in its Ingredients being removed - or reduced in number if the Recipe involves Items that have Can carry multiple? checked.
Could you share screenshots of your Recipe, items, crafting menu, and ActionLists? I'll attempt a recreation.
Yes, I also think that it may have worked before as expected and maybe I messed it up somehow.
My ingredients are unique and do not have "can carry multiple" checked.
Here are the screenshots: https://imgur.com/a/533jPLM
As you can see, I have those item remove actions for now in both actionlists, but the ones in the recipe on create didn't have any effect.
I realize now that I have "create recipe" in both action lists. This can't be correct.
Maybe you can give me some hint where it belongs.
Technically, no "Create Recipe" Actions are needed - as your Ouput box has "Result is automatic?" checked.
The Output box will show the calculated recipe - either by it being automatic, or due to the Action being run. The ingredient items, however, are only removed once the Player takes the resulting item and adds it to their inventory.
If you keep the above option checked, clear all the ActionList fields, and set the Recipe's When click on result to Just Move To Inventory, you should find that you can still craft Recipes and take their items, losing their ingredients at the same time. Does that differ from your intended behaviour?
Yes it does differ:
My intended behaviour is that the output just shows a preview of what I will get once I click on "create".
I have disabled collecting that item via clicking on the output.
Instead I want the item to be added to the inventory once I clicked on "create", which closes the menu - but not "just" move it to the inventory, since I want to inform the player what happened (that they now find the item in their inventory).
Since I didn't get that craft preview shown when I disabled "automatic", this wasn't an option for me either, unfortunately.
It is the only recipe I want to craft in this game, but of course it would be great to have a stable solution that would also work if I would need to be able to craft more than that.
Mmh. Of course it would be annoying if the menu was always closed after crafting, if you wanted to craft more than just one object. So this is optional, after all.
But it is really helpful for players to clearly see if I already crafted that object or if what I see is just a "would be" result - and that I collect it by clicking on it (and they don't need to click "create"). Of course I can fix this or that by adding/changing explaining text labels.
I guess I need to think about that a bit more.
Your information about that "create recipe" action not really needed when "result is automatic", was already helpful - thank you!
I need to clear up my actions after a pause after the current game jam.
The Output box kind of is a preview, in that the actual removal/addition of items doesn't occur until the player clicks it to add it to their Inventory. The "Create Recipe" command is another means to generate this preview.
Check Result is automatic? once more, so that the preview occurs, but then remove the default "Create" Button's ActionList logic. Instead, you can use a custom script to manually handle the Inventory management:
To use it, attach to a prefab and call its CraftItem function with the Object: Call event Action (a technique covered in this tutorial).
To prevet the user from clicking the Ouput box to handle this normally, attach a Canvas Group component to the Button and uncheck Interactable.