Page 1 of 1

[0.17.3] autoplace_specification attributes missing

Posted: Thu Feb 28, 2019 9:53 pm
by Mylon
Trying to read the ore_protype.autoplace_specification attributes ( https://lua-api.factorio.com/0.17.3/Con ... cification ) at runtime doesn't work. Expected attributes like "placement_density" and "max_probability" are nil. Previously, my mods could access the "coverage" attribute, but this attribute seems to no longer exist.

Example:
/c game.print(game.entity_prototypes["iron-ore"].autoplace_specification.placement_density)

Re: [0.17.3] autoplace_specification attributes missing

Posted: Thu Feb 28, 2019 10:24 pm
by orzelek
Mylon wrote:
Thu Feb 28, 2019 9:53 pm
Trying to read the ore_protype.autoplace_specification attributes ( https://lua-api.factorio.com/0.17.3/Con ... cification ) at runtime doesn't work. Expected attributes like "placement_density" and "max_probability" are nil. Previously, my mods could access the "coverage" attribute, but this attribute seems to no longer exist.

Example:
/c game.print(game.entity_prototypes["iron-ore"].autoplace_specification.placement_density)
Autoplace seems to be converted to richness_expression and probability_expression at least in data stage. That could explain why old attributes on prototype won't work.

Re: [0.17.3] autoplace_specification attributes missing

Posted: Thu Mar 07, 2019 4:44 pm
by TOGoS
orzelek wrote:
Thu Feb 28, 2019 10:24 pm
Mylon wrote:
Thu Feb 28, 2019 9:53 pm
Trying to read the ore_protype.autoplace_specification attributes ( https://lua-api.factorio.com/0.17.3/Con ... cification ) at runtime doesn't work. Expected attributes like "placement_density" and "max_probability" are nil. Previously, my mods could access the "coverage" attribute, but this attribute seems to no longer exist.

Example:
/c game.print(game.entity_prototypes["iron-ore"].autoplace_specification.placement_density)
Autoplace seems to be converted to richness_expression and probability_expression at least in data stage. That could explain why old attributes on prototype won't work.
That is correct. I've update the Lua API docs to indicate those two new properties. See the Types/NoiseExpression page on the wiki for more details about noise expressions.

Re: [0.17.3] autoplace_specification attributes missing

Posted: Sun Mar 10, 2019 2:33 am
by SuperSandro2000