Page 1 of 1

How can I multiply only ingredient amount and not crashing the mod (Coding Problem)

Posted: Tue Apr 15, 2025 12:51 pm
by nattanang
This mod crash because all 3 types of ingredient input is multiply by local cost multiplier, causing crash in line 42 of the code.
My question is how can I multiply only "Ingredient Amount" input by local cost multiplier without crashing the mod
Thanks in advanced

Re: How can I multiply only ingredient amount and not crashing the mod (Coding Problem)

Posted: Tue Apr 15, 2025 4:21 pm
by robot256
You are getting the error on line 42 because it is trying to read the ingredients tables that you added on line 31. You added them with "type" as a named field in the table, but name and amount are given positionally so they are actually [1] and [2] respectively. You need to specify them as "name=ingredient.name" and "amount=ingredient.amount*cost_multiplier" on both line 31 and line 42 for it to work and to maintain consistency.