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
How can I multiply only ingredient amount and not crashing the mod (Coding Problem)
How can I multiply only ingredient amount and not crashing the mod (Coding Problem)
- Attachments
-
- ภาพหน้าจอ (269).png (44.42 KiB) Viewed 197 times
-
- ภาพหน้าจอ (271).png (277.08 KiB) Viewed 197 times
-
- Wretlaw-Beacon-Rebalance.zip
- (1.84 MiB) Downloaded 20 times
Re: How can I multiply only ingredient amount and not crashing the mod (Coding Problem)
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.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk