The machine - non-square (rectangular) crafting machine with fluid_boxes and fluid_boxes_off_when_no_fluid_recipe = true
The machine can be placed, and if you try to rotate it, it doesn't rotate (conventional behavior for assemblers), and does not raise on_player_rotated_entity , or, it does rotate, and changes direction in the event and LuaEntity (which also draws different direction graphics)
What happens:
The machine can be placed, and if you try to rotate it, it doesn't rotate, and does raise on_player_rotated_entity, but the direction does not change.
Why is this a problem?
For mods that are reacting to the entity rotating and changing e.g. "attached" loaders, or other combined entities, this causes unexpected behavior, including that from a design standpoint, the entity doesn't look like it rotated, leading to a rabbit hole of "why are my graphics wrong, it did rotate?".
Example mod:
Code: Select all
local chem = data.raw["assembling-machine"]["chemical-plant"]
chem.collision_box = {
{
-2.2,
-1.2
},
{
2.2,
1.2
}
}
chem.fluid_boxes_off_when_no_fluid_recipe = true
Code: Select all
script.on_event(defines.events.on_player_rotated_entity, function(event)
game.print("rotated, direction: "..event.entity.direction)
end)
Save file:
For comparison, an assembling-machine-2 is beside, which elicits "This cannot be rotated." (the first example of potentially "proper" behavior). More organically, the second option of successfully rotating and altering the LuaEntity makes "sense", whether it's for direction-able assemblers, square or otherwise.