[0.17.3] autoplace_specification attributes missing

Bugs that are actually features.
Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

[0.17.3] autoplace_specification attributes missing

Post 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)

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.3] autoplace_specification attributes missing

Post 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.

TOGoS
Former Staff
Former Staff
Posts: 93
Joined: Fri Jun 24, 2016 2:29 pm
Contact:

Re: [0.17.3] autoplace_specification attributes missing

Post 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.


Post Reply

Return to “Not a bug”