AngryBeaver / beavers-crafting

Crafting module for Foundry
MIT License
8 stars 3 forks source link

Error with using the Gather Essence recipe #137

Open DrTravisProthro opened 5 months ago

DrTravisProthro commented 5 months ago

I cannot get the gather essence recipe to work as intended where it pulls the item's rarity and gives x amount of essence based on the rarity.

It errors with a type error and says it cannot convert undefined or null to an object. Not exactly sure what I am doing wrong or if there is simply a conflict with another module or the dnd5e system itself.

image image

AngryBeaver commented 5 months ago

Yeah the potions module is outdated. The internal structure for recipes had changed. When you open up the recipe go to the advanced section and edit the macro the "for" loop your will encounter there needs to look like this instead: for(const ingredient of Object.values(Object.values(recipeData.input)[0])){

also in dnd5e v3.x it seems the anyOfPotion is also not working anymore the new subtype detection for potions should look like: image

DrTravisProthro commented 5 months ago

Thank you for thr reply. I could see the error happening but coding isn't my background so didn't know how to fix it.

I did figure out a workaround for the AnyOfPotions however. I set the second condition to use item.system.source.custom === "Potion" and then simply tagged all my potions with the unique source and it worked like a charm.