[1.1.57] Crash flipping modded inserter "Saving in this state will result in a desync when loaded."
Posted: Sat Apr 30, 2022 12:04 am
I've been toying with the idea of a diagonal inserter challenge mod, and for a while I would get a crash seemingly at random when the game would save, both during a manual save or an autosave.
I've finally figured out a way to reproduce it, considering the mod I made was very simple.
I've set the inserter pickup and insert positions to have the same x offset as their y offset, so they become 45 degree inserters instead of straight on.
You can rotate them fine, and do everything you can with a normal inserter, but if you decide to flip inserters horizontally (relative to the inserter) then it flips the positions of insert and pickup, while keeping the same orientation of the entity. Since I did not set the allow_custom_vectors property to true, when you go to save the game the positions are invalid.
I believe the most sensible solution (from the player's perspective) to this problem is to make it so you cannot flip blueprints that contain inserters without an x offset of 0 in either of the pickup or insert positions, instead of just allowing the flip to happen. For example, if someone made a mod to make all inserters right 90 degree inserters, you could easily bypass that restriction with a simple flip and make a left 90 degree inserter, thus removing the hypothetical challenge completely. If someone wanted to allow the right to left flip, then they would be able to enable the custom vector property and the flip restriction would no longer apply.
I've attached the mod I made, as well as a video demonstrating the crash.
I've finally figured out a way to reproduce it, considering the mod I made was very simple.
I've set the inserter pickup and insert positions to have the same x offset as their y offset, so they become 45 degree inserters instead of straight on.
You can rotate them fine, and do everything you can with a normal inserter, but if you decide to flip inserters horizontally (relative to the inserter) then it flips the positions of insert and pickup, while keeping the same orientation of the entity. Since I did not set the allow_custom_vectors property to true, when you go to save the game the positions are invalid.
I believe the most sensible solution (from the player's perspective) to this problem is to make it so you cannot flip blueprints that contain inserters without an x offset of 0 in either of the pickup or insert positions, instead of just allowing the flip to happen. For example, if someone made a mod to make all inserters right 90 degree inserters, you could easily bypass that restriction with a simple flip and make a left 90 degree inserter, thus removing the hypothetical challenge completely. If someone wanted to allow the right to left flip, then they would be able to enable the custom vector property and the flip restriction would no longer apply.
I've attached the mod I made, as well as a video demonstrating the crash.