When a prototype has a selection_box (possibly also collision_box ?) set to be non centered, this is placed based on the entities 4 main directions (N, E, S, W) cleanly, but for the extra rotations (NE, SE, SW, NW) in an 8 way rotatable entity the offsets are always as if the rotation is north.
Example selection box specification on a rail signal: `selection_box = {{0.5, -0.5}, {1.5, 0.5}} -- shifted +1 on the x from center`
In this example a modded rail signal has it's selection box moved offset from the centre of the entity. The aim was to get it towards the middle of the rails so that rails could be built directly next to each other with the signals embedded in the rails.
The rail signal graphics has a hard coded shift in their graphic a tile to the left, this is irrelevant from the bug. The collision boxes are default and show where the signals really are.
In the below picture the North, East, West and South orientations of the custom rail signal all have their selection boxes moved towards the centre of the rails due to their rotation as expected. These selection_box's are highlighted green in the picture.
The NorthEast, SouthEast, SouthWest and NorthWest orientations of the custom rail signal all have their selection boxes shifted east, this is the same as the North direction. These selection_box's are highlighted yellow. This is the issue that Factorio isn't rotating or offsetting these based on their direction. Obviously Factorio does this for vehicles with their orientations, but doesn't seem to for non orientation entities.
Mod:
Save:
[boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: [boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype
Thanks for the report. Issue is now fixed for 1.2.0. I do not want to back-port this fix to 1.1.x.