Page 1 of 1

[1.1.94] Custom rail map colour doesn't work

Posted: Sat Nov 11, 2023 1:12 pm
by Stringweasel
What
The custom map colour for a rail (straight or curved) is ignored.
Expected behaviour
That the map colour of a rail will change if I set the map_colour in the prototype
Reproduction steps
Place this in data.lua

Code: Select all

local red = {1, 0, 0, 1}

data.raw["straight-rail"]["straight-rail"].map_color = red
data.raw["straight-rail"]["straight-rail"].friendly_map_color = red

data.raw["transport-belt"]["transport-belt"].map_color = red
You will clearly see the map colour working for the transport belt on the left, but the rail is still gray.

Image
Motivation
The waterways (rails in disguise) in the popular mod Cargo Ships look ugly.

Image

Re: [1.1.94] Custom rail map colour doesn't work

Posted: Sat Nov 11, 2023 1:47 pm
by boskid
Quick investigation: rails on chart are using utility_constant's rail_color.

Re: [1.1.94] Custom rail map colour doesn't work

Posted: Sat Nov 11, 2023 6:25 pm
by Stringweasel
Ah yes, that does work. But unfortunately that of course changes all rail colours regardless of prototype.

Guess this is more of a Modding Request then to allow the rail prototype to specify the map colour :)

Re: [1.1.94] Custom rail map colour doesn't work

Posted: Mon Jan 22, 2024 9:40 am
by boskid
Thanks for the report. In 2.0 it will be possible to change rail's charting color by setting map_color.