NML:Railtypetable-Roadtypetable-Tramtypetable

From GRFSpecs
Revision as of 19:02, 19 February 2020 by Andythenorth (talk | contribs) (Format list of railtype/roadtype/tramtype default labels)
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.
  • The default roadtype labels are "ROAD" and "ELRD"
  • default tramtype labels are "RAIL" and "ELRL"

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.