[0.17.74] Crash and bugs when removing some collision masks from rails
Posted: Sat Nov 02, 2019 12:56 pm
I am building a rail system where sometimes I want other entities to be able to be build on (parts of) rails. So I removed the collision masks
Problem is that you can now place rails on the exact same tiles in the same direction.
Saving and reloading crashes the game if there are overlapping rail tracks. It didn't crash when they were contained; ([]) = no crash. ([)] = crash
So I added an additional layer to the rails
Which fixed the above issue, except for ghosts
It still places ghost entities over already placed rails.
And it doesn't respect that (in this case) the furnace has different collision mask as the rail, although the player can place rails under the furnace. I can place ghost furnaces on the rails, not the other way around
I have had some cases where the save issue also happened in the last case with "layer-11", but can't seem to reproduce them right now. Might have been another error.
Also I think the "not-colliding-with-itself" mask doesn't change anything.
Use case?
Tiny trains
![Image](https://forums.factorio.com/images/ext/80e9ea75314ca988ede09504d21249a1.png)
Sucks to not be able to change the collision box and selection box of rails.
I kind of understand why for the collision box. Isn't it possible to separate the entity collision and selection box from the boxes that are used to check track collisions for signals and trains? Making the collision_box moddable.
I don't understand why the selection box can't be modified. They are also still defined in data.raw in base game for both straight and curved rails, although they are not used and changing them doesn't do anything.
Code: Select all
data.raw["straight-rail"]["straight-rail"].collision_mask = {"not-colliding-with-itself"}
data.raw["curved-rail"]["curved-rail"].collision_mask = {"not-colliding-with-itself"}
Saving and reloading crashes the game if there are overlapping rail tracks. It didn't crash when they were contained; ([]) = no crash. ([)] = crash
A train is also unable to drive from one contained track to another.56.412 Error RailSegment.cpp:158: Error when creating segment 15, found rail (straight-rail on {-25.0000000000, -9.0000000000}) already connected to segment 9
So I added an additional layer to the rails
Code: Select all
data.raw["straight-rail"]["straight-rail"].collision_mask = {"layer-11", "not-colliding-with-itself"}
data.raw["curved-rail"]["curved-rail"].collision_mask = {"layer-11", "not-colliding-with-itself"}
Which fixed the above issue, except for ghosts
It still places ghost entities over already placed rails.
And it doesn't respect that (in this case) the furnace has different collision mask as the rail, although the player can place rails under the furnace. I can place ghost furnaces on the rails, not the other way around
I have had some cases where the save issue also happened in the last case with "layer-11", but can't seem to reproduce them right now. Might have been another error.
Also I think the "not-colliding-with-itself" mask doesn't change anything.
Use case?
Tiny trains
![Image](https://forums.factorio.com/images/ext/80e9ea75314ca988ede09504d21249a1.png)
Sucks to not be able to change the collision box and selection box of rails.
I kind of understand why for the collision box. Isn't it possible to separate the entity collision and selection box from the boxes that are used to check track collisions for signals and trains? Making the collision_box moddable.
I don't understand why the selection box can't be modified. They are also still defined in data.raw in base game for both straight and curved rails, although they are not used and changing them doesn't do anything.