Make entities with square collision_box but non-square tile_buildability_rules also rotatable

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
jurgy
Inserter
Inserter
Posts: 30
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

Make entities with square collision_box but non-square tile_buildability_rules also rotatable

Post by jurgy »

If you add the following modifications to the assembling machine prototypes:

Code: Select all

data.raw["assembling-machine"]["assembling-machine-1"].collision_mask = {layers={}}
data.raw["assembling-machine"]["assembling-machine-2"].collision_mask = {layers={}}
data.raw["assembling-machine"]["assembling-machine-3"].collision_mask = {layers={}}

data.raw["assembling-machine"]["assembling-machine-1"].tile_buildability_rules = {
  {
      area = {{-1.5, -0.3}, {1.5, 1.5}},
      required_tiles = {layers={ground_tile=true}},
      colliding_tiles = {layers={water_tile=true}},
  },
  {
    area = {{-1.5, -1.5}, {1.5, -0.8}},
    required_tiles = {layers={water_tile=true}},
    colliding_tiles = {layers={ground_tile=true}},
  },
}
(collision_masks of assembler-2 and 3 edited because upgradability rules require the same masks)

You can place the assembler-1 on the water edge when there's water north of the assembler.

The building cannot, however, be rotated so no method exists to allow water on either side exclusively without a hack like making the collision_box non-square:

Code: Select all

data.raw["assembling-machine"]["assembling-machine-1"].collision_box[1][1] = data.raw["assembling-machine"]["assembling-machine-1"].collision_box[1][1] - 0.01
Post Reply

Return to “Modding interface requests”