[Lou][2.0.63] tile_buildability_rules behaving differently than expected

User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 247
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

[Lou][2.0.63] tile_buildability_rules behaving differently than expected

Post by Quezler »

Code: Select all

local prototype = data.raw["assembling-machine"]["assembling-machine-1"]
prototype.tile_buildability_rules = prototype.tile_buildability_rules or {}
table.insert(prototype.tile_buildability_rules, {
  area = prototype.collision_box,
  colliding_tiles = {layers = {lava_tile = true}},
})
expected behavior: that rule only collides with lava tiles. (assembling machine already unplacable on it, but that is irrelevant)
observed behavior: the assembling machine cannot be placed anywhere anymore.

When you comment out the colliding_tiles part you get the "At least one of 'required_tiles' or 'colliding_tiles' must be set." message which suggests that you can use colliding_tiles without required_tiles, so i believe this is a bug.
Osmo
Fast Inserter
Fast Inserter
Posts: 112
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: [2.0.63] tile_buildability_rules behaving differently than expected

Post by Osmo »

Have you also modified the collision mask of the assembler?
If not, it will require the area to collide with lava, while also colliding with lava itself, preventing its placement anywhere. Collision masks functions independently of the tile buildability rules.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 247
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

Re: [2.0.63] tile_buildability_rules behaving differently than expected

Post by Quezler »

im not quite sure sure how that is relevant to this bug.

the problem is that the optional required tiles default to collisionmask::none, which when the tile buildability rules check it always returns false.

instead it should default to colliding with every layer or just skip the check entirely.

like the temporary fix i used in the space exploration codebase is just to iterate all the collision layer prototypes and just shove that in the required table so that essentially never fails so only the colliding tiles actually matters.
Post Reply

Return to “Assigned”