Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hello! I am getting an error "TypeError – Cannot read property 'result' of undefined" when I try to craft something using an ingredient with the  <UNCONSUMABLE: success> tag. Without the tag everything works fine.

This is the error log:

Interesting.

I'll look into the error in a bit and get back to you. In the mean time, what happens if you enable the plugin function to have soft failures? Does it still error if you use the same recipe? That line specifically is for when soft failure is disabled, while a similar thing happens when it's enabled, it's possible the error is only happening on that one function.

~Ramza

Thanks for the quick reply! I've tried it out on a fresh test project with all the options on default, and it's still happening.


Hello.

I've tried to reproduce this and I can't seem to cause it to cause this error on my test project. In all cases, I tested recipes which only used 'items' as ingredients, no weapons, or armors. I tried where the first ingredient in the recipe was unconsumable, and also where the second was unconsumable. I also tried with the independent items patch and ItemCore turned on and off. In all cases, the expected items remain in the inventory, and the other items are taken as normal, with no errors thrown or crashes.

Any more insight you can provide to help me track this down more?

I tested a bit more, and it looks like this only happens when *all* items in a recipe are marked as unconsumable. As long as at least one item is consumed, everything works fine.

(For context, I am using the system for an investigation-type scenario where you get the different clues as items, and then you can combine them to create new clues. So I've been marking all the "ingredients" as unconsumable, because you'd still have them after "analyzing" them.)

Alright, I can work with that. The function that removes the items from the inventory after a successful craft works from a list of the ingredients, and the list is only populated with the ingredients that were actually consumed, so if the list was empty, instead of just moving on, it tries to read an object that doesn't exist and fails instead.

I should be able to get that sorted out fairly soon.

I found the issue and have it corrected in the latest version. Please give that a download and make sure everything is working as it should be.

It's working perfectly now, thank you!