Page 1 of 1

[Rseding91] [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Sat Sep 21, 2019 6:18 pm
by TheFunnySide
To reproduce this:
-have an assembler on the cursor
-press r for rotate
-it now places 0.5 tiles to the side.
-Its collision box is not rotated(this part is correctly working)

The assembler cant have a pipe connection else it is allowed to rotate normaly
The assembler has to have different width to height.
This worked for me:
collision_box = {{-1.7, -2.2}, {1.7, 2.2}},
selection_box = {{-2.0, -2.5}, {2.0, 2.5}},


This can be prevented by placing the "not-rotatable" flag

Re: [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Sat Sep 21, 2019 7:04 pm
by Rseding91
Thanks for the report however I don't understand: what part of it is "not rotatable" when it doesn't have the "not-rotatable" flag defined?

Re: [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Sat Sep 21, 2019 8:04 pm
by TheFunnySide
I attached an number of images showing that the assembler is ofset by 0.5 tiles after pressing r before placing. Its collision box is also not rotated.

Re: [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Sat Sep 21, 2019 8:22 pm
by DaveMcW
TheFunnySide wrote:
Sat Sep 21, 2019 6:18 pm
The assembler cant have a pipe connection else it is allowed to rotate normaly
Assembling machine rotation is not supported unless it has a pipe.

Re: [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Sat Sep 21, 2019 8:33 pm
by Bilka
DaveMcW wrote:
Sat Sep 21, 2019 8:22 pm
TheFunnySide wrote:
Sat Sep 21, 2019 6:18 pm
The assembler cant have a pipe connection else it is allowed to rotate normaly
Assembling machine rotation is not supported unless it has a pipe.
Wrong.
https://wiki.factorio.com/Prototype/CraftingMachine wrote:Note that a crafting machine cannot be rotated unless it has at least one of the following: a fluid box, a heat energy source, a fluid energy source, or a non-square collision box. Crafting machines with non-square collision boxes can only be rotated before placement, not after.

Re: [Rseding91] [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Wed Sep 25, 2019 10:54 pm
by Rseding91
Thanks for the additional information. It's now fixed for the next version of 0.17.

Re: [Rseding91] [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Thu Sep 26, 2019 6:45 am
by boskid
I think there will be more issues here.
Since this CraftingMachine is not square and there is no option for mods to prevent it from rotating while in simulation (before building) mod author will need to provide graphics for 90deg rotation.

Above mentioned fix will only prevent rotation of existing building (since allowing rotation here would require updating entity position and checking for collisions with other entities).

For now there is also no way for lua to prevent player from rotating simulation since this does not produce InputActions (so there is no lag on multiplayer with showing where entity is going to be placed).
Full fix would be something like pre 0.17 rocket-silo that was 9x10, was not rotatable even in simulation and was causing blueprint to only be placable in two directions (0deg and 180deg).

Extra catch here is that CraftingMachine that is not square but has pipe connections, should be allowed to rotate like a boiler: by 180deg on single rotate action.

Re: [Rseding91] [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Thu Sep 26, 2019 6:57 am
by Bilka
boskid wrote:
Thu Sep 26, 2019 6:45 am
I think there will be more issues here.
Since this CraftingMachine is not square and there is no option for mods to prevent it from rotating while in simulation (before building) mod author will need to provide graphics for 90deg rotation.
There's https://wiki.factorio.com/Types/EntityP ... tatable.22 which TheFunnySide is using to work around this bug.
boskid wrote:
Thu Sep 26, 2019 6:45 am
Above mentioned fix will only prevent rotation of existing building (since allowing rotation here would require updating entity position and checking for collisions with other entities).
So, same as before, see the wiki quote.
boskid wrote:
Thu Sep 26, 2019 6:45 am
For now there is also no way for lua to prevent player from rotating simulation since this does not produce InputActions (so there is no lag on multiplayer with showing where entity is going to be placed).
Full fix would be something like pre 0.17 rocket-silo that was 9x10, was not rotatable even in simulation and was causing blueprint to only be placable in two directions (0deg and 180deg).
Which is what https://wiki.factorio.com/Types/EntityP ... tatable.22 does.

Re: [Rseding91] [0.17.69] Rotating not rotateable Assembler results in offgrid placement

Posted: Thu Sep 26, 2019 7:12 am
by boskid
Bilka wrote:
Thu Sep 26, 2019 6:57 am
There's https://wiki.factorio.com/Types/EntityP ... tatable.22 which TheFunnySide is using to work around this bug.
Oh i see. So this issue (after fix) that can be triggered by rotating before building:
sheep-farm-pre-rotate.png
sheep-farm-pre-rotate.png (86.61 KiB) Viewed 1672 times
Is caused by sheep farm not using "not-rotatable" flag in its prototype and this is mod issue, not game issue.
sheep farm prototype