FS#4582 - Railtypes: define compatible tracktypes for a train

Attached to Project: OpenTTD
Opened by Jake (EmperorJake) - Friday, 08 April 2011, 07:12 GMT
Last edited by andythenorth (andythenorth) - Friday, 01 September 2017, 08:27 GMT
Type Feature Request
Category NewGRF
Status New
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version Version?
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 5
Private No


I would like the ability to define in a GRF, which tracktypes a locomotive is compatible with. Currently it is only possible to define tracktypes themselves as being compatible with each other or not, so there is no way to code a locomotive to be able to travel on a normally incompatibe tracktype, and also no way to disallow it on a normally compatible tracktype.
This would enable the creation of a GRF containing different, incompatible voltage systems that includes multi system locomotives that can use all voltages. It could also be used for a tracktype set in which tracks are priced based on their weight limit, and trains that are too heavy would not be allowed on a cheap tracktype.
It could also be used for a gauge change train that can switch between standard and narrow gauge on the fly. Or perhaps even a futuristic maglev-rail combination. Or disallowing freight trains on high speed tracks. The list goes on...

I think the best way to implement this would be to add an extra callback that decides which tracktypes are compatible with the locomotive and which aren't, regardless of whether the tracktypes themselves are compatible with each other.

Some more info at this thread:

This task depends upon

Comment by Daniel Plaumann (dandan) - Sunday, 18 March 2012, 14:16 GMT
I was just going to file the exact same feature request, following some discussions with Snail, the developer of the French Set.

Instead of a callback, such a property could also be provided as a bitmask referring to the first 32 (or 16) entries of the rail type translation table, just as for cargos.
Comment by andythenorth (andythenorth) - Saturday, 05 August 2017, 19:40 GMT
Recurred as an issue in the NotRoadTypes fork also. Sometimes specific vehicles want to be cross-compatible, rather than all vehicles for a given track-type.
Comment by andythenorth (andythenorth) - Thursday, 31 August 2017, 21:11 GMT
Different, but related: FS#5006