Errors on lua-api.factorio.com?
Posted: Mon Apr 17, 2017 7:52 pm
If you look at http://lua-api.factorio.com/latest/Conc ... Ingredient you see amount :: uint: Amount of the item.
But when you execute this,
/c game.player.print(game.player.force.recipes['processing-unit'].ingredients[3].amount)
The output is 0.5 for the sulfuric-acid to make a processing unit.
How can an uint have the value 0.5?
Another thing, related to this, in http://lua-api.factorio.com/latest/Conc ... ml#Product
amount :: float (optional): Amount of the item or fluid to give. If not specified, amount_min, amount_max and probability must all be specified.
amount_min :: uint (optional): Minimal amount of the item or fluid to give. Has no effect when amount is specified.
amount_max :: uint (optional): Maximum amount of the item or fluid to give. Has no effect when amount is specified.
probability :: double (optional): A value in range [0, 1]. Item or fluid is only given with this probability; otherwise no product is produced. Has no effect when amount is specified.
Are the types really float, uint and double?
So I'm not sure what to believe at the moment.
My guess is I can interpret all numbers as double, because all 32 bits integers fit in a double without loss and for my goal that's probably enough.
My question to the devs, isn't the lua-api.factorio.com generated from the source code?
But when you execute this,
/c game.player.print(game.player.force.recipes['processing-unit'].ingredients[3].amount)
The output is 0.5 for the sulfuric-acid to make a processing unit.
How can an uint have the value 0.5?
Another thing, related to this, in http://lua-api.factorio.com/latest/Conc ... ml#Product
amount :: float (optional): Amount of the item or fluid to give. If not specified, amount_min, amount_max and probability must all be specified.
amount_min :: uint (optional): Minimal amount of the item or fluid to give. Has no effect when amount is specified.
amount_max :: uint (optional): Maximum amount of the item or fluid to give. Has no effect when amount is specified.
probability :: double (optional): A value in range [0, 1]. Item or fluid is only given with this probability; otherwise no product is produced. Has no effect when amount is specified.
Are the types really float, uint and double?
So I'm not sure what to believe at the moment.
My guess is I can interpret all numbers as double, because all 32 bits integers fit in a double without loss and for my goal that's probably enough.
My question to the devs, isn't the lua-api.factorio.com generated from the source code?