Difference between revisions of "Action0/Roadtypes"

From GRFSpecs
Jump to navigationJump to search
Line 216: Line 216:
 
== Speed limit (14) ==
 
== Speed limit (14) ==
   
Speed limit in mph*1.6 (approx. km/h). Set to "0" for no limit at all.
+
Speed limit in mph*3.2 (approx. km/h*2). Set to "0" for no limit at all.
   
 
== Map colour (16) ==
 
== Map colour (16) ==

Revision as of 18:09, 19 May 2020

Action 0 properties for road types

Action 0 - Properties for road types

Defining properties of road types.

Up to 63 roadtypes can be defined.

Properties

Number Version Size Description
08 Supported by OpenTTD 1.101.10 Not supported by TTDPatch 4*B Road type label
09 Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: Build road toolbar caption
0A Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: Road construction dropdown text
0B Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: Build vehicle window caption
0C Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: Autoreplace text
0D Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: New engine text
0F Supported by OpenTTD 1.101.10 Not supported by TTDPatch B n*D Powered road type list[1]
10 Supported by OpenTTD 1.101.10 Not supported by TTDPatch B Road type flags
13 Supported by OpenTTD 1.101.10 Not supported by TTDPatch W Construction costs
14 Supported by OpenTTD 1.101.10 Not supported by TTDPatch W Speed limit
16 Supported by OpenTTD 1.101.10 Not supported by TTDPatch B Minimap colour
17 Supported by OpenTTD 1.101.10 Not supported by TTDPatch D Introduction date
18 Supported by OpenTTD 1.101.10 Not supported by TTDPatch B n*D Introduction required road type list[1]
19 Supported by OpenTTD 1.101.10 Not supported by TTDPatch B n*D Introduced road type list[1]
1A Supported by OpenTTD 1.101.10 Not supported by TTDPatch B Sort order
1B Supported by OpenTTD 1.101.10 Not supported by TTDPatch W StringID: Road type name
1C Supported by OpenTTD 1.101.10 Not supported by TTDPatch W Infrastructure maintenance cost factor
1D Supported by OpenTTD 1.101.10 Not supported by TTDPatch B n*D Alternate road type labels that shall be "redirected" to this road type
  1. 1.0 1.1 1.2 Road type labels in this list are not resolved using the alternate label list.

In NFO, road type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing road type, specify its label in property 08. To create a new road 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 road type.

When a new road type is created, it is populated with the information from the first road type, except that the powered list contains only the road type being created. However, no default values should be assumed, as the first road type may have been modified.

Vehicle and Roadtype availability

Vehicle and roadtype availability and compatibility is influenced by multiple properties. Generally, the vehicle defines which roadtype it is, and the roadtypes define the compatibility between each other.

  • A vehicle exists, if its roadtype (road vehicle prop 05) is defined. Otherwise the vehicle is disabled.
  • When a vehicle is introduced, it always introduces its roadtype (road vehicle prop 05).
  • A roadtype is introduced, if at least one of the following conditions is met:
    • A vehicle is introduced, that references the roadtype (road vehicle prop 05).
    • Another roadtype is introduced, that references the roadtype via the introduced roadtype list (roadtype prop 19).
    • The introduction date (roadtype prop 17) is passed and all required roadtypes (roadtype prop 18) are available.

Via roadtype property 1D multiple roadtypes can be defined, which shall be considered equivalent to a roadtype. This affects the interpretation of road vehicle property 05. If road vehicle property 05 references an undefined roadtype, then roadtype property 1D is checked for all defined roadtypes, whether the vehicle can be reassigned to some other roadtype. Otherwise the vehicle is disabled.

Road type label (08)

These are globally unique four-letter identifiers for specific road types (analoguous to cargo labels), used to make various road types accessible from road vehicle grfs. Reserved labels for default road types are:

Label Road Type
ROAD Normal Road
ELRD Electrified Road

Road type sets may use up to 63 roadtypes and have to specify their own labels.

See also Road Type Translation Table for further info.

Build road toolbar caption (09)

String ID of the name of the road type as shown in the toolbar caption.

Road construction dropdown text (0A)

String ID for text in the dropdown of all road types.

This string must never start with a colour control code.

Build vehicle window caption (0B)

String ID for build vehicle window caption.

Autoreplace text (0C)

String ID for road type shown in autoreplace window.

New engines (0D)

StringID to use for showing texts of the type "We have invented a new <road type> engine".

Powered road type list (0F)

List of road types on which road vehicles of this road type are powered. E.g. vehicles of "normal road"-type are powered on "electrified road"- and "haul-road"-type as well. Note that there is no "compatible road type list" since there is no difference between "powered" and "compatible" for roadtypes

The format is:

0E <nvar> (<road type label>){n}

That is you give the number of compatible road types in a single byte followed by a list of that length of road type labels. A road type is automatically powered with itself, so you don't need to list the current road type.

Note that these properties apply to road vehicles of this road type, not the road itself. If you want road vehicles of other road types to be able to run on your road types, you must set the powered road types property for each road type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other road type, you cannot remove poweredness once it is set (by some other grf).

Road type flags (10)

Flags to define properties related to the road type:

Bit Value Meaning
0 1 Draw catenary for this road type
1 2 Disallow level crossings for this road type
2 4 Disallow construction of houses along roadtype
3 8 Hide this road type from construction menu
4 16 Enables road type to be built by towns, picked by highest speed limit (defaults to ROAD label if no speed limits?)

Speed limit (14)

Speed limit in mph*3.2 (approx. km/h*2). Set to "0" for no limit at all.

Map colour (16)

This property defines the colour this road 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 road type. With this property set the road type will be introduced at (or after) this date when all of the introduction required road types are available to the company of the player, or whenever a vehicle using this road type gets introduced whichever is first.

Introduction required road type list (18)

List of road types on that need to be available to the company of the player for this road type to be introduced at (or after) the introduction date. This limit does not apply when the road type is introduced by the introduction of a vehicle.

Same format as for property 0F above.

This can, for example, be used to introduce a road type with streetlights when both paved road and electrified road types are available.

Introduced road type list (19)

List of road types that get introduced when this road type is introduced. For example, to make sure that when a fast road type is introduced the slow variant exists.

Same format as for property 0F above.

Sort order (1A)

Property for influencing the sort order of the drop down lists with road types. Default values are as follows:

Value Meaning
07 Normal Road
17 Electrified Road
n7 Roadtype #n

Thus the road 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.

Road type name (1B)

String ID of the name of the road type.

Alternate road type labels (1D)

A list of alternate labels that get "redirected" to this road type when used e.g. as road type of road vehicle or when testing if a label is defined. The redirection only happens if the alternate label isn't defined as a real road type. Same format as for property 0F above.

Alternate labels are not considered when evaluating properties 0F, 18, and 19.

Example

To be written