Code: Select all
7.436 Error ModManager.cpp:1623: Failed to load mod "GCKI": __GCKI__/libs/recipe-functions.lua:1111: attempt to compare number with string
Code: Select all
7.443 Script @__GCKI__/libs/debugging.lua:159: results: {
{
amount = 1,
name = "nullius-box-phosphorus",
type = "item"
},
{
amount = 12,
name = "nullius-box-gravel",
type = "item"
},
{
amount = "120", -- String instead of number!
name = "nullius-carbon-monoxide",
type = "fluid"
}
}
Code: Select all
for r, result in ipairs(results or {}) do
amount = result[2] or result.amount
if amount and amount > 0 then -- CRASHING
…
I removed my mod, restarted the game -- and sure enough, the recipe was there, and it also created the expected fluid result! So, if Types/FluidProductPrototype.amount is a string that can be converted to a number, the game will accept it.
I've dug around some more and found that this also applies to the properties amount_min, amount_max, and catalyst_amount (both Types/ItemProductType and Types/FluidProductType) as well as the property temperature (only Types/FluidProductType).
Changing recipe.results to
Code: Select all
results = {
{"nullius-box-phosphorus", 1},
-- {"nullius-box-gravel", 12},
{type = "item", name = "nullius-box-gravel", amount_min = "12", amount_max = "15", catalyst_amount = "7"},
-- {type="fluid", name="nullius-carbon-monoxide", amount = "120"}
{type="fluid", name="nullius-carbon-monoxide", amount_min = "120", amount_max = "123", temperature = "66.6", catalyst_amount = "5"}
},
Code: Select all
{type="fluid", name="nullius-carbon-monoxide", amount_min = "120", amount_max = "123", temperature = "66.6", catalyst_amount = "5", probability = "0.5"}
Code: Select all
-- probability = "0.5"
probability = ".5"
Code: Select all
Error ModManager.cpp:1623: Error while loading recipe prototype "lambent-nil-boxed-phosphorus-1" (recipe): Difficulty normal: Value must be a number in property tree at ROOT.recipe.lambent-nil-boxed-phosphorus-1.results[2].probability
My recommendation: Keep the current behavior (but fix that the first character of a number-strings may not be a decimal point) and update the documentation.