Setting LuaEntity.direction doesn't work on underground belts. It did work fine with Factorio 1.0. This breaks the Picker Extended ghost revival.
https://mods.factorio.com/mod/PickerExt ... 1f55147e34
Ghost revival is working around the strange 'build_from_cursor' behavior, which modifies the direction parameter based on whether the first or second underground is placed:
https://github.com/Nexela/PickerExtende ... eviver.lua
[Klonan] [1.1.35] LuaPlayer::build_from_cursor with underground belts flipped
-
- Inserter
- Posts: 33
- Joined: Thu Feb 13, 2020 2:22 pm
- Contact:
Re: [1.1.35] Setting direction on underground belts doesn't work
As for LuaEntity::direction not working for underground belts, this was an intended change because there were desync possibilities and even more corner cases around changing underground belt direction, so i am not considering this to qualify for a bug. Intended way of changing underground belt direction on existing entity is by using LuaEntity::rotate() which is unable to cause those weird corner cases where an underground belt would be rotated by only 90deg.
For the second part i am not sure what is being complained here.
For the second part i am not sure what is being complained here.
-
- Inserter
- Posts: 33
- Joined: Thu Feb 13, 2020 2:22 pm
- Contact:
Re: [1.1.35] Setting direction on underground belts doesn't work
LuaEntity::rotate() doesn't rotate the underground. It toggles the underground between input and output. The chute orientation remains the same. As far as I can tell, there is currently no way to change the underground orientation.
Place two undergrounds with 'build_from_cursor', both facing west (effectively half undergrounds). The first one will use the direction set in 'build_from_cursor'. The second one will be 180 degrees rotated relative to the direction set in the 'build_from_cursor' call. As far as I can tell, there is no API to determine the UI state, if it's set to build the first underground (which respects the direction) or if it's in build second underground state, which builds the 180 degrees rotated version.
-
- Inserter
- Posts: 33
- Joined: Thu Feb 13, 2020 2:22 pm
- Contact:
Re: [1.1.35] Setting direction on underground belts doesn't work
BTW, I can certainly understand that you may not want to support direction/orientation changes on underground belts. But 'build_from_cursor' should support placing them in a predictable manner that doesn't depend on hidden UI/player state.
Re: [1.1.35] Setting direction on underground belts doesn't work
Tested a work-around:
Even with clearing the cursor and putting the item back, the "hidden state" of "is this underground the other side and should be rotated on build_from_cursor" persists. Rotating doesn't change the "should the build_from_cursor direction be reversed" either, it only makes the directions the same or opposite (from cursor to build_from_cursor direction). There's also no ...reset or inconsistency when the belts are off-axis (building north/south but in cursor east/west).
An underground can be re-created with desired properties (direction, I/O + surface, force, player index / last user, e.g.) . It is worth mentioning if a belt I/O is rotated, the direction changes, even though one might think that since the "cover" and belt side are still in the same absolute locations, they wouldn't.
Even with clearing the cursor and putting the item back, the "hidden state" of "is this underground the other side and should be rotated on build_from_cursor" persists. Rotating doesn't change the "should the build_from_cursor direction be reversed" either, it only makes the directions the same or opposite (from cursor to build_from_cursor direction). There's also no ...reset or inconsistency when the belts are off-axis (building north/south but in cursor east/west).
An underground can be re-created with desired properties (direction, I/O + surface, force, player index / last user, e.g.) . It is worth mentioning if a belt I/O is rotated, the direction changes, even though one might think that since the "cover" and belt side are still in the same absolute locations, they wouldn't.
I have mods! I guess!
Link
Link
Re: [1.1.35] Setting direction on underground belts doesn't work
Thanks for the report,sushi_eater wrote: ↑Fri Jul 02, 2021 11:40 amBut 'build_from_cursor' should support placing them in a predictable manner that doesn't depend on hidden UI/player state.
Its fixed for the next release
(It will just force the internal underground flip state to 'false' when using build_from_cursor)