NML:Railtypetable-Roadtypetable-Tramtypetable

From GRFSpecs
Revision as of 19:35, 27 February 2020 by Frosch (talk | contribs) (ELRD and RAIL do not exist)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Block Syntax

Note: The syntax for roadtypetable and tramtypetable are identical to that of railtypetable as described below

railtypetable {
	ITEM [, ITEM]*
}

Each ITEM can be either a 4-byte long Identifier or string or it can have this format:


ID : [ ID[, ID]* ]

The first ID is the name (doesn't have to be 4-bytes long), the other IDs are a list of labels that are assigned to the given name if they are available.

 railtypetable {
 	RAIL,
 	ELRL,
 	"3RDR",
 	RT_SHINY_RAIL: [SHNY, RAIL]
 }

The label 3RDR is written as a string because an identifier can't start with a numeric value. To reference it later you can write railtype("3RDR"). If another grf defines a railtype with label SHNY then RT_SHINY_RAIL will refer to that track type. If the railtype SHNY is not available then trains using RT_SHINY_RAIL as track type will fallback to RAIL.

  • The default railtype labels are "RAIL", "ELRL", "MONO", "MGLV". See the List of railtype labels in the NewGRF Specs for currently defined custom labels.
  • By default there is only one roadtype "ROAD" defined.
  • By default there is only one tramtype "ELRL" defined. By convention tramtypes shall reuse railtype labels for similar types.

Note that labels are not shared between features, so the same label can be used for multiple items. For example, the label "RAIL" can be used for a railtype, roadtype, tramtype, and cargotype simultaneously without conflict.