Beautiful Bridge Railway

by kapaer

Add some beautiful bridge-rails (wood, iron, stone-brick) that can be placed on water, and change default Big-electric-pole and rail-signals to be placeable on water.

Content
3 years ago
0.15 - 1.1
50.9K
Trains

g Incompatible with Renai Transportation (have a fix)

3 years ago
(updated 3 years ago)

Hello. This looks like a great mod. I've only been doing testing in editor mode since I plan on doing a playthrough with plenty of water and islands, but so far it all looks great.
However, there is an incompatibility with Renai Transportation:
https://puu.sh/GRWnF/486fba5d72.png

Since your mod makes rail signals placable on water, modded rail signals don't match its collision masks, and ramps from Renai transportation are considered rail signals. It should be an easy fix in data-updates:

local signals = data.raw["rail-signal"]
local chainsignals = data.raw["rail-chain-signal"]
for key, value in pairs(signals) do
data.raw["rail-signal"][key].collision_mask = { "object-layer" }
end

for key, value in pairs(chainsignals) do
data.raw["rail-chain-signal"][key].collision_mask = { "object-layer" }
end

I just took the code you used for big electric poles and changed it so that all rail signals and chain signals will also be placeable on water so that mods that add in rail signal types won't have this error. (You can prob clean it up better. I'm not really a modder and don't have experience in it)
Also, with the above fix, you should be able to remove the code:

data.raw["rail-signal"]["rail-signal"].collision_mask = { "object-layer" }
data.raw["rail-chain-signal"]["rail-chain-signal"].collision_mask = { "object-layer" }

I tested it a bit and looks like it works properly.

3 years ago

The problem is that the default collision mask for rail signals in 1.1 has been changed. Renai properly respects this new mask, but BBR doesn't. Instead of BBR setting the mask to object-layer, it should instead be set to rail-layer.

eg

data.raw["rail-signal"]["rail-signal"].collision_mask = { 'rail-layer' }
data.raw["rail-chain-signal"]["rail-chain-signal"].collision_mask = { 'rail-layer' }

Though, yes, I'd recommend looping over all signals instead of just using the vanilla signals.

3 years ago

Ah I see. And here I thought I fully understood it with that fix lol.

New response