Difference between revisions of "Action0/Railtypes"
m (13 revisions) |
Andythenorth (talk | contribs) |
||
(25 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
'''''Action 0 properties for rail types''''' |
'''''Action 0 properties for rail types''''' |
||
− | =Action 0 - Properties for rail types= |
+ | = Action 0 - Properties for rail types = |
Defining properties of rail types. |
Defining properties of rail types. |
||
+ | {{ottdp|1.0|no|ottdrev=r18969}} 16 railtypes can be defined. |
||
− | Note: This feature is only available in OpenTTD > r18969 |
||
− | |||
− | {maketoc} |
||
− | |||
− | -=Properties=- |
||
− | |||
− | ||Number|Version|Size|Description |
||
− | |||
− | 08| |4*B|Rail type label |
||
− | |||
− | 09| |W|StringID: Build rail toolbar caption |
||
− | |||
− | 0A| |W|StringID: Rail construction dropdown text |
||
− | |||
− | 0B| |W|StringID: Build vehicle window caption |
||
− | |||
− | 0C| |W|StringID: Autoreplace text |
||
− | |||
− | 0D| |W|StringID: New engine text |
||
− | |||
− | 0E| |B n*D |Compatible rail type list |
||
− | |||
− | 0F| |B n*D |Powered rail type list |
||
− | |||
− | 10| |B|Rail type flags |
||
− | |||
− | 11| |B|Curve speed advantage multiplier |
||
− | |||
− | 12| |B|Station (and depot) graphics |
||
− | |||
− | 13| |W (a)|Construction costs |
||
− | |||
− | 14| |W|Speed limit |
||
− | |||
− | 15| |B|Acceleration model |
||
− | |||
− | 16|r19307|B|Minimap colour |
||
− | |||
− | 17|r21842|D|Introduction date |
||
+ | {{ottdp|1.9|no|ottdrev=bf8d7df7}} 64 railtypes can be defined. |
||
− | 18|r21842|B n*D |Introduction required rail type list |
||
+ | == Properties == |
||
− | 19|r21841|B n*D |Introduced rail type list |
||
+ | {| class="wikitable" |
||
− | 1A|r21866|B|Sort order|| |
||
+ | |- |
||
+ | !'''Number''' |
||
+ | !'''Version''' |
||
+ | !'''Size''' |
||
+ | !'''Description''' |
||
+ | |- |
||
+ | |08 |
||
+ | |{{ottdp|1.0}} |
||
+ | |4*B |
||
+ | |Rail type label |
||
+ | |- |
||
+ | |09 |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |StringID: Build rail toolbar caption<ref>{{grfTill|7}} For GRF version 7 or earlier, setting property 09 sets property 1B as well.</ref> |
||
+ | |- |
||
+ | |0A |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |StringID: Rail construction dropdown text |
||
+ | |- |
||
+ | |0B |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |StringID: Build vehicle window caption |
||
+ | |- |
||
+ | |0C |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |StringID: Autoreplace text |
||
+ | |- |
||
+ | |0D |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |StringID: New engine text |
||
+ | |- |
||
+ | |0E |
||
+ | |{{ottdp|1.0}} |
||
+ | |B n*D |
||
+ | |Compatible rail type list<ref name="alt_label">Rail type labels in this list are ''not'' resolved using the alternate label list.</ref> |
||
+ | |- |
||
+ | |0F |
||
+ | |{{ottdp|1.0}} |
||
+ | |B n*D |
||
+ | |Powered rail type list<ref name="alt_label" /> |
||
+ | |- |
||
+ | |10 |
||
+ | |{{ottdp|1.0}} |
||
+ | |B |
||
+ | |Rail type flags |
||
+ | |- |
||
+ | |11 |
||
+ | |{{ottdp|1.0}} |
||
+ | |B |
||
+ | |Curve speed advantage multiplier |
||
+ | |- |
||
+ | |12 |
||
+ | |{{ottdp|1.0}} |
||
+ | |B |
||
+ | |Station (and depot) graphics |
||
+ | |- |
||
+ | |13 |
||
+ | |{{ottdp|1.0}} |
||
+ | |W <ref>In r18969 to 19306 this property was byte-sized.</ref> |
||
+ | |Construction costs |
||
+ | |- |
||
+ | |14 |
||
+ | |{{ottdp|1.0}} |
||
+ | |W |
||
+ | |Speed limit |
||
+ | |- |
||
+ | |15 |
||
+ | |{{ottdp|1.0}} |
||
+ | |B |
||
+ | |Acceleration model |
||
+ | |- |
||
+ | |16 |
||
+ | |{{ottdp|1.0|no|ottdrev=r19307}} |
||
+ | |B |
||
+ | |Minimap colour |
||
+ | |- |
||
+ | |17 |
||
+ | |{{ottdp|1.1|no|ottdrev=r21842}} |
||
+ | |D |
||
+ | |Introduction date |
||
+ | |- |
||
+ | |18 |
||
+ | |{{ottdp|1.1|no|ottdrev=r21842}} |
||
+ | |B n*D |
||
+ | |Introduction required rail type list<ref name="alt_label" /> |
||
+ | |- |
||
+ | |19 |
||
+ | |{{ottdp|1.1|no|ottdrev=r21841}} |
||
+ | |B n*D |
||
+ | |Introduced rail type list<ref name="alt_label" /> |
||
+ | |- |
||
+ | |1A |
||
+ | |{{ottdp|1.1|no|ottdrev=r21866}} |
||
+ | |B |
||
+ | |Sort order |
||
+ | |- |
||
+ | |1B |
||
+ | |{{ottdp|1.2|no|ottdrev=r23129}} |
||
+ | |W |
||
+ | |StringID: Rail type name<ref>{{grfTill|7}} For GRF version 7 or earlier, set property 1B ''after'' setting property 09, as property 09 sets the rail type name as well for backwards compatibility.</ref> |
||
+ | |- |
||
+ | |1C |
||
+ | |{{ottdp|1.2|no|ottdrev=r23415}} |
||
+ | |W |
||
+ | |Infrastructure maintenance cost factor |
||
+ | |- |
||
+ | |1D |
||
+ | |{{ottdp|1.2|no|ottdrev=r23758}} |
||
+ | |B n*D |
||
+ | |Alternate rail type labels that shall be "redirected" to this rail type |
||
+ | |} |
||
+ | <references /> |
||
− | (a) In r18969 to 19306 this property was byte-sized. |
||
In NFO, rail type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing rail type, specify its label in property 08. To create a new rail type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label 'clashes' with another GRF, then one GRF will end up modifying the properties instead of creating a new rail type. |
In NFO, rail type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing rail type, specify its label in property 08. To create a new rail type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label 'clashes' with another GRF, then one GRF will end up modifying the properties instead of creating a new rail type. |
||
Line 58: | Line 135: | ||
When a new rail type is created, it is populated with the information from the first rail type, except that the compatible and powered list contain only the rail type being created. However, no default values should be assumed, as the first rail type may have been modified. |
When a new rail type is created, it is populated with the information from the first rail type, except that the compatible and powered list contain only the rail type being created. However, no default values should be assumed, as the first rail type may have been modified. |
||
+ | == Vehicle and Railtype availability == |
||
− | -=Comments=- |
||
+ | Vehicle and railtype availability and compatibility is influenced by multiple properties. |
||
− | ==Rail type label (08)== |
||
+ | Generally, the vehicle defines which railtype it is, and the railtypes define the compatibility between each other. |
||
+ | * A vehicle exists, if its railtype (train prop 05) is defined. Otherwise the vehicle is disabled. |
||
+ | * When a vehicle is introduced, it always introduces its railtype (train prop 05). |
||
+ | * A railtype is introduced, if at least one of the following conditions is met: |
||
+ | ** A vehicle is introduced, that references the railtype (train prop 05). |
||
+ | ** Another railtype is introduced, that references the railtype via the introduced railtype list (railtype prop 19). |
||
+ | ** The introduction date (railtype prop 17) is passed and all required railtypes (railtype prop 18) are available. |
||
+ | Via railtype property 1D multiple railtypes can be defined, which shall be considered equivalent to a railtype. |
||
− | These are globally unique four-letter identifiers for specific rail types (analoguous to [[Action0Cargos#Cargo_label_17_|cargo labels]]), used to make various rail types accessible from train vehicle grfs. Reserved labels for default rail types are: |
||
+ | This affects the interpretation of train property 05. If train property 05 references an undefined railtype, then |
||
+ | railtype property 1D is checked for all defined railtypes, whether the vehicle can be reassigned to some other railtype. |
||
+ | Otherwise the vehicle is disabled. |
||
+ | == Rail type label (08) == |
||
− | ||Label|rail type |
||
+ | These are globally unique four-letter identifiers for specific rail types (analoguous to [[Action0Cargos#Cargo label 17|cargo labels]]), used to make various rail types accessible from train vehicle grfs. Reserved labels for default rail types are: |
||
− | RAIL | Normal rail |
||
+ | {| class="wikitable |
||
− | ELRL | electrified rail |
||
+ | |- |
||
+ | !'''Label''' |
||
+ | !'''Rail Type''' |
||
+ | |- |
||
+ | |RAIL |
||
+ | | Normal Rail |
||
+ | |- |
||
+ | |ELRL |
||
+ | | Electrified Rail |
||
+ | |- |
||
+ | |MONO |
||
+ | | Mono Rail |
||
+ | |- |
||
+ | |MGLV |
||
+ | | Maglev Rail |
||
+ | |} |
||
+ | {{ottdp|1.0|no|ottdrev=r18969}} 16 railtypes can be defined. |
||
− | MONO | mono rail |
||
+ | {{ottdp|1.9|no|ottdrev=bf8d7df7}} 64 railtypes can be defined. |
||
− | MGLV | maglev rail|| |
||
− | Rail type sets may use up to |
+ | Rail type sets may use up to 64 railtypes and have to specify their own [[RailtypeLabels|labels]]. |
− | See also [[ |
+ | See also [[Action0/Global Settings#Rail type translation table 12|Rail Type Translation Table]] for further info. |
− | ==Build rail toolbar caption (09)== |
+ | == Build rail toolbar caption (09) == |
String ID of the name of the rail type as shown in the toolbar caption. |
String ID of the name of the rail type as shown in the toolbar caption. |
||
+ | |||
+ | {{grfTill|7}} {{ottd|1.2|ottdrev=r23129}} For backwards compatibility, setting this property sets the rail type name (property 1B) to this string as well for GRF versions 7 or below. |
||
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white. |
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white. |
||
− | ==Rail construction dropdown text (0A)== |
+ | == Rail construction dropdown text (0A) == |
String ID for text in the dropdown of all rail types. |
String ID for text in the dropdown of all rail types. |
||
Line 90: | Line 195: | ||
This string must never start with a colour control code. |
This string must never start with a colour control code. |
||
− | ==Build vehicle window caption (0B)== |
+ | == Build vehicle window caption (0B) == |
String ID for build vehicle window caption. |
String ID for build vehicle window caption. |
||
Line 96: | Line 201: | ||
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white. |
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white. |
||
− | ==Autoreplace text (0C)== |
+ | == Autoreplace text (0C) == |
String ID for rail type shown in autoreplace window. |
String ID for rail type shown in autoreplace window. |
||
− | ==New engines (0D)== |
+ | == New engines (0D) == |
− | StringID to use for showing texts of the type |
+ | StringID to use for showing texts of the type "We have invented a new <rail type> engine". |
− | ==Compatible rail type list (0E)== |
+ | == Compatible rail type list (0E) == |
− | List of rail types on which trains of this rail type can run, even though they might not be powered. E.g. wagons/engines of |
+ | List of rail types on which trains of this rail type can run, even though they might not be powered. E.g. wagons/engines of "eletrified rail"-type are also compatible to "normal rail" and "third rail" type, but they are not powered (there need to be an other powered engine in the consist to move the train). |
The format is: |
The format is: |
||
− | <pre> |
+ | <pre>0E <nvar> (<rail type label>){n}</pre> |
That is you give the number of compatible rail types in a single byte followed by a list of that length of rail type labels. A rail type is automatically compatible (and powered) with itself, so you don't need to list the current rail type. |
That is you give the number of compatible rail types in a single byte followed by a list of that length of rail type labels. A rail type is automatically compatible (and powered) with itself, so you don't need to list the current rail type. |
||
− | Note that these properties apply to trains of this rail type, not the track. If you want trains of other rail types to be able to run on your rail types, you must set the compatible rail types property for each rail type. Setting these properties behaves always incremental, so you only need to the set additional bits for each |
+ | Note that these properties apply to trains of this rail type, not the track. If you want trains of other rail types to be able to run on your rail types, you must set the compatible rail types property for each rail type. Setting these properties behaves always incremental, so you only need to the set additional bits for each |
+ | other rail type, you cannot remove compatibility/poweredness once it is set (by some other grf). |
||
+ | Note that when routing trains, the compatibility is only evaluated for the lead engine of a consist. This means that trains will run on incompatible rail types if they are in a consist where the lead engine is compatible with the rail type. This applies to both engines and wagons. |
||
− | ==Powered rail type list (0F)== |
||
+ | == Powered rail type list (0F) == |
||
− | List of rail types on which trains of this rail type are powered. E.g. engines of "normal rail"-type are powered on "electrified rail"- and "third-rail"-type as well. |
||
+ | |||
+ | List of rail types on which trains of this rail type are powered. E.g. engines of "normal rail"-type are powered on "electrified rail"- and "third-rail"-type as well. |
||
Same format as for property 0E above. |
Same format as for property 0E above. |
||
− | ==Rail type flags (10)== |
+ | == Rail type flags (10) == |
Flags to define properties related to the rail type: |
Flags to define properties related to the rail type: |
||
+ | {| class="wikitable" |
||
− | ||Bit|Value|Meaning |
||
+ | |- |
||
+ | !'''Bit''' |
||
+ | !'''Value''' |
||
+ | !'''Version''' |
||
+ | !'''Meaning''' |
||
+ | |- |
||
+ | |0 |
||
+ | |1 |
||
+ | ||{{ottdp|1.0}} |
||
+ | |Draw catenary for this rail type |
||
+ | |- |
||
+ | |1 |
||
+ | |2 |
||
+ | ||{{ottdp|1.1|no|ottdrev=r20049}} |
||
+ | |Disallow level crossings for this rail type |
||
+ | |- |
||
+ | |2 |
||
+ | |4 |
||
+ | ||{{ottdp|1.9|no|ottdrev=e3b440c9c5}} |
||
+ | |Hide this rail type from construction menu |
||
+ | |- |
||
+ | |3 |
||
+ | |8 |
||
+ | ||{{ottdp|1.10|no|ottdrev=g42046af933}} |
||
+ | |Enable use of precombined overlay sprites |
||
+ | |- |
||
+ | |4 |
||
+ | |16 |
||
+ | ||{{ottdp|1.10|no|ottdrev=gcc5f175615}} |
||
+ | |Always allow 90 degree turns |
||
+ | |- |
||
+ | |5 |
||
+ | |32 |
||
+ | ||{{ottdp|1.10|no|ottdrev=gcc5f175615}} |
||
+ | |Always prohibit 90 degree turns (takes precedence over bit 4) |
||
+ | |} |
||
+ | == Curve Speed advantage multiplier (11) == |
||
− | 0|1|Draw catenary for this rail |
||
− | |||
− | 1|2|Disallow level crossings for this rail (OpenTTD since r20049)|| |
||
− | |||
− | ==Curve Speed advantage multiplier (11)== |
||
This property sets the multiplier to the curve speed advantage which all trains running on this track type get. The base curve speed advantage is given by the multiplication of the value of this property with the base speed advantage - which depends on the curve length in wagons: |
This property sets the multiplier to the curve speed advantage which all trains running on this track type get. The base curve speed advantage is given by the multiplication of the value of this property with the base speed advantage - which depends on the curve length in wagons: |
||
+ | {| class="wikitable" |
||
− | ||curve length | base speed adv. |
||
+ | |- |
||
− | |||
+ | !'''Curve Length''' |
||
− | 0 (90° turn) |30 |
||
+ | !'''Base Speed Adv.''' |
||
− | |||
+ | |- |
||
− | 1 (2x45° turn) |44 |
||
+ | |0 (90° turn) |
||
− | |||
+ | |30 |
||
− | 2| 55 |
||
+ | |- |
||
− | |||
+ | |1 (2x45° turn) |
||
− | 3| 66 |
||
+ | |44 |
||
− | |||
+ | |- |
||
− | 4| 75 |
||
+ | |2 |
||
− | |||
− | + | | 55 |
|
+ | |- |
||
− | |||
+ | |3 |
||
− | 6| 91 |
||
+ | | 66 |
||
− | |||
+ | |- |
||
− | 7| 98 |
||
+ | |4 |
||
− | |||
− | + | | 75 |
|
+ | |- |
||
− | |||
+ | |5 |
||
− | 9| 108 |
||
+ | | 84 |
||
− | |||
+ | |- |
||
− | 10| 111 |
||
+ | |6 |
||
− | |||
− | + | | 91 |
|
+ | |- |
||
− | |||
+ | |7 |
||
− | 12+| 115|| |
||
+ | | 98 |
||
+ | |- |
||
+ | |8 |
||
+ | | 103 |
||
+ | |- |
||
+ | |9 |
||
+ | | 108 |
||
+ | |- |
||
+ | |10 |
||
+ | | 111 |
||
+ | |- |
||
+ | |11 |
||
+ | | 114 |
||
+ | |- |
||
+ | |12+ |
||
+ | | 115 |
||
+ | |} |
||
− | + | "Curve length" is the average number of wagons of the train between turns. However, very sharp turns (values 0 and 1) are not averaged out in longer trains. |
|
− | The maximum speed for a train in a curve is defined by |
+ | The maximum speed for a train in a curve is defined by "base speed advantage" * (2 + "property 11"). Tilting trains get an additional bonus of 20% to this value. |
For the default rail types this property is 0 for normal rail and electrified rail, 1 for monorail, and 2 for maglev. |
For the default rail types this property is 0 for normal rail and electrified rail, 1 for monorail, and 2 for maglev. |
||
− | ==Station (and depot) graphics (12)== |
+ | == Station (and depot) graphics (12) == |
This property defines the default graphics for the stations. If no depot sprites are defined, this also defines at the same time the depot sprites to be used. There are three kind of default stations (and depots), usually associated with rail, monorail and maglev tracks. Valid values are: |
This property defines the default graphics for the stations. If no depot sprites are defined, this also defines at the same time the depot sprites to be used. There are three kind of default stations (and depots), usually associated with rail, monorail and maglev tracks. Valid values are: |
||
+ | {| class="wikitable" |
||
− | ||Value|Meaning |
||
+ | |- |
||
+ | !'''Value''' |
||
+ | !'''Meaning''' |
||
+ | |- |
||
+ | |0 |
||
+ | |Normal Rail |
||
+ | |- |
||
+ | |1 |
||
+ | |Monorail |
||
+ | |- |
||
+ | |2 |
||
+ | |Maglev |
||
+ | |} |
||
+ | == Speed limit (14) == |
||
− | 0|normal rail |
||
+ | Speed limit in mph*1.6 (approx. km/h). Set to "0" for no limit at all. |
||
− | 1|monorail |
||
+ | == Acceleration model (15) == |
||
− | 2|maglev|| |
||
− | |||
− | ==Speed limit (14)== |
||
− | |||
− | Speed limit in mph*1.6 (approx. km/h). Set to "0" for no limit at all. |
||
− | |||
− | ==Acceleration model (15)== |
||
This property defines the acceleration model used. Valid values range from 0 to 2: |
This property defines the acceleration model used. Valid values range from 0 to 2: |
||
+ | {| class="wikitable" |
||
− | ||Value|Meaning |
||
+ | |- |
||
− | |||
+ | !'''Value''' |
||
− | 0|normal rail |
||
+ | !'''Meaning''' |
||
− | |||
+ | |- |
||
− | 1|monorail |
||
+ | |0 |
||
− | |||
+ | |Normal Rail |
||
− | 2|maglev|| |
||
+ | |- |
||
+ | |1 |
||
+ | |Monorail |
||
+ | |- |
||
+ | |2 |
||
+ | |Maglev |
||
+ | |} |
||
There is currently no difference between normal rail and monorail. |
There is currently no difference between normal rail and monorail. |
||
− | ==Map colour (16)== |
+ | == Map colour (16) == |
− | This property defines the colour this track type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates| |
+ | This property defines the colour this track type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates|DOS palette]]. |
− | ==Introduction date (17)== |
+ | == Introduction date (17) == |
This property defines the long date formatted introduction date of this rail type. With this property set the rail type will be introduced at (or after) this date when all of the introduction required rail types are available to the company of the player, or whenever a vehicle using this rail type gets introduced whichever is first. |
This property defines the long date formatted introduction date of this rail type. With this property set the rail type will be introduced at (or after) this date when all of the introduction required rail types are available to the company of the player, or whenever a vehicle using this rail type gets introduced whichever is first. |
||
− | ==Introduction required rail type list (18)== |
+ | == Introduction required rail type list (18) == |
List of rail types on that need to be available to the company of the player for this rail type to be introduced at (or after) the introduction date. This limit does not apply when the rail type is introduced by the introduction of a vehicle. |
List of rail types on that need to be available to the company of the player for this rail type to be introduced at (or after) the introduction date. This limit does not apply when the rail type is introduced by the introduction of a vehicle. |
||
Line 216: | Line 387: | ||
This can, for example, be used to introduce a third rail with catenary track type when both third rail and catenary rail types are available. |
This can, for example, be used to introduce a third rail with catenary track type when both third rail and catenary rail types are available. |
||
− | ==Introduced rail type list (19)== |
+ | == Introduced rail type list (19) == |
List of rail types that get introduced when this rail type is introduced. For example, to make sure that when a fast rail type is introduced the slow variant exists. |
List of rail types that get introduced when this rail type is introduced. For example, to make sure that when a fast rail type is introduced the slow variant exists. |
||
Line 222: | Line 393: | ||
Same format as for property 0E above. |
Same format as for property 0E above. |
||
− | ==Sort order (1A)== |
+ | == Sort order (1A) == |
Property for influencing the sort order of the drop down lists with rail types. Default values are as follows: |
Property for influencing the sort order of the drop down lists with rail types. Default values are as follows: |
||
+ | {| class="wikitable" |
||
− | ||Value|Meaning |
||
+ | |- |
||
+ | !'''Value''' |
||
+ | !'''Meaning''' |
||
+ | |- |
||
+ | |07 |
||
+ | |Normal Rail |
||
+ | |- |
||
+ | |17 |
||
+ | |Electrified Rail |
||
+ | |- |
||
+ | |27 |
||
+ | |Monorail |
||
+ | |- |
||
+ | |37 |
||
+ | |Maglev |
||
+ | |- |
||
+ | |n7 |
||
+ | |Railtype #n |
||
+ | |} |
||
+ | Thus the rail type that (internally) gets index 8 will get a default value of 87. These defaults are to keep the ordering when this property is not supported as they were. |
||
− | 07|normal rail |
||
+ | == Rail type name (1B) == |
||
− | 17|electrified rail |
||
+ | String ID of the name of the rail type. |
||
− | 27|monorail |
||
+ | {{grfTill|7}} For GRF versions 7 or earlier, set property 1B ''after'' setting property 09, as property 09 sets the rail type name as well for backwards compatibility. |
||
− | 37|maglev |
||
+ | == Alternate rail type labels (1D) == |
||
− | n7|railtype #n|| |
||
+ | A list of alternate labels that get "redirected" to this rail type when used e.g. as track type of train or when testing if a label is defined. The redirection only happens if the alternate label isn't defined as a real rail type. Same format as for property 0E above. |
||
− | Thus the rail type that (internally) gets index 8 will get a default value of 87. These defaults are to keep the ordering when this property is not supported as they were. |
||
+ | |||
+ | Alternate labels are not considered when evaluating properties 0E, 0F, 18, and 19. |
||
+ | |||
+ | = Example = |
||
+ | |||
+ | To be written |
Latest revision as of 15:21, 9 December 2023
Action 0 properties for rail types
Action 0 - Properties for rail types
Defining properties of rail types.
1.0 16 railtypes can be defined.
1.9 64 railtypes can be defined.
Properties
Number | Version | Size | Description |
---|---|---|---|
08 | 1.0 | 4*B | Rail type label |
09 | 1.0 | W | StringID: Build rail toolbar caption[1] |
0A | 1.0 | W | StringID: Rail construction dropdown text |
0B | 1.0 | W | StringID: Build vehicle window caption |
0C | 1.0 | W | StringID: Autoreplace text |
0D | 1.0 | W | StringID: New engine text |
0E | 1.0 | B n*D | Compatible rail type list[2] |
0F | 1.0 | B n*D | Powered rail type list[2] |
10 | 1.0 | B | Rail type flags |
11 | 1.0 | B | Curve speed advantage multiplier |
12 | 1.0 | B | Station (and depot) graphics |
13 | 1.0 | W [3] | Construction costs |
14 | 1.0 | W | Speed limit |
15 | 1.0 | B | Acceleration model |
16 | 1.0 | B | Minimap colour |
17 | 1.1 | D | Introduction date |
18 | 1.1 | B n*D | Introduction required rail type list[2] |
19 | 1.1 | B n*D | Introduced rail type list[2] |
1A | 1.1 | B | Sort order |
1B | 1.2 | W | StringID: Rail type name[4] |
1C | 1.2 | W | Infrastructure maintenance cost factor |
1D | 1.2 | B n*D | Alternate rail type labels that shall be "redirected" to this rail type |
- ↑ GRFv≤7 For GRF version 7 or earlier, setting property 09 sets property 1B as well.
- ↑ 2.0 2.1 2.2 2.3 Rail type labels in this list are not resolved using the alternate label list.
- ↑ In r18969 to 19306 this property was byte-sized.
- ↑ GRFv≤7 For GRF version 7 or earlier, set property 1B after setting property 09, as property 09 sets the rail type name as well for backwards compatibility.
In NFO, rail type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing rail type, specify its label in property 08. To create a new rail type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label 'clashes' with another GRF, then one GRF will end up modifying the properties instead of creating a new rail type.
When a new rail type is created, it is populated with the information from the first rail type, except that the compatible and powered list contain only the rail type being created. However, no default values should be assumed, as the first rail type may have been modified.
Vehicle and Railtype availability
Vehicle and railtype availability and compatibility is influenced by multiple properties. Generally, the vehicle defines which railtype it is, and the railtypes define the compatibility between each other.
- A vehicle exists, if its railtype (train prop 05) is defined. Otherwise the vehicle is disabled.
- When a vehicle is introduced, it always introduces its railtype (train prop 05).
- A railtype is introduced, if at least one of the following conditions is met:
- A vehicle is introduced, that references the railtype (train prop 05).
- Another railtype is introduced, that references the railtype via the introduced railtype list (railtype prop 19).
- The introduction date (railtype prop 17) is passed and all required railtypes (railtype prop 18) are available.
Via railtype property 1D multiple railtypes can be defined, which shall be considered equivalent to a railtype. This affects the interpretation of train property 05. If train property 05 references an undefined railtype, then railtype property 1D is checked for all defined railtypes, whether the vehicle can be reassigned to some other railtype. Otherwise the vehicle is disabled.
Rail type label (08)
These are globally unique four-letter identifiers for specific rail types (analoguous to cargo labels), used to make various rail types accessible from train vehicle grfs. Reserved labels for default rail types are:
Label | Rail Type |
---|---|
RAIL | Normal Rail |
ELRL | Electrified Rail |
MONO | Mono Rail |
MGLV | Maglev Rail |
1.0 16 railtypes can be defined.
1.9 64 railtypes can be defined.
Rail type sets may use up to 64 railtypes and have to specify their own labels.
See also Rail Type Translation Table for further info.
String ID of the name of the rail type as shown in the toolbar caption.
GRFv≤7 1.2 For backwards compatibility, setting this property sets the rail type name (property 1B) to this string as well for GRF versions 7 or below.
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white.
Rail construction dropdown text (0A)
String ID for text in the dropdown of all rail types.
This string must never start with a colour control code.
String ID for build vehicle window caption.
OpenTTD before r20342 and 1.0.3 require the string to start with the white control code. Later versions of OpenTTD will automatically default to white.
Autoreplace text (0C)
String ID for rail type shown in autoreplace window.
New engines (0D)
StringID to use for showing texts of the type "We have invented a new <rail type> engine".
Compatible rail type list (0E)
List of rail types on which trains of this rail type can run, even though they might not be powered. E.g. wagons/engines of "eletrified rail"-type are also compatible to "normal rail" and "third rail" type, but they are not powered (there need to be an other powered engine in the consist to move the train).
The format is:
0E <nvar> (<rail type label>){n}
That is you give the number of compatible rail types in a single byte followed by a list of that length of rail type labels. A rail type is automatically compatible (and powered) with itself, so you don't need to list the current rail type.
Note that these properties apply to trains of this rail type, not the track. If you want trains of other rail types to be able to run on your rail types, you must set the compatible rail types property for each rail type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other rail type, you cannot remove compatibility/poweredness once it is set (by some other grf).
Note that when routing trains, the compatibility is only evaluated for the lead engine of a consist. This means that trains will run on incompatible rail types if they are in a consist where the lead engine is compatible with the rail type. This applies to both engines and wagons.
Powered rail type list (0F)
List of rail types on which trains of this rail type are powered. E.g. engines of "normal rail"-type are powered on "electrified rail"- and "third-rail"-type as well.
Same format as for property 0E above.
Rail type flags (10)
Flags to define properties related to the rail type:
Curve Speed advantage multiplier (11)
This property sets the multiplier to the curve speed advantage which all trains running on this track type get. The base curve speed advantage is given by the multiplication of the value of this property with the base speed advantage - which depends on the curve length in wagons:
Curve Length | Base Speed Adv. |
---|---|
0 (90° turn) | 30 |
1 (2x45° turn) | 44 |
2 | 55 |
3 | 66 |
4 | 75 |
5 | 84 |
6 | 91 |
7 | 98 |
8 | 103 |
9 | 108 |
10 | 111 |
11 | 114 |
12+ | 115 |
"Curve length" is the average number of wagons of the train between turns. However, very sharp turns (values 0 and 1) are not averaged out in longer trains.
The maximum speed for a train in a curve is defined by "base speed advantage" * (2 + "property 11"). Tilting trains get an additional bonus of 20% to this value.
For the default rail types this property is 0 for normal rail and electrified rail, 1 for monorail, and 2 for maglev.
Station (and depot) graphics (12)
This property defines the default graphics for the stations. If no depot sprites are defined, this also defines at the same time the depot sprites to be used. There are three kind of default stations (and depots), usually associated with rail, monorail and maglev tracks. Valid values are:
Value | Meaning |
---|---|
0 | Normal Rail |
1 | Monorail |
2 | Maglev |
Speed limit (14)
Speed limit in mph*1.6 (approx. km/h). Set to "0" for no limit at all.
Acceleration model (15)
This property defines the acceleration model used. Valid values range from 0 to 2:
Value | Meaning |
---|---|
0 | Normal Rail |
1 | Monorail |
2 | Maglev |
There is currently no difference between normal rail and monorail.
Map colour (16)
This property defines the colour this track type is drawn in the minimap view. The byte value specifies the colour entry in the DOS palette.
Introduction date (17)
This property defines the long date formatted introduction date of this rail type. With this property set the rail type will be introduced at (or after) this date when all of the introduction required rail types are available to the company of the player, or whenever a vehicle using this rail type gets introduced whichever is first.
Introduction required rail type list (18)
List of rail types on that need to be available to the company of the player for this rail type to be introduced at (or after) the introduction date. This limit does not apply when the rail type is introduced by the introduction of a vehicle.
Same format as for property 0E above.
This can, for example, be used to introduce a third rail with catenary track type when both third rail and catenary rail types are available.
Introduced rail type list (19)
List of rail types that get introduced when this rail type is introduced. For example, to make sure that when a fast rail type is introduced the slow variant exists.
Same format as for property 0E above.
Sort order (1A)
Property for influencing the sort order of the drop down lists with rail types. Default values are as follows:
Value | Meaning |
---|---|
07 | Normal Rail |
17 | Electrified Rail |
27 | Monorail |
37 | Maglev |
n7 | Railtype #n |
Thus the rail type that (internally) gets index 8 will get a default value of 87. These defaults are to keep the ordering when this property is not supported as they were.
Rail type name (1B)
String ID of the name of the rail type.
GRFv≤7 For GRF versions 7 or earlier, set property 1B after setting property 09, as property 09 sets the rail type name as well for backwards compatibility.
Alternate rail type labels (1D)
A list of alternate labels that get "redirected" to this rail type when used e.g. as track type of train or when testing if a label is defined. The redirection only happens if the alternate label isn't defined as a real rail type. Same format as for property 0E above.
Alternate labels are not considered when evaluating properties 0E, 0F, 18, and 19.
Example
To be written