Schall Overseas Railway


A tiny mod allowing rails (with rail signals) to be placed over water tiles. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro)

Tweaks
a month ago
0.16 - 2.0
7.64K
Trains

b [Responded] Rail signal colliders (No better solution)

4 years ago

Rail signals are being allowed to place in more locations than they should, including under inserters and train stops.

The 1.1 collision mask layer expansion and utility system complicated things while providing more flexibility: "The base game provides common collision mask functions in a Lua file in the core lualib: collision-mask-util.lua. "

https://wiki.factorio.com/Types/CollisionMask -> https://github.com/wube/factorio-data/blob/master/core/lualib/collision-mask-util.lua

4 years ago

Thanks for the links.
I have just tested on game 1.1.6, however, seems the collision mask layers of the concerned entities do not have any changes.
The current sets of layers are still the minimal changes from their vanilla ones, in allowing them being placeable on water tiles.
You can play around my cfg/config-1.lua file and try it yourself.

If you have any solutions, please tell me. I have no idea on how to accomplish this.
Specifically, I do not want to touch any irrelevant entities. It may attract many unintended bugs.

3 years ago
(updated 3 years ago)

This seems to work to prevent placement on entities without preventing it from being placed on water:

railsignal = { "object-layer", "floor-layer" }

I have not gone back to 1.0 to check if it was making rail signals overlap with normal entities then too. With 1.1 there are more, separated masks, so perhaps there is a more minimal set of changes to make it work now?

Edit: Nevermind..still overlapping some entities...

It may be necessary to use the collision mask API rather than setting them to specific layers at all times / situations (startup conditions).

3 years ago

I've just done some more testing and discovered that this mod allows regular rail to be placed in space in the Space Exploration mod, which has special rail intended for that purpose.

Thankfully having too few collisions is not strictly a problem, but it does show that the set of changes is far from minimal even now.

3 years ago

You may be interested in the Prototype Explorer for testing purposes. Are the masks being assigned as intended? Example from testing: https://i.imgur.com/z7nGGrb.png

New response