[1.1.94] Custom rail map colour doesn't work

This subforum contains all the issues which we already resolved.
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 412
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

[1.1.94] Custom rail map colour doesn't work

Post 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
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Official Contributor to Space Exploration
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3016
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post by boskid »

Quick investigation: rails on chart are using utility_constant's rail_color.
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 412
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

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

Post 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 :)
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Official Contributor to Space Exploration
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3016
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post by boskid »

Thanks for the report. In 2.0 it will be possible to change rail's charting color by setting map_color.
Post Reply

Return to “Resolved Problems and Bugs”