<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://newgrf-specs.tt-wiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Juzza1</id>
	<title>GRFSpecs - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://newgrf-specs.tt-wiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Juzza1"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Juzza1"/>
	<updated>2026-05-14T11:55:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;diff=3864</id>
		<title>CargoTypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;diff=3864"/>
		<updated>2019-04-29T13:52:07Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Reapplied milk fix (Express, liquid, refrigerated bitmask = 0b11000100 = 0x00C4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Cargo labels in OpenTTD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} In GRF version 8 the value to be used in all vehicle and industry properties, and in [[Action3|action 3]], is the position of the cargo label in the [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]] included in the GRF.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} GRF version 7 and below used different cargo properties for different properties (called &amp;quot;Type A&amp;quot; or &amp;quot;translated&amp;quot; and &amp;quot;Type B&amp;quot; or &amp;quot;untranslated&amp;quot; cargo slots), for historical reasons.  This method is deprecated as it meant relying blindly on cargos always using the same slots.  You can see the table of Type A and Type B slots [http://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;amp;oldid=2861 here] if you really want to.&lt;br /&gt;
&lt;br /&gt;
== Cargo Labels ==&lt;br /&gt;
&lt;br /&gt;
The following cargo labels have been defined so far:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Label&lt;br /&gt;
! Cargo Description&lt;br /&gt;
! [[Action0Cargos#CargoClasses_.2816.29|Cargo classes]]&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | Usage&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Basic Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;6&amp;quot; | These cargos are present when no NewGRF is used, or in some common Industry NewGRFs&lt;br /&gt;
|-&lt;br /&gt;
| PASS&lt;br /&gt;
| Passengers&lt;br /&gt;
| 0001 Passengers&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| COAL&lt;br /&gt;
| Coal&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MAIL&lt;br /&gt;
| Mail&lt;br /&gt;
| 0002 Mail&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| OIL_&lt;br /&gt;
| Oil&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| LVST&lt;br /&gt;
| Livestock&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GOOD&lt;br /&gt;
| Goods&lt;br /&gt;
| 0004 Express&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GRAI&lt;br /&gt;
| Grain&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Temperate; see also WHEA, MAIZ, CERE. YETI also adds 0200 Covered.&lt;br /&gt;
|-&lt;br /&gt;
| WOOD&lt;br /&gt;
| Wood&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| IORE&lt;br /&gt;
| Iron Ore&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| STEL&lt;br /&gt;
| Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Renamed &amp;quot;Balls of Steel&amp;quot; in YETI&lt;br /&gt;
|-&lt;br /&gt;
| VALU&lt;br /&gt;
| Valuables&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Temperate; see also GOLD, DIAM&lt;br /&gt;
|-&lt;br /&gt;
| PAPR&lt;br /&gt;
| Paper&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WHEA&lt;br /&gt;
| Wheat&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Arctic; see also GRAI, MAIZ, CERE&lt;br /&gt;
|-&lt;br /&gt;
| FOOD&lt;br /&gt;
| Food&lt;br /&gt;
| 0084 Express, refrigerated&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| YETI food has Refrigerated and piece goods&lt;br /&gt;
|-&lt;br /&gt;
| GOLD&lt;br /&gt;
| Gold&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Arctic; see also VALU, DIAM&lt;br /&gt;
|-&lt;br /&gt;
| RUBR&lt;br /&gt;
| Rubber&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FRUT&lt;br /&gt;
| Fruit&lt;br /&gt;
| 0090 Bulk, refrigerated&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| In FIRS: 00A4 Express, piece goods, refrigerated. In YETI: Piece goods, covered.&lt;br /&gt;
|-&lt;br /&gt;
| MAIZ&lt;br /&gt;
| Maize&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Tropic; see also GRAI, WHEA, CERE&lt;br /&gt;
|-&lt;br /&gt;
| CORE&lt;br /&gt;
| Copper Ore&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WATR&lt;br /&gt;
| Water&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| DIAM&lt;br /&gt;
| Diamonds&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Tropic; see also VALU, GOLD&lt;br /&gt;
|-&lt;br /&gt;
| SUGR&lt;br /&gt;
| Sugar&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Toyland.  In FIRS 0030 Bulk, piece goods&lt;br /&gt;
|-&lt;br /&gt;
| AORE&lt;br /&gt;
| Bauxite (Aluminium ore)&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BEAN&lt;br /&gt;
| Beans&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BEER&lt;br /&gt;
| Alcohol&lt;br /&gt;
| 0064 Express, piece goods, liquids&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BDMT&lt;br /&gt;
| Building Materials&lt;br /&gt;
| 0220 Piece goods, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| In FIRS: 0030 Bulk, piece goods. In YETI only Piece goods.&lt;br /&gt;
|-&lt;br /&gt;
| BOOM&lt;br /&gt;
| Explosives&lt;br /&gt;
| 0024 Express, piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BRCK&lt;br /&gt;
| Bricks&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CBLK&lt;br /&gt;
| Carbon Black&lt;br /&gt;
| 0230 Piece goods, Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CERA&lt;br /&gt;
| Ceramics&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CERE&lt;br /&gt;
| Cereals&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CLAY&lt;br /&gt;
| Clay&lt;br /&gt;
| 0210 Bulk covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CMNT&lt;br /&gt;
| Cement&lt;br /&gt;
| 0210 Bulk covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| COPR&lt;br /&gt;
| Copper&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CSTI&lt;br /&gt;
| Cast Iron&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CTAR&lt;br /&gt;
| Coal Tar&lt;br /&gt;
| 0140 Liquids, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| DYES&lt;br /&gt;
| Dyes&lt;br /&gt;
| 0060 Piece goods, liquids&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ENSP&lt;br /&gt;
| Engineering Supplies&lt;br /&gt;
| 0024 Express, piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FECR&lt;br /&gt;
| Ferrochrome&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FERT&lt;br /&gt;
| Fertiliser&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0024 Express, piece goods. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| FICR&lt;br /&gt;
| Fibre crops&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FISH&lt;br /&gt;
| Fish&lt;br /&gt;
| 0084 Express, refrigerated&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FMSP&lt;br /&gt;
| Farm Supplies&lt;br /&gt;
| 0024 Express, piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GLAS&lt;br /&gt;
| Glass&lt;br /&gt;
| 0420 Piece goods, oversized&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GRVL&lt;br /&gt;
| Stone&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Was &amp;quot;Gravel / Ballast&amp;quot;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| JAVA&lt;br /&gt;
| Coffee&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: black&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0024 Piece goods, express. Units in FIRS are &#039;bags&#039;&lt;br /&gt;
|-&lt;br /&gt;
| KAOL&lt;br /&gt;
| Kaolin (China Clay)&lt;br /&gt;
| 0250 Bulk, liquids, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: black&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| LIME&lt;br /&gt;
| Lime stone&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MILK&lt;br /&gt;
| Milk&lt;br /&gt;
| 00C4 Express, liquid, refrigerated&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| NITR&lt;br /&gt;
| Nitrate&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| OLSD&lt;br /&gt;
| Oil seed&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PEAT&lt;br /&gt;
| Peat&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PETR&lt;br /&gt;
| Petrol / Fuel Oil&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHOS&lt;br /&gt;
| Phosphate&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PLAS&lt;br /&gt;
| Plastic&lt;br /&gt;
| 0060 Piece goods, liquid&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PORE&lt;br /&gt;
| Pyrite Ore&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| POTA&lt;br /&gt;
| Potash&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0010 Bulk. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| RFPR&lt;br /&gt;
| Refined products&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SAND&lt;br /&gt;
| Sand&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SCMT&lt;br /&gt;
| Scrap Metal&lt;br /&gt;
| 1010 Bulk, non-pourable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SULP&lt;br /&gt;
| Sulphur&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0250 Bulk, Liquid, Covered/sheltered. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot;&amp;gt;ECS cargo classes changed as of Dec 31, 2010&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| TOUR&lt;br /&gt;
| Tourists&lt;br /&gt;
| 0005 Passengers, express&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| TYRE&lt;br /&gt;
| Tyres&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| URAN&lt;br /&gt;
| Uranium&lt;br /&gt;
| 0110 Bulk, Hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VEHI&lt;br /&gt;
| Vehicles&lt;br /&gt;
| 0420 Piece goods, oversized&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WDPR&lt;br /&gt;
| Wood Products&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WOOL&lt;br /&gt;
| Wool&lt;br /&gt;
| 0220 Piece goods, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ZINC&lt;br /&gt;
| Zinc&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Extended Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;6&amp;quot; | these cargos are only present in rare/specialized situations&lt;br /&gt;
|-&lt;br /&gt;
| ACID&lt;br /&gt;
| Acid&lt;br /&gt;
| 0140 Liquids, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CASS&lt;br /&gt;
| Cassava&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CHLO&lt;br /&gt;
| Chlorine&lt;br /&gt;
| 0140 Liquids, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| COKE&lt;br /&gt;
| Coke&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| EOIL&lt;br /&gt;
| Edible Oil&lt;br /&gt;
| 0060 Piece goods, liquids&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| IRON&lt;br /&gt;
| Pig Iron&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| METL&lt;br /&gt;
| Metal&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MNO2&lt;br /&gt;
| Manganese&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MNSP&lt;br /&gt;
| Manufacturing Supplies&lt;br /&gt;
| 0024 Piece goods, express&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| NUTS&lt;br /&gt;
| Nuts&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PIPE&lt;br /&gt;
| Pipe&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| POWR&lt;br /&gt;
| Electrical Machines&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| QLME&lt;br /&gt;
| Quicklime&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| RCYC&lt;br /&gt;
| Recyclables&lt;br /&gt;
| 0220 Piece goods, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0030 Bulk, piece goods&lt;br /&gt;
|-&lt;br /&gt;
| SALT&lt;br /&gt;
| Salt&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SASH&lt;br /&gt;
| Soda Ash&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SGBT&lt;br /&gt;
| Sugar beet&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| not in tropical&lt;br /&gt;
|-&lt;br /&gt;
| SGCN&lt;br /&gt;
| Sugarcane&lt;br /&gt;
| 1010 Bulk, non-pourable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| only tropical&lt;br /&gt;
|-&lt;br /&gt;
| SLAG&lt;br /&gt;
| Slag&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| STAL&lt;br /&gt;
| Alloy Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| STCB&lt;br /&gt;
| Carbon Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| STST&lt;br /&gt;
| Stainless Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VBOD&lt;br /&gt;
| Vehicle bodies&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VENG&lt;br /&gt;
| Vehicle Engines&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VPTS&lt;br /&gt;
| Vehicle Parts&lt;br /&gt;
| 0024 Piece goods, express&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Fantasy Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;6&amp;quot; | these cargos are for use in fantasy or science fiction settings&lt;br /&gt;
|-&lt;br /&gt;
| BATT&lt;br /&gt;
| Batteries&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| BUBL&lt;br /&gt;
| Bubbles&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| COLA&lt;br /&gt;
| Cola&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| CTCD&lt;br /&gt;
| Cotton Candy (Candyfloss)&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| FZDR&lt;br /&gt;
| Fizzy Drinks&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| PLST&lt;br /&gt;
| Plastic&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland; see also PLAS&lt;br /&gt;
|-&lt;br /&gt;
| SWET&lt;br /&gt;
| Sweets (Candy)&lt;br /&gt;
| 0004 Express&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| TOFF&lt;br /&gt;
| Toffee&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| TOYS&lt;br /&gt;
| Toys&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #CC00CC; color: black&amp;quot; | TTD&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| YETI&lt;br /&gt;
| Workers, YETI dudes&lt;br /&gt;
| 0404 Express, oversized&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| YETY&lt;br /&gt;
| Tired Workers, Tired YETI dudes&lt;br /&gt;
| 0404 Express, oversized&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Special Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;6&amp;quot; | these cargos are for use outside industry sets and do not represent transporting anything&lt;br /&gt;
|-&lt;br /&gt;
| DFLT&lt;br /&gt;
| &#039;Default&#039;&lt;br /&gt;
| ---- None&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Used by andythenorth to identify default cargo graphics in newgrfs that use code/graphics generation. &lt;br /&gt;
&lt;br /&gt;
Not intended to be used as an actual cargo in translation tables.&lt;br /&gt;
|-&lt;br /&gt;
| GEAR&lt;br /&gt;
| Locomotive regearing&lt;br /&gt;
| 8000 Special&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Using this cargo may make your vehicle set incompatible with some industry sets&lt;br /&gt;
&lt;br /&gt;
use CB36 instead to set capacity to 0&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Deprecated Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;6&amp;quot; | these cargos are not used by any current industry set, and are listed here for backwards compatibility&lt;br /&gt;
|-&lt;br /&gt;
| FRVG&lt;br /&gt;
| Fruit (and optionally Vegetables)&lt;br /&gt;
| 00A4 Express, piece goods, refrigerated&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated FIRS cargo. Replaced by FRUT for FIRS &amp;gt; v1.3.0&lt;br /&gt;
|-&lt;br /&gt;
| FUEL&lt;br /&gt;
| Fuel&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Use PETR for refined-oil fuel&lt;br /&gt;
|-&lt;br /&gt;
| RSGR&lt;br /&gt;
| Raw Sugar&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated in FIRS. See SGBT and SGCN&lt;br /&gt;
|-&lt;br /&gt;
| SCRP&lt;br /&gt;
| Scrap Metal&lt;br /&gt;
| 0010 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated in FIRS, use SCMT instead&lt;br /&gt;
|-&lt;br /&gt;
| TWOD&lt;br /&gt;
| Tropic Wood&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| formerly intended as a default cargo&lt;br /&gt;
|-&lt;br /&gt;
| WSTE&lt;br /&gt;
| Waste&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated in FIRS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you write or publish a NewGRF which introduces a new cargo label, please also add a comment where the new label is used.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;diff=3860</id>
		<title>CargoTypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;diff=3860"/>
		<updated>2019-04-25T17:11:28Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Express, liquid, refrigerated bitmask = 0b11000100 = 0x00C4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Cargo labels in OpenTTD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} In GRF version 8 the value to be used in all vehicle and industry properties, and in [[Action3|action 3]], is the position of the cargo label in the [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]] included in the GRF.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} GRF version 7 and below used different cargo properties for different properties (called &amp;quot;Type A&amp;quot; or &amp;quot;translated&amp;quot; and &amp;quot;Type B&amp;quot; or &amp;quot;untranslated&amp;quot; cargo slots), for historical reasons.  This method is deprecated as it meant relying blindly on cargos always using the same slots.  You can see the table of Type A and Type B slots [http://newgrf-specs.tt-wiki.net/index.php?title=CargoTypes&amp;amp;oldid=2861 here] if you really want to.&lt;br /&gt;
&lt;br /&gt;
== Cargo Labels ==&lt;br /&gt;
&lt;br /&gt;
The following cargo labels have been defined so far:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Label&lt;br /&gt;
! Cargo Description&lt;br /&gt;
! [[Action0Cargos#CargoClasses_.2816.29|Cargo classes]]&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;TTD Default Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;4&amp;quot; | These cargos are present when no NewGRF is used&lt;br /&gt;
|- &lt;br /&gt;
| PASS&lt;br /&gt;
| Passengers&lt;br /&gt;
| 0001 Passengers &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| COAL&lt;br /&gt;
| Coal&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| MAIL&lt;br /&gt;
| Mail&lt;br /&gt;
| 0002 Mail&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
|OIL_&lt;br /&gt;
| Oil&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| LVST&lt;br /&gt;
| Livestock&lt;br /&gt;
| 0020 Piece goods &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GOOD&lt;br /&gt;
| Goods&lt;br /&gt;
| 0004 Express&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GRAI&lt;br /&gt;
| Grain&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
|  &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Temperate; see also WHEA, MAIZ, CERE. YETI also adds 0200 Covered.&lt;br /&gt;
|-&lt;br /&gt;
| WOOD&lt;br /&gt;
| Wood&lt;br /&gt;
| 0020 Piece goods &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| IORE&lt;br /&gt;
| Iron Ore&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| STEL&lt;br /&gt;
| Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Renamed &amp;quot;Balls of Steel&amp;quot; in YETI&lt;br /&gt;
|-&lt;br /&gt;
| VALU&lt;br /&gt;
| Valuables&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Temperate; see also GOLD, DIAM&lt;br /&gt;
|-&lt;br /&gt;
| PAPR&lt;br /&gt;
| Paper&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| WHEA&lt;br /&gt;
| Wheat&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Arctic; see also GRAI, MAIZ, CERE&lt;br /&gt;
|-&lt;br /&gt;
| FOOD&lt;br /&gt;
| Food&lt;br /&gt;
| 0084 Express, refrigerated&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| YETI food has Refrigerated and piece goods&lt;br /&gt;
|-&lt;br /&gt;
| GOLD&lt;br /&gt;
| Gold&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| Arctic; see also VALU, DIAM&lt;br /&gt;
|-&lt;br /&gt;
| RUBR&lt;br /&gt;
|Rubber&lt;br /&gt;
|0040 Liquid &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| FRUT&lt;br /&gt;
| Fruit&lt;br /&gt;
| 0090 Bulk, refrigerated&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| In FIRS: 00A4 Express, piece goods, refrigerated. In YETI: Piece goods, covered.&lt;br /&gt;
|-&lt;br /&gt;
| MAIZ&lt;br /&gt;
| Maize&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| Tropic; see also GRAI, WHEA, CERE&lt;br /&gt;
|-&lt;br /&gt;
| CORE&lt;br /&gt;
| Copper Ore&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| WATR&lt;br /&gt;
| Water&lt;br /&gt;
| 0040 Liquid &lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DIAM&lt;br /&gt;
| Diamonds&lt;br /&gt;
| 0008 Armoured&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Tropic; see also VALU, GOLD&lt;br /&gt;
|-&lt;br /&gt;
| BATT&lt;br /&gt;
| Batteries&lt;br /&gt;
| 0020 Piece goods &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| BUBL&lt;br /&gt;
|Bubbles&lt;br /&gt;
|0020 Piece goods &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| COLA&lt;br /&gt;
|Cola&lt;br /&gt;
|0040 Liquid &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| CTCD&lt;br /&gt;
|Cotton Candy (Candyfloss)&lt;br /&gt;
|0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| FZDR&lt;br /&gt;
|Fizzy Drinks&lt;br /&gt;
|0020 Piece goods &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| PLST&lt;br /&gt;
|Plastic&lt;br /&gt;
|0040 Liquid &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland; see also PLAS&lt;br /&gt;
|-&lt;br /&gt;
| SWET&lt;br /&gt;
|Sweets (Candy)&lt;br /&gt;
|0004 Express &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| SUGR&lt;br /&gt;
| Sugar&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| Toyland.  In FIRS 0030 Bulk, piece goods&lt;br /&gt;
|-&lt;br /&gt;
| TOFF&lt;br /&gt;
|Toffee&lt;br /&gt;
|0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| TOYS&lt;br /&gt;
| Toys&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Toyland&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;New Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;4&amp;quot; | these cargos are only present when NewGRF industry sets are used&lt;br /&gt;
|-&lt;br /&gt;
| ACID&lt;br /&gt;
|Acid&lt;br /&gt;
|0140 Liquids, hazardous&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| AMBR&lt;br /&gt;
|Amber&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| AORE&lt;br /&gt;
|Bauxite (Aluminium ore)&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BAID&lt;br /&gt;
|Band-aids People&lt;br /&gt;
| 1005 Passengers, express, non pourable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BAKE&lt;br /&gt;
|Flour&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BEAN&lt;br /&gt;
|Beans&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BEER&lt;br /&gt;
|Alcohol&lt;br /&gt;
|0064 Express, piece goods, liquids&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BDMT&lt;br /&gt;
|Building Materials&lt;br /&gt;
|0220 Piece goods, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| In FIRS: 0030 Bulk, piece goods. In YETI only Piece goods.&lt;br /&gt;
|-&lt;br /&gt;
| BOOK&lt;br /&gt;
|Books&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| BOOM&lt;br /&gt;
|Explosives&lt;br /&gt;
|0024 Express, piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| BRCK&lt;br /&gt;
|Bricks&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CBLK&lt;br /&gt;
|Carbon Black&lt;br /&gt;
| 0230 Piece goods, Bulk, covered/sheltered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CASS&lt;br /&gt;
|Cassava&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CERA&lt;br /&gt;
|Ceramics&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CERE&lt;br /&gt;
|Cereals&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| CH4_&lt;br /&gt;
|Methane&lt;br /&gt;
| 0240 Liquid, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CHIP&lt;br /&gt;
|Microchip&lt;br /&gt;
| 0220 Piece goods, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CHLO&lt;br /&gt;
|Chlorine&lt;br /&gt;
|0140 Liquids, hazardous&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CHSE&lt;br /&gt;
|Dairy products&lt;br /&gt;
| 0100 Piece goods, refrigerated&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CLAY&lt;br /&gt;
|Clay&lt;br /&gt;
|0210 Bulk covered/sheltered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CMNT&lt;br /&gt;
|Cement&lt;br /&gt;
| 0210 Bulk covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| COKE&lt;br /&gt;
|Coke&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| COPR&lt;br /&gt;
|Copper&lt;br /&gt;
|0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CPTR&lt;br /&gt;
|Computer&lt;br /&gt;
| 0220 Piece goods, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| CSTI&lt;br /&gt;
|Cast Iron&lt;br /&gt;
|0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| CTAR&lt;br /&gt;
|Coal Tar&lt;br /&gt;
|0140 Liquids, hazardous&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| DNA_&lt;br /&gt;
|DNA&lt;br /&gt;
| 1220 Piece goods, non pourable, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DNLS&lt;br /&gt;
|Daniel-San&lt;br /&gt;
| 0001 Passengers&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DEUT&lt;br /&gt;
|Deuterium&lt;br /&gt;
| 0240 Liquid, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DINO&lt;br /&gt;
|Dinosaur&lt;br /&gt;
| 0420 Piece goods, oversized&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| DYES&lt;br /&gt;
|Dyes&lt;br /&gt;
| 0060 Piece goods, liquids&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| EELS&lt;br /&gt;
|Eels&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ENSP&lt;br /&gt;
|Engineering Supplies&lt;br /&gt;
|0024 Express, piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| EOIL&lt;br /&gt;
|Edible Oil&lt;br /&gt;
| 0060 Piece goods, liquids&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FECR&lt;br /&gt;
|Ferrochrome&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FERT&lt;br /&gt;
|Fertiliser&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| FIRS: 0024 Express, piece goods. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| FICR&lt;br /&gt;
|Fibre crops&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FISH&lt;br /&gt;
|Fish&lt;br /&gt;
| 0084 Express, refrigerated&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FMSP&lt;br /&gt;
|Farm Supplies&lt;br /&gt;
|0024 Express, piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| FROG&lt;br /&gt;
|Frogs&lt;br /&gt;
| 0024 Express, piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| FURN&lt;br /&gt;
|Furniture&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| GLAS&lt;br /&gt;
|Glass&lt;br /&gt;
| 0420 Piece goods, oversized&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| GRVL&lt;br /&gt;
|Stone&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|Was &amp;quot;Gravel / Ballast&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| H2__&lt;br /&gt;
|Hydrogen&lt;br /&gt;
| 0240 Liquid, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| IRON&lt;br /&gt;
|Pig Iron&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| JADE&lt;br /&gt;
|Jade&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| JAVA&lt;br /&gt;
|Coffee&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: black&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| FIRS: 0024 Piece goods, express. Units in FIRS are &#039;bags&#039; &lt;br /&gt;
|-&lt;br /&gt;
| JEWE&lt;br /&gt;
|Jewels&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| KAOL&lt;br /&gt;
|Kaolin (China Clay)&lt;br /&gt;
| 0250 Bulk, liquids, covered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: black&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| KBLL&lt;br /&gt;
|Kill Bill&lt;br /&gt;
| 0101 Passengers, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| KOJI&lt;br /&gt;
|Kōji-kin (Aspergillus oryzae)&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| KTNA&lt;br /&gt;
|Hattori Hanzō&#039;s Katana&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LIME&lt;br /&gt;
|Lime stone&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MBRR&lt;br /&gt;
|Mulberry leaves&lt;br /&gt;
| 0214 Express, bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| METL&lt;br /&gt;
|Metal&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MNO2&lt;br /&gt;
|Manganese&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MILK&lt;br /&gt;
|Milk&lt;br /&gt;
|00C4 Express, liquid, refrigerated&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| MNSP&lt;br /&gt;
|Manufacturing Supplies&lt;br /&gt;
|0024 Piece goods, express&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| N2__&lt;br /&gt;
|Nitrogen&lt;br /&gt;
| 0240 Liquid, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NDLE&lt;br /&gt;
|Noodles&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NITR&lt;br /&gt;
|Nitrate&lt;br /&gt;
|0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| NORI&lt;br /&gt;
|Seaweeds&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| NWST&lt;br /&gt;
|Nuclear waste&lt;br /&gt;
| 0100 Hazardous&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| NUTS&lt;br /&gt;
|Nuts&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| O2__&lt;br /&gt;
|Oxygen&lt;br /&gt;
| 0240 Liquid, covered &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| OLSD&lt;br /&gt;
|Oil seed&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| OYST&lt;br /&gt;
|Oysters&lt;br /&gt;
| 0024 Express, piece goods&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| PEAT&lt;br /&gt;
|Peat&lt;br /&gt;
| 0010 Bulk &lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PETR&lt;br /&gt;
|Petrol / Fuel Oil&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHOS&lt;br /&gt;
|Phosphate&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PIPE&lt;br /&gt;
|Pipe&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PLAS&lt;br /&gt;
|Plastic&lt;br /&gt;
| 0060 Piece goods, liquid&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PORE&lt;br /&gt;
|Pyrite Ore&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| POTA&lt;br /&gt;
|Potash&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|FIRS: 0010 Bulk. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| POWR&lt;br /&gt;
|Electrical Machines&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PRLS&lt;br /&gt;
|Pearls&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| PULP&lt;br /&gt;
|Pulpwood&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| QLME&lt;br /&gt;
|Quicklime&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| RANM&lt;br /&gt;
|Ranma full&lt;br /&gt;
| 0005 Passengers, express&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| RCYC&lt;br /&gt;
|Recyclables&lt;br /&gt;
| 0220 Piece goods, covered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|FIRS: 0030 Bulk, piece goods&lt;br /&gt;
|-&lt;br /&gt;
| RFPR&lt;br /&gt;
|Refined products&lt;br /&gt;
| 0040 Liquid&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| RICE&lt;br /&gt;
|Rice&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SAKE&lt;br /&gt;
|Sake&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SALT&lt;br /&gt;
|Salt&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SAND&lt;br /&gt;
|Sand&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SASH&lt;br /&gt;
|Soda Ash&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SCMT&lt;br /&gt;
|Scrap Metal&lt;br /&gt;
| 1010 Bulk, non-pourable&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SEED&lt;br /&gt;
|Seeds&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SGBT&lt;br /&gt;
|Sugar beet&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| not in tropical&lt;br /&gt;
|-&lt;br /&gt;
| SGCN&lt;br /&gt;
|Sugarcane&lt;br /&gt;
| 1010 Bulk, non-pourable&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
| only tropical&lt;br /&gt;
|-&lt;br /&gt;
| SILK&lt;br /&gt;
|Silk&lt;br /&gt;
| 1220 Piece goods, covered, non pourable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SLAG&lt;br /&gt;
|Slag&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SLCN&lt;br /&gt;
|Silicon&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SOYA&lt;br /&gt;
|Soya&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| STAL&lt;br /&gt;
|Alloy Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| STCB&lt;br /&gt;
|Carbon Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| STST&lt;br /&gt;
|Stainless Steel&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SULP&lt;br /&gt;
|Sulphur&lt;br /&gt;
| 0210 Bulk, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|FIRS: 0250 Bulk, Liquid, Covered/sheltered. ECS: &amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot;&amp;gt;ECS cargo classes changed as of Dec 31, 2010&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| T800&lt;br /&gt;
|Terminator&lt;br /&gt;
| 0101 Passengers, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| TATO&lt;br /&gt;
|Potatoes&lt;br /&gt;
| 0010 Bulk&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| TEXT&lt;br /&gt;
|Textiles&lt;br /&gt;
| 0024 Piece goods, express&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| TOFU&lt;br /&gt;
|Tofu&lt;br /&gt;
| 0100 Piece goods, refrigerated&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| TOUR&lt;br /&gt;
|Tourists&lt;br /&gt;
| 0005 Passengers, express&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| TYRE&lt;br /&gt;
|Tyres&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| UKYO&lt;br /&gt;
|Ukiyo-e&lt;br /&gt;
| 0008 Armored&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| URAN&lt;br /&gt;
|Uranium&lt;br /&gt;
| 0110 Bulk, Hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VBOD&lt;br /&gt;
|Vehicle bodies&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VEHI&lt;br /&gt;
|Vehicles&lt;br /&gt;
| 0420 Piece goods, oversized&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VENG&lt;br /&gt;
|Vehicle Engines&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
| &lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| VPTS&lt;br /&gt;
|Vehicle Parts&lt;br /&gt;
| 0024 Piece goods, express&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WDPR&lt;br /&gt;
|Wood Products&lt;br /&gt;
| 0030 Bulk, piece goods&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| WOOL&lt;br /&gt;
|Wool&lt;br /&gt;
| 0220 Piece goods, covered/sheltered&lt;br /&gt;
| style=&amp;quot;background: #FFCC00; color: black&amp;quot; | [[ttwiki:ECS|ECS]]&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;ref name=&amp;quot;ecs_cargo_change&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| WSBI&lt;br /&gt;
|Wasabi&lt;br /&gt;
| 0210 Bulk, covered&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| YETI&lt;br /&gt;
|Workers, YETI dudes&lt;br /&gt;
| 0404 Express, oversized&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| YETY&lt;br /&gt;
|Tired Workers, Tired YETI dudes&lt;br /&gt;
| 0404 Express, oversized&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #009fe3; color: black&amp;quot; | [[ttwiki:YETI|YETI]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ZINC&lt;br /&gt;
|Zinc&lt;br /&gt;
| 0020 Piece goods&lt;br /&gt;
|&lt;br /&gt;
| style=&amp;quot;background: #1AD74C; color: white&amp;quot; | [[ttwiki:FIRS|FIRS]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ZOMB&lt;br /&gt;
|Zombie&lt;br /&gt;
| 0101 Passengers, hazardous&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; |&#039;&#039;&#039;Special Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;4&amp;quot; | these cargos are for use outside industry sets and do not represent transporting anything&lt;br /&gt;
|-&lt;br /&gt;
| DFLT&lt;br /&gt;
|&#039;Default&#039;&lt;br /&gt;
| ---- None &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Used by andythenorth to identify default cargo graphics in newgrfs that use code/graphics generation. &lt;br /&gt;
&lt;br /&gt;
Not intended to be used as an actual cargo in translation tables.&lt;br /&gt;
|-&lt;br /&gt;
| GEAR&lt;br /&gt;
|Locomotive regearing&lt;br /&gt;
|8000 Special &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Using this cargo may make your vehicle set incompatible with some industry sets&lt;br /&gt;
&lt;br /&gt;
use CB36 instead to set capacity to 0&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot; |&#039;&#039;&#039;Deprecated Cargos&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; colspan=&amp;quot;4&amp;quot; | these cargos are not used by any current industry set, and are listed here for backwards compatibility&lt;br /&gt;
|-&lt;br /&gt;
| FRVG&lt;br /&gt;
|Fruit (and optionally Vegetables)&lt;br /&gt;
|00A4 Express, piece goods, refrigerated&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| Deprecated FIRS cargo. Replaced by FRUT for FIRS &amp;gt; v1.3.0&lt;br /&gt;
|-&lt;br /&gt;
| FUEL&lt;br /&gt;
|Fuel&lt;br /&gt;
|0040 Liquid &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|Use PETR for refined-oil fuel&lt;br /&gt;
|-&lt;br /&gt;
| RSGR&lt;br /&gt;
|Raw Sugar&lt;br /&gt;
|0010 Bulk &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated in FIRS. See SGBT and SGCN&lt;br /&gt;
|-&lt;br /&gt;
| SCRP&lt;br /&gt;
|Scrap Metal&lt;br /&gt;
|0010 Piece goods &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| Deprecated in FIRS, use SCMT instead&lt;br /&gt;
|-&lt;br /&gt;
| TWOD&lt;br /&gt;
|Tropic Wood&lt;br /&gt;
|0020 Piece goods &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| formerly intended as a default cargo&lt;br /&gt;
|-&lt;br /&gt;
| WSTE&lt;br /&gt;
|Waste&lt;br /&gt;
|0010 Bulk &lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| Deprecated in FIRS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you write or publish a NewGRF which introduces a new cargo label, please also add a comment where the new label is used.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3702</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3702"/>
		<updated>2015-12-25T21:33:14Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: intended to swap this one instead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8 / 16&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301. {{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, see below.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
* &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, NW, SE, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, this allows to use different sprites resp. offsets for the fences on either track side.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! Sprite number !! Tile slope !! Track bit !! Fence position !! Version&lt;br /&gt;
|-&lt;br /&gt;
| 0 || flat || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flat || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || flat || left || E || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flat || upper || S || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SW || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SE || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NE || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NW || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flat || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 9 || flat || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 10 || flat || left || W || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 11 || flat || upper || N || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 12 || SW || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 13 || SE || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 14 || NE || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NW || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the state, variant and type of the signal. Use the builtin function &amp;lt;code style:darkgreen&amp;gt;getbits()&amp;lt;/code&amp;gt; in the following fashion to access the information:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal state: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal variant: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal type: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the drawing context.&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3701</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3701"/>
		<updated>2015-12-25T21:32:34Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Undo revision 3700 by Juzza1 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8 / 16&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301. {{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, see below.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
* &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, this allows to use different sprites resp. offsets for the fences on either track side.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! Sprite number !! Tile slope !! Track bit !! Fence position !! Version&lt;br /&gt;
|-&lt;br /&gt;
| 0 || flat || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flat || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || flat || left || E || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flat || upper || S || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SW || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SE || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NE || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NW || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flat || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 9 || flat || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 10 || flat || left || W || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 11 || flat || upper || N || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 12 || SW || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 13 || SE || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 14 || NE || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NW || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the state, variant and type of the signal. Use the builtin function &amp;lt;code style:darkgreen&amp;gt;getbits()&amp;lt;/code&amp;gt; in the following fashion to access the information:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal state: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal variant: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal type: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the drawing context.&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3700</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3700"/>
		<updated>2015-12-25T15:52:10Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: tested&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8 / 16&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301. {{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, see below.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
* &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, this allows to use different sprites resp. offsets for the fences on either track side.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! Sprite number !! Tile slope !! Track bit !! Fence position !! Version&lt;br /&gt;
|-&lt;br /&gt;
| 0 || flat || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flat || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || flat || left || E || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flat || upper || S || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SW || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SE || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NE || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NW || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flat || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 9 || flat || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 10 || flat || left || W || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 11 || flat || upper || N || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 12 || SW || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 13 || SE || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 14 || NE || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NW || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, SE-facing, NW-facing, E-facing, W-facing, S-facing, N-facing. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the state, variant and type of the signal. Use the builtin function &amp;lt;code style:darkgreen&amp;gt;getbits()&amp;lt;/code&amp;gt; in the following fashion to access the information:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal state: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal variant: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal type: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the drawing context.&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3698</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3698"/>
		<updated>2015-12-10T09:27:54Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Recommending is useless since this is the way&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8 / 16&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301. {{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, see below.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
* &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, this allows to use different sprites resp. offsets for the fences on either track side.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! Sprite number !! Tile slope !! Track bit !! Fence position !! Version&lt;br /&gt;
|-&lt;br /&gt;
| 0 || flat || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flat || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || flat || left || E || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flat || upper || S || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SW || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SE || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NE || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NW || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flat || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 9 || flat || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 10 || flat || left || W || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 11 || flat || upper || N || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 12 || SW || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 13 || SE || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 14 || NE || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NW || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the state, variant and type of the signal. Use the builtin function &amp;lt;code style:darkgreen&amp;gt;getbits()&amp;lt;/code&amp;gt; in the following fashion to access the information:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal state: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal variant: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal type: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the drawing context.&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3697</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3697"/>
		<updated>2015-12-10T09:23:40Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Explained the extra_callback_info1/2 a bit more, removed old shorthands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8 / 16&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301. {{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, see below.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
* &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.6|no|ottdrev=r27343}} Since OpenTTD r27343 there is also a 16 sprites version, this allows to use different sprites resp. offsets for the fences on either track side.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! Sprite number !! Tile slope !! Track bit !! Fence position !! Version&lt;br /&gt;
|-&lt;br /&gt;
| 0 || flat || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flat || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 2 || flat || left || E || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flat || upper || S || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SW || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SE || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NE || X || NW || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NW || Y || NE || {{ottdp|1.0|no|ottdrev=r19056}}&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flat || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 9 || flat || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 10 || flat || left || W || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 11 || flat || upper || N || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 12 || SW || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 13 || SE || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 14 || NE || X || SE || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NW || Y || SW || {{ottdp|1.6|no|ottdrev=r27343}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the state, variant and type of the signal. It is recommended to use the builtin function &amp;lt;code style:darkgreen&amp;gt;getbits()&amp;lt;/code&amp;gt; in the following fashion to access the information:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal state: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal variant: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Signal type: &amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the drawing context.&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| |-&lt;br /&gt;
! Result !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=PalettesAndCoordinates&amp;diff=3671</id>
		<title>PalettesAndCoordinates</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=PalettesAndCoordinates&amp;diff=3671"/>
		<updated>2015-06-14T14:11:23Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Showing Windows palette first could imply it is preferred - the opposite is true&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Palettes==&lt;br /&gt;
&lt;br /&gt;
Since TTD is a palette-based game, you have to be careful that the graphics program you use can deal with that properly. Also, TTD uses some palette entries for palette cycling to do some colour-animation, don&#039;t use these as regular colours. These entries are often called &amp;quot;action colours&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Palette files for a number of graphics programmes are available on the [http://dev.openttdcoop.org/documents/1 DevZone]&lt;br /&gt;
&lt;br /&gt;
Below is an explanation by Oskar Eisemuth of the various colour ranges in the DOS and Windows palettes. Both palettes work similarly, but some of the colours are in different places. Do use the DOS palette as it contains some additional colours and is easier to work with (all grays in one line).&lt;br /&gt;
&lt;br /&gt;
[[File:dospal.png]]&lt;br /&gt;
[[File:windowspal.png]]&lt;br /&gt;
&lt;br /&gt;
Info on the image: The colors you &#039;&#039;&#039;can use normally&#039;&#039;&#039; are marked in &#039;&#039;&#039;green&#039;&#039;&#039;. The colors which &#039;&#039;&#039;have special purposes/are color cycles&#039;&#039;&#039; are marked &#039;&#039;&#039;yellow&#039;&#039;&#039;. &#039;&#039;&#039;Don&#039;t use&#039;&#039;&#039; the &#039;&#039;&#039;pink&#039;&#039;&#039; colours like the ones marked &amp;quot;WinAPI&amp;quot; in the Windows palette. &lt;br /&gt;
The &#039;&#039;&#039;Pure White&#039;&#039;&#039; at the bottom right of each palette is a palette colour, but you shouldn&#039;t use it in graphics; instead use the &amp;quot;almost white&amp;quot; from index 0x0F instead (colour code #FCFCFC). Use pure white for the background of your sprite sheet; [http://dev.openttdcoop.org/projects/grfcodec GRFCodec] and [[NML:Main|NML]] will issue a warning if a sprite containes pure white pixels. This warning is useful as it lets you know that the code referencing a sprite has the wrong position or size defined, but not so useful if your sprite actually contains pure white pixels.&lt;br /&gt;
&lt;br /&gt;
The colours in the &amp;quot;company&amp;quot; range are often (but not always) changed to the current player colours. In some instances, they may be changed to colours specified by the .grf file, or random colours, or not changed at all.&lt;br /&gt;
&lt;br /&gt;
Here is a list, provided by [[ttwiki:George|George]], of the shades of player colours that will be used:&lt;br /&gt;
&lt;br /&gt;
[[File:playercolours.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Company 2&amp;quot; range is normally not a special colour range, but since TTDPatch 2.0.1 alpha 67 it is possible to activate it as a second company colour for vehicles and town houses.&lt;br /&gt;
&lt;br /&gt;
The palette cycling ranges listed are the water cycle (used for the blinking dots in the water), the block cycle, fire cycle, exchange red (better called crossing red; used for the flashing crossing lights), and the yellow cycle (used for lights in the runway of the large airport).&lt;br /&gt;
&lt;br /&gt;
The following table presents more detailed info on differences between DOS and Windows colours and colour indices:&lt;br /&gt;
&lt;br /&gt;
[[File:TTD_Palettes.png]]&lt;br /&gt;
&lt;br /&gt;
== Coordinates ==&lt;br /&gt;
&lt;br /&gt;
TTD internally uses a pseudo-3D or [http://en.wikipedia.org/wiki/2.5D 2.5D engine], which uses an [http://en.wikipedia.org/wiki/Isometric_graphics_in_video_games isometric projection] to display graphics on a 2D screen. The graphics engine uses so-called &amp;quot;bounding boxes&amp;quot; for each sprite, which are sorted by the sprite sorter to get drawn in (what it thinks is) the right order.&lt;br /&gt;
&lt;br /&gt;
To get a certain sprite drawn at the right place, it needs to have a proper bounding box (which is provided by the game for the most part), and the correct 2D offsets, here called &amp;quot;xofs&amp;quot; and &amp;quot;yofs&amp;quot; (see [[RealSprites]] for more information). The following picture by Oskar Eisemuth should help in figuring out how the 3D and 2D coordinates relate to each other:&lt;br /&gt;
&lt;br /&gt;
[[File:coordinates3d.png]]&lt;br /&gt;
&lt;br /&gt;
For 3D coordinates, X goes from top right to bottom left, Y goes from top left to bottom right, and Z (height) from down to up. For 2D coordinates, X goes from left to right, and Y from top to bottom. Usually, the top side of the screen is referred to as &amp;quot;north&amp;quot;, and thus &amp;quot;east&amp;quot;, &amp;quot;south&amp;quot; and &amp;quot;west&amp;quot; are the right, bottom and left side of the screen.&lt;br /&gt;
&lt;br /&gt;
For vehicles, the center of the bounding box (shown with a red dot in the yellow boxframe) is the reference point from which the xofs and yofs are counted. This means that in most cases, xofs and yofs need to be negative to get the sprite to fit on the box. Normally, as indicated above, this means xofs is approximately the negative value of half the sprite width, and yofs is approximately the negative value of half the sprite height.&lt;br /&gt;
&lt;br /&gt;
For all other sprites, the reference point is the furthest corner of the box, at its lowest X, Y and Z coordinates, i.e. the lower northernmost corner. In the image above, it is indicated by the crossing point of the blue lines. The xofs and yofs work from this point, instead of the center of the box as for vehicles.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3618</id>
		<title>NML:Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3618"/>
		<updated>2015-02-24T11:14:48Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Moved to http://newgrf-specs.tt-wiki.net/wiki/NML:Sorting_vehicles_in_the_purchase_list (info about not being encoded in item/property block removed, unnecessary for NML defelopers)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
== Vehicle IDs ==&lt;br /&gt;
Picking an item ID requires keeping two cases in mind: OpenTTD with the engine pool enabled and OpenTTD with engine pool disabled / TTDPatch. The status of the engine pool may be checked with the global variable [[NML:General#General_variables|dynamic_engines]].&lt;br /&gt;
&lt;br /&gt;
=== Engine pool enabled ===&lt;br /&gt;
With the engine pool enabled, each NewGRF has its own ID range, NewGRFs don&#039;t influence each other. IDs may freely be chosen between 0 and 65535. If the chosen ID belongs to an existing vehicle, this vehicle is overridden by your vehicle. If another NewGRF is already overriding that vehicle, a new vehicle will be allocated, but all the properties will be copied from the old vehicle. If you define an ID for which no original vehicle exists, a new (blank) vehicle is allocated.&lt;br /&gt;
&lt;br /&gt;
This behaviour can be modified using an [[NML:Overriding_vehicles_in_other_NewGRFs|engine_override]], this allows changing the properties of vehicles defined in other NewGRFs instead of allocating a new vehicle.&lt;br /&gt;
&lt;br /&gt;
=== TTDPatch / Engine pool disabled ===&lt;br /&gt;
Each new vehicle has to replace an existing vehicle. If multiple NewGRFs try to replace the same vehicle, the last NewGRF loaded &#039;wins&#039;. [[VehicleIDs|This page]] contains a list of valid vehicle IDs for each vehicle type, look in the &#039;NML ID&#039; column. Note that IDs are not bound to a specific sort of vehicle (e.g. monorail wagons) but to a feature (e.g. trains, road vehicles).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general, you should take the following steps:&lt;br /&gt;
* If your NewGRF is intended as a complete replacement for the default vehicles, disable the relevant default vehicles using [[NML:Disable_items|disable_item]].&lt;br /&gt;
* Re-use IDs of existing vehicles as much as possible.&lt;br /&gt;
* If your NewGRF uses IDs outside of the normal range (for example, because you there are more vehicles than slots available), let your code check if dynamic_engies is enabled. If not, skip the vehicles outside the normal range (using an if-statement) and make sure that the remaining vehicles allow for reasonable gameplay. It is recommended to issue a warning to the user about this. Alternatively, it is also possible to disable your entire NewGRF. If you don&#039;t do this check and dynamic_engines is off, OpenTTD may disable your NewGRF with the somewhat cryptic message &#039;Attempt to use invalid ID&#039;, which will likely lead to bug reports about your NewGRF and/or your OpenTTD.&lt;br /&gt;
&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
| (string)&lt;br /&gt;
| yes&lt;br /&gt;
| for example &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;string(STR_NAME_HEREFORD_TRAM)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;climates_available&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(CLIMATE_XXX, CLIMATE_YYY, ...)&lt;br /&gt;
| set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
;CLIMATE_TEMPERATE&lt;br /&gt;
;CLIMATE_ARCTIC&lt;br /&gt;
;CLIMATE_TROPICAL&lt;br /&gt;
;CLIMATE_TOYLAND&lt;br /&gt;
;NO_CLIMATE&lt;br /&gt;
:Vehicle is availble in no climate (e.g. for articulated parts)&lt;br /&gt;
;ALL_CLIMATES&lt;br /&gt;
:Vehicle is available irrespective of climate&lt;br /&gt;
&lt;br /&gt;
To make a vehicle available in all climates except toyland you could use: &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES &amp;amp;amp; ~bitmask(CLIMATE_TOYLAND)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date&amp;lt;/code&amp;gt;(yyyy,mm,dd)&lt;br /&gt;
| no&lt;br /&gt;
| Valid range for yyyy is 0 ... 5000000. In TTDPatch, dates after 2044 will be limited to 2044. Unless the engine is introduced within two years after game-start (always 1920 in TTDPatch), a random number of days between 0 and 511 will be added to this.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 254 (years) or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
Number of years a model is &amp;quot;supported&amp;quot; by the manufacturer, see [[#Engine life cycle|below]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127 (years)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
Retire the vehicle (make it unavailable in the purchase menu) this many years before reliability starts dropping, see [[#Engine life cycle|below]]. May be negative.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;vehicle_life&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 (years)&lt;br /&gt;
| no&lt;br /&gt;
| Life length of an individual vehicle, before it is considered too old and in need of replacement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;reliability_decay&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| Default vehicles use 20. The higher the value the faster reliability decays, the more frequent service is needed. 0 means reliability never decreases if the vehicle is not too old&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refittable_cargo_classes&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
bit set of [[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
| yes&lt;br /&gt;
| for example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_BULK, CC_COVERED)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;non_refittable_cargo_classes&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
bit set of [[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
| yes&lt;br /&gt;
| for example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_OVERSIZED, CC_SPECIAL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refittable_cargo_types&amp;lt;/code&amp;gt;&lt;br /&gt;
| bit mask of entries into the cargo translation table&lt;br /&gt;
| yes&lt;br /&gt;
| As of NML 0.3, do not use this. Use cargo_[dis]allow_refit (see below) instead.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_allow_refit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23291}} A list of cargo types to allow refitting to, irrespective of cargo classes. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;[COAL, IORE]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_disallow_refit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23291}} A list of cargo types to disallow refitting to, irrespective of cargo classes. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;[MAIL]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;loading_speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 (cargo units)&lt;br /&gt;
| yes&lt;br /&gt;
| Units of cargo loaded per time unit. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft. This amount of cargo is loaded to or unloaded from the vehicle every 40 ticks for trains, every 20 ticks for road vehicles and aircraft and every 10 ticks for ships.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cost_factor&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Set to 0&lt;br /&gt;
| multiplier to the base purchase cost&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_factor&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Set to 0&lt;br /&gt;
| multiplier to the base running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_age_period&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22713}} This property specifies after how many ticks cargo is aged. Default value is 185. 74 ticks is equal to 1 day.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Refittability===&lt;br /&gt;
&lt;br /&gt;
To determine whether your vehicle can be refitted to a certain cargo, OpenTTD uses the following table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Cargo matches refittable_cargo_classes&lt;br /&gt;
! Cargo matches non_refittable_cargo_classes&lt;br /&gt;
! Cargo in cargo_allow_refit&lt;br /&gt;
! Cargo in cargo_disallow_refit&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For those that prefer boolean logic, the formula is as follows:&lt;br /&gt;
&lt;br /&gt;
refittable = ((cargo classes in refittable_cargo_classes AND NOT cargo classes in non_refittable_cargo_classes) OR cargo in cargo_allow_refit) AND NOT (cargo in cargo_disallow_refit)&lt;br /&gt;
&lt;br /&gt;
In general, you should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only then use cargo_allow_refit and cargo_disallow_refit to allow/disallow specific cargos.&lt;br /&gt;
&lt;br /&gt;
===Engine life cycle===&lt;br /&gt;
&lt;br /&gt;
The life cycle of a vehicle model consists of three phases, as outlined in the following table. When starting a new game, a random amount between 31 months and 17 years is added to the model life as well. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! phase&lt;br /&gt;
! duration&lt;br /&gt;
! reliability&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 7 to 38 months&lt;br /&gt;
| increases from 48-73% to 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; - 8 years&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.5 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sprite_id&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;SPRITE_ID_NEW_TRAIN&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
| Max speed for engines, speed limit for wagons&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(TRAIN_FLAG_XXX, ...)&lt;br /&gt;
| FLIP should not be set, TILT and MU TO the same value as the 1st part&lt;br /&gt;
| &lt;br /&gt;
;TRAIN_FLAG_TILT&lt;br /&gt;
: enable the tilt bonus (20% speed in curves, if all vehicles in consist have it set)&lt;br /&gt;
;TRAIN_FLAG_2CC&lt;br /&gt;
:Enable use of the 2nd company colour&lt;br /&gt;
;TRAIN_FLAG_MU&lt;br /&gt;
:act as multiple unit (used for livery selection only)&lt;br /&gt;
;TRAIN_FLAG_FLIP&lt;br /&gt;
:Allow vehicle to be flipped (reversed) in depot&lt;br /&gt;
;TRAIN_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autoreffitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;TRAIN_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| in 50% units of the purchase price cost base&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;callback_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 10 * weight (in tons), with 10 being an approximation of the acceleration of gravity (9.81 m/s). A good value for rail tracks is 0.3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_ROADVEH&lt;br /&gt;
| yes&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 ... 514km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(ROADVEH_FLAG_XXX, ...)&lt;br /&gt;
| partly; tram flag must the same&lt;br /&gt;
| &lt;br /&gt;
;ROADVEH_FLAG_TRAM&lt;br /&gt;
:The vehicle requires tram tracks to run on&lt;br /&gt;
;ROADVEH_FLAG_2CC&lt;br /&gt;
:Enable 2nd company colour&lt;br /&gt;
;ROADVEH_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;ROADVEH_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| in 25% units of the purchase price cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_base&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 10 * weight (in tons), with 10 being an approximation of the acceleration of gravity (9.81 m/s). Default value is 0.3.&lt;br /&gt;
|-&lt;br /&gt;
| air_drag_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_SHIP&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 ... 127 km/h (float, speed units)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(SHIP_FLAG_XXX)&lt;br /&gt;
| Bitmask with to possible flags, set to 0 to disable all. &lt;br /&gt;
&lt;br /&gt;
;SHIP_FLAG_2CC&lt;br /&gt;
:Enable use of the 2nd company colour&lt;br /&gt;
;SHIP_FLAG_AUTOREFIT&lt;br /&gt;
:llow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;SHIP_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of the default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| is_refittable&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 0=false, 1=true. Note: if you do not set this property to 1, then refittable_cargo_classes / non_refittable_cargo_classes have no effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| For ships (unlike other vehicle types) the capacity set here is not affected by the cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_AIRCRAFT&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 .. 3280 km/h (float, speed units)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| 0 .. 2894&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.2|no|ottdrev=r23504}} Maximum (euclidean) distance the aircraft can cover between two airports. Set to 0 for unlimited range.&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(AIRCRAFT_FLAG_2CC, AIRCRAFT_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with to possible flags, set to 0 to disable all. &lt;br /&gt;
&lt;br /&gt;
;AIRCRAFT_FLAG_2CC&lt;br /&gt;
:Enable 2nd company colour&lt;br /&gt;
;AIRCRAFT_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;AIRCRAFT_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_refit&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|cargo class]]&lt;br /&gt;
| No&lt;br /&gt;
| cargo class most often refit to&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_consist_info&lt;br /&gt;
| Bitmask 8 bit&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Binary OR of the values of [[#bitmask vehicle info|bitmask_vehicle_info]] of all vehicles (engines, wagons) in the consist. Only available for rail vehicles.&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Yes&lt;br /&gt;
| company number of the vehicle owner. TTDPatch only supports up to 8 companies (0 ... 7)&lt;br /&gt;
|-&lt;br /&gt;
| company_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
Same as company_colour1, if no 2nd company colour is chosen. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_height&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Height difference between the aircraft and its shadow. 8 Units are equivalent to one height level on the map.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XX&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
;AIRPORTTYPE_SMALL&lt;br /&gt;
;AIRPORTTYPE_LARGE&lt;br /&gt;
;AIRPORTTYPE_HELIPORT&lt;br /&gt;
;AIRPORTTYPE_OILRIG&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_prev_cur&lt;br /&gt;
| -2 ... 2&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the previous (towards engine) vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_cur_next&lt;br /&gt;
| -2 ... 2&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between this vehicle and the next (towards rear end) vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_prev_next&lt;br /&gt;
| -4 ... 4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the previous (towards engine) and next (towards rear end) vehicle. Curvature to the right is positive. 1 unit is 45 degrees. Equal to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curve_invo_prev_cur + curv_info_cur_next&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&#039;&#039;&#039;&#039;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Returns a magic number that represents the curvature state of the prev-cur-next vehicle triplet. Do not try to make sense of this magic number, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;vehicle_curv_info()&amp;lt;/code&amp;gt; instead to make comparisons. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info == vehicle_curv_info(a, b)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;(curv_info_prev_cur == a) &amp;amp;amp;&amp;amp;amp; (curv_info_cur_next == b)&amp;lt;/code&amp;gt;, however the former can easily be used in a switch-block.&lt;br /&gt;
|-&lt;br /&gt;
| motion_counter&lt;br /&gt;
| 0 ... 15&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for animations.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_in_veh&lt;br /&gt;
| entry in cargo translation table&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
| 0xFF if not present in the table&lt;br /&gt;
|-&lt;br /&gt;
| cargo_unit_weight&lt;br /&gt;
| weight per unit in 1/16t&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes&lt;br /&gt;
| Bitmask of [[NML:Cargos#Cargo properties|cargo class]]&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
| class of the currently transported cargo&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_available&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is available on the open market&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_testing&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is currently being tested&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_offered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is currently being offered for exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
| build_year&lt;br /&gt;
| 0 ... 5000000&lt;br /&gt;
| Yes&lt;br /&gt;
| 0-based year when the vehicle was built, current year if the vehicle is not built yet&lt;br /&gt;
|-&lt;br /&gt;
| direction&lt;br /&gt;
| DIRECTION_XX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of direction constants|here]] for an overview of possible values and their meaning.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Cargo capacity (number of units) of the vehicle&lt;br /&gt;
|-&lt;br /&gt;
| cargo_count&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Number of cargo units of cargo in the vehicle&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Cargo subtype, used to provide more than one refit option for the same cargo type. See also the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype_text&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle provides power and is on the correct track type&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_not_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle is either on a wrong track type or it doesn&#039;t provide power at all&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_potentially_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle provides power, if it is on a suitable track type&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_reversed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has reversed an odd number of times&lt;br /&gt;
|-&lt;br /&gt;
| built_during_preview&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle was built during the exclusive preview stage&lt;br /&gt;
|-&lt;br /&gt;
| current_railtype&lt;br /&gt;
| No&lt;br /&gt;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| Don&#039;t use this variable unless you&#039;ve defined a railtype translation table. If the train is running on a railtype that is not listed in your railtype translation table this variable will contain 0xFF. Available since OpenTTD r20164.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&lt;br /&gt;
The following table contains a list of available vehicle callbacks. Additionally, it&#039;s possible to provide cargo-specific graphics, using the identifier from the [[NML:Cargotable|cargo table]] as callback name. These callbacks will be used if the vehicle is refitted to the corresponding cargo type. If no cargo-specific graphics match the cargo that the vehicle is carrying, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback is used instead. Cargo-specific graphics callbacks are never called from the purchase menu, refer to the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt; callback below instead.&lt;br /&gt;
&lt;br /&gt;
Note that the above affects &#039;&#039;&#039;graphics only&#039;&#039;&#039;, other callbacks are unaffected.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Sprite group&lt;br /&gt;
| &#039;Normal&#039; vehicle graphics, if no cargo-specific graphics apply. See also the section on [[#Sprites in GUI|GUI sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
| Sprite group&lt;br /&gt;
| Graphics to show in the buy menu (only the horizontal view is needed, except for dual-headed trains. With the &amp;lt;code&amp;gt;dual_headed&amp;lt;/code&amp;gt; property set, special rules for the purchase menu sprite apply: two sprites are drawn (for front and back) as if the vehicle is normally constructed. If you supply one purchase menu sprite, it will be used for both vehicle parts in the purchase menu. Provide a set of 8 sprites, and the 7th resp. 3rd sprite will be drawn; provide a set of 8 blank sprites except the 7th if you want to fully control a single purchase menu sprite for a dual-headed engine. ) See also the section on [[#Sprites in GUI|GUI sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| rotor&lt;br /&gt;
| Aircraft (helicopters)&lt;br /&gt;
| No&lt;br /&gt;
| Sprite group&lt;br /&gt;
| Graphics for the helicopter rotor (4 sprites; 1 stopped and 3 moving)&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| N/A&lt;br /&gt;
| See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_text&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| String, or CB_RESULT_NO_TEXT&lt;br /&gt;
| With this callback, you can display extra text after the cargo in the vehicle information window. This callback is called during refitting, with succesively increased values of the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype&amp;lt;/code&amp;gt; variable, until the callback returns CB_RESULT_NO_TEXT. All returned strings are then displayed as refit options. The chosen refit option is saved in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype&amp;lt;/code&amp;gt; variable, so it can be used later for other things. In the HEQS grf for example, this mechanism is used to let the user choose between different capacities of the same vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the purchase list.&lt;br /&gt;
|-&lt;br /&gt;
| colour_mapping&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_colour_mapping&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Recolour sprite number&lt;br /&gt;
|&lt;br /&gt;
With this callback, you can use a different recolour sprite instead of the standard 1cc / 2cc company colour remappings. See [[NML:List of default colour translation palettes|here]] for a list of default palettes. See the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;reserve_sprites()&amp;lt;/code&amp;gt; for info on how to allocate your own sprite. For performance, the result is cached and only updated if the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt; every_32_days&amp;lt;/code&amp;gt; callback requires so. Add CB_RESULT_COLOUR_MAPPING_ADD_CC to the result to add the company colour to the sprites, this requires 16 (1cc) or 256 (2cc) sprites in total.&lt;br /&gt;
|-&lt;br /&gt;
| start_stop&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| Called when starting or stopping a vehicle. Mainly useful to prevent vehicles from leaving the depot unless a certain condition is met. Return CB_RESULT_NO_TEXT to allow or a string (containing an error message) to disallow starting/stopping.&lt;br /&gt;
|-&lt;br /&gt;
| every_32_days&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| bitmask(CB_RESULT_32_DAYS_XXX, ...)&lt;br /&gt;
| Called every 32 days. Set CB_RESULT_32_DAYS_TRIGGER in the bitmask to trigger TRIGGER_VEHICLE_32_CALLBACK. Set CB_RESULT_32_DAYS_COLOUR_MAPPING in the bitmask to update the colour mapping by re-running the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour_mapping&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| SOUND_XXX, sound(&amp;quot;sound.wav&amp;quot;), import_sound(grfid, number) or CB_RESULT_NO_SOUND&lt;br /&gt;
|&lt;br /&gt;
Called to play various vehicle sounds. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the sound event, see the [[#Sound events|table]] below. Return SOUND_XXX (see [[NML:List_of_sound_effects|here]]) to return a default sound. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sound(&amp;quot;soundfile&amp;quot;)&amp;lt;/code&amp;gt; imports a sound from a .wav file. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; imports a sound from another grf. A failed (or not implemented) callback will cause the default sound to be played. Return CB_RESULT_NO_SOUND to play no sound at all.&lt;br /&gt;
|-&lt;br /&gt;
| articulated_part&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes (no separate callback)&lt;br /&gt;
| Vehicle ID, or CB_RESULT_NO_MORE_ARTICULATED_PARTS&lt;br /&gt;
| With this callback, you can add articulated parts (e.g. tenders) to your vehicle. Called repeatedly, until CB_RESULT_NO_MORE_ARTICULATED_PARTS is returned. After each call, the returned vehicleID is added to your vehicle. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc. Note that callback may be called from the purchase list, using vehicle variables is not possible. Or CB_RESULT_REVERSED_VEHICLE to the returned vehicle ID to display the vehicle backwards. &lt;br /&gt;
&lt;br /&gt;
For NML 0.2 and lower the vehicle ID of the articulated part must be in the range 0 .. 127.&lt;br /&gt;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well. Variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains information about the target cargo type in the format 0xccccsstt, with tt being the new cargo type, ss the new cargo subtype (see &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype_text&amp;lt;/code&amp;gt;-callback) and cccc a bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following callbacks all have an equivalent property. The property description applies here also, except where otherwise noted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sprites in GUI===&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r23080}} Since OpenTTD r23080 you can use variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; to display different sprites in the GUI and on the map. Currently these cases are available:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of extra_callback_info1 !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Vehicle is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01..0x0F || reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Vehicle is drawn in the depot GUI. &amp;lt;ref&amp;gt;OpenTTD also uses this value with the purchase-list chain (cargotype FF) to determine the gridsize in ship and aircraft depots.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || Vehicle is drawn in the vehicle details GUI. (This includes the refit GUI.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || Vehicle is drawn in the vehicle list.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13..0x1F || reserved for other future GUIs.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Vehicle is drawn in the purchase list. (This includes the autoreplace GUI.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Vehicle is drawn in the exclusive preview GUI or in the advertisement news.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22..0x2F || reserved for other future GUIs with non-purchased vehicles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30..0xFF || reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
The other bytes of variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
The cases 0x20..0x2F are called using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt;-callback, the other cases are called for the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt;- or cargo-specific callbacks. Exception is the the special depot-gridsize call, which uses the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Event&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_START&lt;br /&gt;
| Vehicle leaves station or depot, plane takes off&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_TUNNEL&lt;br /&gt;
| Vehicle enters tunnel&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_BREAKDOWN&lt;br /&gt;
| Vehicle breaks down (not for planes)&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_RUNNING&lt;br /&gt;
| Once per engine tick, but no more than once per vehicle motion&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_TOUCHDOWN&lt;br /&gt;
| Aircraft touches down&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_VISUAL_EFFECT&lt;br /&gt;
| Visual effect is generated (steam plume, diesel smoke, electric spark)&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_RUNNING_16&lt;br /&gt;
| Every 16 engine ticks if in motion&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_STOPPED&lt;br /&gt;
| Every 16 engine ticks if stopped&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_LOAD_UNLOAD&lt;br /&gt;
| Consist loads or unloads cargo&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Sorting_vehicles_in_the_purchase_list&amp;diff=3617</id>
		<title>NML:Sorting vehicles in the purchase list</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Sorting_vehicles_in_the_purchase_list&amp;diff=3617"/>
		<updated>2015-02-24T11:12:35Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Moved from http://newgrf-specs.tt-wiki.net/wiki/NML:Vehicles#Sorting_vehicles_in_the_purchase_list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
Sort block allows arbitrary sorting of vehicles.&lt;br /&gt;
&lt;br /&gt;
 sort(&amp;lt;feature&amp;gt;, [&amp;lt;ID&amp;gt;, &amp;lt;ID&amp;gt;, &amp;lt;ID&amp;gt;...]);&lt;br /&gt;
&lt;br /&gt;
The engines will be sorted in the given order on the position where originally the first element was. Say the original engine sorting is this: A B C D E and you use this code &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sort(FEAT_TRAINS, [D, B, A]);&amp;lt;/code&amp;gt; the final sorting will be this: C D B A E&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Blocks&amp;diff=3616</id>
		<title>NML:Blocks</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Blocks&amp;diff=3616"/>
		<updated>2015-02-24T11:09:00Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Move from http://newgrf-specs.tt-wiki.net/wiki/NML:Vehicles#Sorting_vehicles_in_the_purchase_list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[NML:GRF|GRF]]&lt;br /&gt;
*[[NML:GRF parameters|GRF parameters]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Item|Item]]&lt;br /&gt;
*[[NML:Property|Property]]&lt;br /&gt;
*[[NML:Graphics|Graphics]]&lt;br /&gt;
*[[NML:Livery override|Livery override]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Realsprites|Realsprites]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Recolour sprites|Recolour sprites]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Template|Template]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Spriteset|Spriteset]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Spritegroup|Spritegroup]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Spritelayout|Spritelayout]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Tilelayout|Tilelayout]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Switch|Switch]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Produce|Produce]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Random switch|Random switch]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Cargotable|Cargotable]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Railtypetable|Railtypetable]]&lt;br /&gt;
&lt;br /&gt;
[[NML:If|If/else]]&lt;br /&gt;
&lt;br /&gt;
[[NML:While|While]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Error|Error]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Disable items|Disable items]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Deactivate other NewGRFs|Deactivate other NewGRFs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Testing for other NewGRFs|Testing for other NewGRFs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Overriding vehicles in other NewGRFs|Overriding vehicles in other NewGRFs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Sprite replacement|Sprite replacement]]&lt;br /&gt;
*[[NML:Replace TTD sprites|Replace TTD sprites]]&lt;br /&gt;
*[[NML:Replace new sprites|Replace new sprites]]&lt;br /&gt;
*[[NML:Add font glyphs|Add font glyphs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Alternative sprites|Alternative (32bpp) sprites]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Town names|Town names]]&lt;br /&gt;
*[[NML:Town names parts|Town names parts]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Snow line|Snow line]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Parameter assignment|Parameter assignment]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Setting base costs|Setting base costs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Sorting vehicles in the purchase list|Sorting vehicles in the purchase list]]&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3532</id>
		<title>NML:Builtin functions</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3532"/>
		<updated>2014-07-03T17:13:01Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavExpressions}}&lt;br /&gt;
&lt;br /&gt;
Available builtin functions are&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Function&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| min(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the smallest value&lt;br /&gt;
|-&lt;br /&gt;
| max(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the biggest value&lt;br /&gt;
|-&lt;br /&gt;
| date(&#039;&#039;year&#039;&#039;, &#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| If all values are constants, returns the number of days since year 0. If the year is a variable, the month and day should be 1.&lt;br /&gt;
|-&lt;br /&gt;
| day_of_year(&#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| Return the day of the year since January 1st. Both values must be compile-time constants.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask(&#039;&#039;bitpos1&#039;&#039;, ...)&lt;br /&gt;
| Compose an integer by switching the bits at the given positions on.&lt;br /&gt;
|-&lt;br /&gt;
| STORE_TEMP(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| STORE_PERM(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in permanent storage (industries, airports, towns only). Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_TEMP(&#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Get value from temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_PERM(&#039;&#039;address [, grfid]&#039;&#039;)&lt;br /&gt;
| Get value from permanent storage (industries, airports, towns only). For towns only, specifying a grfid (4-byte string, optional) allows reading the storage of other grfs. Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| hasbit(&#039;&#039;value&#039;&#039;, &#039;&#039;bit_num&#039;&#039;)&lt;br /&gt;
| Test whether a bit in a value is on&lt;br /&gt;
|-&lt;br /&gt;
| version_openttd(&#039;&#039;major&#039;&#039;, &#039;&#039;minor&#039;&#039;, &#039;&#039;revision&#039;&#039;[, &#039;&#039;build&#039;&#039;])&lt;br /&gt;
| Return the constant representing an OpenTTD version&lt;br /&gt;
|-&lt;br /&gt;
| cargotype_available(&#039;&#039;cargotype&#039;&#039;)&lt;br /&gt;
| Check if a certain cargo type is available in this game. &#039;&#039;cargotype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_available(&#039;&#039;railtype&#039;&#039;)&lt;br /&gt;
| Check if a railtype is available in this game. &#039;&#039;railtype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_current_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| 1 if the given GRF is currently active 0, otherwise. If &#039;&#039;mask&#039;&#039; is set, only the bits set in the mask will be tested. Both parameters must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_future_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether the grf will become active instead of whether it&#039;s currently active.&lt;br /&gt;
|-&lt;br /&gt;
| grf_order_behind(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether current grf will become active in the order behind the referenced grf.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered(&#039;&#039;effect&#039;&#039;, &#039;&#039;offset&#039;&#039;, &#039;&#039;powered&#039;&#039;&lt;br /&gt;
| Helper function for the train property visual_effect_and_powered and the VEH_CB_VISUAL_EFFECT_AND_POWERED callback.&lt;br /&gt;
|-&lt;br /&gt;
| str2number(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Interpret the given string as a dword and return the value as integer.&lt;br /&gt;
|-&lt;br /&gt;
| cargotype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given cargo type in the cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| railtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given railtype in the railtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| reserve_sprites(&#039;&#039;number of sprites&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Reserve a number of sprites in the TTD sprite range. This is needed if you want to use your own recolour sprites. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[10] = reserve_sprites(1);&lt;br /&gt;
 replace(param[10]) {&lt;br /&gt;
 	recolour_sprite {&lt;br /&gt;
 		// your colour remap.&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 spritelayout xyz {&lt;br /&gt;
 	building {&lt;br /&gt;
 		...&lt;br /&gt;
 		recolour: param[10];&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| int(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Converts v1 to an int. This is done by cutting off everything after the decimal point.&lt;br /&gt;
|-&lt;br /&gt;
| abs(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Return the absolute value of v1.&lt;br /&gt;
|-&lt;br /&gt;
| acos / asin / atan / cos / sin / tan&lt;br /&gt;
| Standard trigonometric functions.&lt;br /&gt;
|-&lt;br /&gt;
| CMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as signed values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| UCMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as unsigned values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| rotate(&#039;&#039;value, amount&#039;&#039;)&lt;br /&gt;
| Rotates &#039;&#039;value&#039;&#039; to the right &#039;&#039;amount&#039;&#039; steps. This is always a 32 bits rotation.&lt;br /&gt;
|-&lt;br /&gt;
| sound(&#039;&#039;soundfile[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from .wav-file &#039;&#039;soundfile&#039;&#039; into the grf file and return its numeric ID. Including a file multiple times will not cause it to be duplicated. Loaded sound files must be in WAV format, PCM encoding:&lt;br /&gt;
* mono&lt;br /&gt;
* 8-bit or {{ottdp|1.0|no}} 16-bit&lt;br /&gt;
* 11025 Hz, 22050 Hz or 44100 Hz.&lt;br /&gt;
&#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| import_sound(&#039;&#039;grfid, id[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from a different grf file. &#039;&#039;grfid&#039;&#039; refers to the grf-file to import the sound from. &#039;&#039;id&#039;&#039; is the zero-based internal ID of the sound within the other grf-file. &#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| relative_coord(&#039;&#039;x, y&#039;&#039;)&lt;br /&gt;
| Returns the coordinates in &#039;&#039;0xYYXX&#039;&#039; format. x and y must be in the [0, 255] range.&lt;br /&gt;
|-&lt;br /&gt;
| num_corners_raised(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the number of corners raised in a slope. Return value is 0 .. 3 for normal slopes and 4 for steep ones. See also [[NML:List of tile slopes|here]] for more information about slopes. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| slope_to_sprite_offset(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the sprite offset corresponding to a given slope. Return value is in range 0 .. 18. See also [[NML:List of tile slopes|here]] for more information about slopes. The section on [[NML:Spritelayout|spritelayouts]] contains some more information one possible uses, as well as an example. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| palette_1cc(&#039;&#039;colour&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 1cc palette for the given company colour, see [[NML:List_of_default_colour_translation_palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| palette_2cc(&#039;&#039;colour1&#039;&#039;, &#039;&#039;colour2&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 2cc palette for the given first and second company colour, see [[NML:List_of_default_colour_translation_palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&lt;br /&gt;
| Returns the curvature state of a vehicle, given the direction differences between the (previous-current) and (current-next) vehicle pairs. For use with the vehicle variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| format_string(&#039;&#039;format&#039;&#039;, args)&lt;br /&gt;
| Use the python string formatting functions to create a literal string. Keep in mind that the output is a literal string which cannot be used by string(). This function can however be used to create filenames.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3531</id>
		<title>NML:Builtin functions</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3531"/>
		<updated>2014-07-03T17:10:43Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavExpressions}}&lt;br /&gt;
&lt;br /&gt;
Available builtin functions are&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Function&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| min(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the smallest value&lt;br /&gt;
|-&lt;br /&gt;
| max(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the biggest value&lt;br /&gt;
|-&lt;br /&gt;
| date(&#039;&#039;year&#039;&#039;, &#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| If all values are constants, returns the number of days since year 0. If the year is a variable, the month and day should be 1.&lt;br /&gt;
|-&lt;br /&gt;
| day_of_year(&#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| Return the day of the year since January 1st. Both values must be compile-time constants.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask(&#039;&#039;bitpos1&#039;&#039;, ...)&lt;br /&gt;
| Compose an integer by switching the bits at the given positions on.&lt;br /&gt;
|-&lt;br /&gt;
| STORE_TEMP(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| STORE_PERM(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in permanent storage (industries, airports, towns only). Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_TEMP(&#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Get value from temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_PERM(&#039;&#039;address [, grfid]&#039;&#039;)&lt;br /&gt;
| Get value from permanent storage (industries, airports, towns only). For towns only, specifying a grfid (4-byte string, optional) allows reading the storage of other grfs. Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| hasbit(&#039;&#039;value&#039;&#039;, &#039;&#039;bit_num&#039;&#039;)&lt;br /&gt;
| Test whether a bit in a value is on&lt;br /&gt;
|-&lt;br /&gt;
| version_openttd(&#039;&#039;major&#039;&#039;, &#039;&#039;minor&#039;&#039;, &#039;&#039;revision&#039;&#039;[, &#039;&#039;build&#039;&#039;])&lt;br /&gt;
| Return the constant representing an OpenTTD version&lt;br /&gt;
|-&lt;br /&gt;
| cargotype_available(&#039;&#039;cargotype&#039;&#039;)&lt;br /&gt;
| Check if a certain cargo type is available in this game. &#039;&#039;cargotype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_available(&#039;&#039;railtype&#039;&#039;)&lt;br /&gt;
| Check if a railtype is available in this game. &#039;&#039;railtype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_current_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| 1 if the given GRF is currently active 0, otherwise. If &#039;&#039;mask&#039;&#039; is set, only the bits set in the mask will be tested. Both parameters must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_future_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether the grf will become active instead of whether it&#039;s currently active.&lt;br /&gt;
|-&lt;br /&gt;
| grf_order_behind(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether current grf will become active in the order behind the referenced grf.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered(&#039;&#039;effect&#039;&#039;, &#039;&#039;offset&#039;&#039;, &#039;&#039;powered&#039;&#039;&lt;br /&gt;
| Helper function for the train property visual_effect_and_powered and the VEH_CB_VISUAL_EFFECT_AND_POWERED callback.&lt;br /&gt;
|-&lt;br /&gt;
| str2number(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Interpret the given string as a dword and return the value as integer.&lt;br /&gt;
|-&lt;br /&gt;
| cargotype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given cargo type in the cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| railtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given railtype in the railtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| reserve_sprites(&#039;&#039;number of sprites&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Reserve a number of sprites in the TTD sprite range. This is needed if you want to use your own recolour sprites. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[10] = reserve_sprites(1);&lt;br /&gt;
 replace(param[10]) {&lt;br /&gt;
 	recolour_sprite {&lt;br /&gt;
 		// your colour remap.&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 spritelayout xyz {&lt;br /&gt;
 	building {&lt;br /&gt;
 		...&lt;br /&gt;
 		recolour: param[10];&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| int(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Converts v1 to an int. This is done by cutting off everything after the decimal point.&lt;br /&gt;
|-&lt;br /&gt;
| abs(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Return the absolute value of v1.&lt;br /&gt;
|-&lt;br /&gt;
| acos / asin / atan / cos / sin / tan&lt;br /&gt;
| Standard trigonometric functions.&lt;br /&gt;
|-&lt;br /&gt;
| CMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as signed values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| UCMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as unsigned values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| rotate(&#039;&#039;value, amount&#039;&#039;)&lt;br /&gt;
| Rotates &#039;&#039;value&#039;&#039; to the right &#039;&#039;amount&#039;&#039; steps. This is always a 32 bits rotation.&lt;br /&gt;
|-&lt;br /&gt;
| sound(&#039;&#039;soundfile[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from .wav-file &#039;&#039;soundfile&#039;&#039; into the grf file and return its numeric ID. Including a file multiple times will not cause it to be duplicated. Loaded sound files must be in WAV format, PCM encoding:&lt;br /&gt;
* mono&lt;br /&gt;
* 8-bit or {{ottdp|1.0|no}} 16-bit&lt;br /&gt;
* 11025 Hz, 22050 Hz or 44100 Hz.&lt;br /&gt;
&#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| import_sound(&#039;&#039;grfid, id[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from a different grf file. &#039;&#039;grfid&#039;&#039; refers to the grf-file to import the sound from. &#039;&#039;id&#039;&#039; is the zero-based internal ID of the sound within the other grf-file. &#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| relative_coord(&#039;&#039;x, y&#039;&#039;)&lt;br /&gt;
| Returns the coordinates in &#039;&#039;0xYYXX&#039;&#039; format. x and y must be in the [0, 255] range.&lt;br /&gt;
|-&lt;br /&gt;
| num_corners_raised(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the number of corners raised in a slope. Return value is 0 .. 3 for normal slopes and 4 for steep ones. See also [[NML:List of tile slopes|here]] for more information about slopes. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| slope_to_sprite_offset(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the sprite offset corresponding to a given slope. Return value is in range 0 .. 18. See also [[NML:List of tile slopes|here]] for more information about slopes. The section on [[NML:Spritelayout|spritelayouts]] contains some more information one possible uses, as well as an example. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| palette_1cc(&#039;&#039;colour&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 1cc palette for the given company colour, see [[NML:List default colour translation palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| palette_2cc(&#039;&#039;colour1&#039;&#039;, &#039;&#039;colour2&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 2cc palette for the given first and second company colour, see [[NML:List default colour translation palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&lt;br /&gt;
| Returns the curvature state of a vehicle, given the direction differences between the (previous-current) and (current-next) vehicle pairs. For use with the vehicle variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| format_string(&#039;&#039;format&#039;&#039;, args)&lt;br /&gt;
| Use the python string formatting functions to create a literal string. Keep in mind that the output is a literal string which cannot be used by string(). This function can however be used to create filenames.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3530</id>
		<title>NML:GRF</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3530"/>
		<updated>2014-06-26T19:12:47Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: Required - according to nmlc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== GRF block ==&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
 grf {&lt;br /&gt;
 	grfid: &amp;amp;lt;literal-string&amp;amp;gt;;&lt;br /&gt;
 	name: &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 	desc: &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 	version: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 	min_compatible_version: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 	[url: &amp;amp;lt;string&amp;amp;gt;;]&lt;br /&gt;
 	[param { ... }]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Mind: the items enclosed in [...] indicate optional lines: The [] itself are not part of the syntax.&lt;br /&gt;
&lt;br /&gt;
Concerning the choice of the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt;, see [[Action8#GRFID|these]] guidelines&lt;br /&gt;
&lt;br /&gt;
== GRF parameters ==&lt;br /&gt;
&lt;br /&gt;
As part of the grf block you can specify some parameter settings that the user will be able to change as part of the newgrf configuration. These can for example be used to disable parts of your NewGRF or to change between multiple graphics in case that&#039;s not possible at runtime. In general the settings (sub-)block looks like&lt;br /&gt;
&lt;br /&gt;
 param &amp;amp;lt;num&amp;amp;gt; {&lt;br /&gt;
 	&amp;amp;lt;name&amp;amp;gt; {&lt;br /&gt;
 		type:    &amp;amp;lt;type&amp;amp;gt;;&lt;br /&gt;
 		name:    &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 		desc:    &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 		min_value: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 		max_value: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 		def_value: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 		bit: &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
 		names: {&lt;br /&gt;
 			0: &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 			1: &amp;amp;lt;string&amp;amp;gt;;&lt;br /&gt;
 			.&lt;br /&gt;
 			.&lt;br /&gt;
 			.&lt;br /&gt;
 		};&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Looking at the single entries:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;num&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional, you can specify in which param number this setting should be stored.&lt;br /&gt;
&lt;br /&gt;
 type&lt;br /&gt;
&lt;br /&gt;
This defines the parameter type. Possible values are &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bool&amp;lt;/code&amp;gt; for on/off statements or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;int&amp;lt;/code&amp;gt; for positive integer values&lt;br /&gt;
&lt;br /&gt;
 name&lt;br /&gt;
&lt;br /&gt;
This gives the parameter name as shown in the parameter configuration dialogue of OpenTTD.&lt;br /&gt;
&lt;br /&gt;
 desc&lt;br /&gt;
&lt;br /&gt;
This gives the description which is displayed when the parameter is selected. Here you can explain the meaning and impact it will have&lt;br /&gt;
&lt;br /&gt;
 min_value&lt;br /&gt;
&lt;br /&gt;
The minimum acceptable value for the parameter (only valid for type int), default of min_value is 0&lt;br /&gt;
&lt;br /&gt;
 max_value&lt;br /&gt;
&lt;br /&gt;
The maximum acceptable value for the parameter (only valid for type int), default of max_value = 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
 def_value&lt;br /&gt;
&lt;br /&gt;
This sets the default value for this parameter. If left out, the default value of 0 will be used.&lt;br /&gt;
&lt;br /&gt;
 bit&lt;br /&gt;
&lt;br /&gt;
Only valid for settings with type &amp;quot;bool&amp;quot;. The value is the bit in which this setting should be stored.&lt;br /&gt;
&lt;br /&gt;
 names&lt;br /&gt;
&lt;br /&gt;
If you chose type &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;int&amp;lt;/code&amp;gt; and the numbers themselves are only used internally, have no direct numerical meaning and are better explained in words, you can use this to associate the single numbers with a string which describes it and is shown to the user instead of the value.&lt;br /&gt;
&lt;br /&gt;
== A simple example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=example&amp;gt;&lt;br /&gt;
 grf {&lt;br /&gt;
 	grfid: &amp;quot;AB\03\02&amp;quot;;&lt;br /&gt;
 	name: string(STR_GRF_NAME);&lt;br /&gt;
 	desc: string(STR_GRF_DESC);&lt;br /&gt;
	url: string(STR_GRF_URL);&lt;br /&gt;
 	version: 1;&lt;br /&gt;
 	min_compatible_version: 0;&lt;br /&gt;
 	param {&lt;br /&gt;
 		param_provide {&lt;br /&gt;
 			type:    int;&lt;br /&gt;
 			name:    string(STR_PARAM_PROVIDE);&lt;br /&gt;
 			desc:    string(STR_PARAM_PROVIDE_DESC);&lt;br /&gt;
 			min_value: 0;&lt;br /&gt;
 			max_value: 1;&lt;br /&gt;
 			def_value: 0;&lt;br /&gt;
 			names: {&lt;br /&gt;
 				0: string(STR_PARAM_PROVIDE_ENGINES_AND_WAGONS);&lt;br /&gt;
 				1: string(STR_PARAM_PROVIDE_WAGONS_ONLY);&lt;br /&gt;
 			};&lt;br /&gt;
 		}&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action8&amp;diff=3517</id>
		<title>Action8</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action8&amp;diff=3517"/>
		<updated>2014-06-23T18:00:59Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Define GRFID, Name and Description&lt;br /&gt;
&lt;br /&gt;
There are many new graphic sets available to TTD players. Of course, we need to make sure that we never get sets mixed up. To make sure this will never happen you can set an ID. Another useful feature of Action 8 is the ability to include useful information into the final .grf file. Here, we explain how Action 8 works.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Like all other pseudo-sprites, Action 8 consists of hexadecimal bits. There is no limitation in the total amount of hexadecimal bits you can use in Action 8. One term does have a limit though. Let&#039;s give an example of what an Action 8 line looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;sprite-number&amp;gt; * &amp;lt;length&amp;gt; 08 &amp;lt;version&amp;gt; &amp;lt;grf-id&amp;gt; &amp;lt;name&amp;gt; &amp;lt;description&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a short overview of what every term means:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes in the action&lt;br /&gt;
|-&lt;br /&gt;
|08||B||Action 08&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;version&amp;gt;||B||GRF version&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;grf-id&amp;gt;||4*B||A unique ID for your .grf file&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;name&amp;gt;||S||A short text containing the name of this set&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;description&amp;gt;||S||A longer description of this set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
The number of this sprite.&lt;br /&gt;
&lt;br /&gt;
Action 8 has to be one of the first pseudosprites in the .NFO file. It is however valid to have other actions before it, except those that define new sprites or vehicle (etc.) properties.&lt;br /&gt;
&lt;br /&gt;
Actions 6, 7, 9, B, C, D (except [[GRFResourceManagement|resource management]] sprites), 10 and 14 are valid before an action 8.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
The total number of bytes in Action 8.&lt;br /&gt;
&lt;br /&gt;
=== GRF Version ===&lt;br /&gt;
&lt;br /&gt;
This should be the graphics version that your file is written for. This is the version of the [[Version_numbers#GRF_version|GRF format]], not the [[Version_numbers#Version_of_a_specific_NewGRF|version of your GRF]]!&lt;br /&gt;
It is also not the &amp;quot;[[Version_numbers#NFO_version|NFO version]]&amp;quot; you put at the top of &amp;quot;.nfo&amp;quot; files to announce the used syntax for GRFCodec.&lt;br /&gt;
&lt;br /&gt;
Valid values are:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;!!&#039;&#039;&#039;Compatibility&#039;&#039;&#039;!!&#039;&#039;&#039;[[Version_numbers#TTDPatch_version|TTDPatch version]]&#039;&#039;&#039;!!&#039;&#039;&#039;[[Version_numbers#OpenTTD_version|OpenTTD support]]&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08||02..08|| - || {{ottd|1.2|r23159}}&lt;br /&gt;
|-&lt;br /&gt;
|07||02..07||2.5 beta 1 or higher|| {{ottd|0.6}}&lt;br /&gt;
|-&lt;br /&gt;
|06||02..06||2.0.1 alpha 13 or higher|| {{ottd|0.6}}&lt;br /&gt;
|-&lt;br /&gt;
|05||02..05||2.0r1 Stable TTDPatch + TTDPatch 2.0.1 alphas up to 12|| {{ottd|0.6}}&lt;br /&gt;
|-&lt;br /&gt;
|04||02..04||2.0 Stable TTDPatch||{{ottd|0.6}}&lt;br /&gt;
|-&lt;br /&gt;
|01||00..01||1.9.1 alpha 28 or higher||{{ottd|no}}&lt;br /&gt;
|-&lt;br /&gt;
|00||00||1.9.1 alphas up to 27||{{ottd|no}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entries for 00 and 01 are included only for completeness, and to aid with updating existing graphics. They should not be used with new graphics, because they will be incompatible with current TTDPatch and OpenTTD versions. OpenTTD 1.1.0 and later will disable NewGRFs with non-supported GRF versions.&lt;br /&gt;
&lt;br /&gt;
Make sure to set a version number no lower than the minimum version that supports all features which are used by your file.&lt;br /&gt;
&lt;br /&gt;
The compatibility column means how low a version number is supported by the given TTDPatch version, e.g. TTDPatch 2.0r1 supports graphics files with any version from 02 to 05, but not for example 01 or 06.&lt;br /&gt;
&lt;br /&gt;
Version 07 and 08 introduce a few minor semantic changes to some graphics features, i.e. the file will behave slightly differently depending on whether it&#039;s declared as version 06, 07 or 08. These changes are described in more detail in the pages for the features they affect.&lt;br /&gt;
&lt;br /&gt;
=== GRFID ===&lt;br /&gt;
&lt;br /&gt;
This is a series of 4 bytes. It&#039;s a convention to use the first two bytes for the creator&#039;s initials in ASCII code, e.g. 54 57 for &amp;quot;TW&amp;quot;. The last two bytes should be numbers, typically the first number identifying which of the author&#039;s sets this is, and the second number being a version number. See the next subsection for ranges that are already in use.&lt;br /&gt;
&lt;br /&gt;
In principle, you are free what to use for the GRFID as long as you are sure it is unique, but generally it is best to follow the above guidelines. See the last subsection for locations where to find already used GRFIDs.&lt;br /&gt;
&lt;br /&gt;
Note that GRFIDs starting with FF (i.e. the first byte is FF, such as in FF123456) are reserved for internal purposes and should not be used by regular .grf files. These GRFs can&#039;t be disabled; TTDPatch displays them with a blue flag in the GRF Status Window.&lt;br /&gt;
&lt;br /&gt;
The extra newgrf file, part of OpenTTD base sets, have to have a GRFID starting with FF &amp;quot;OT&amp;quot;.&lt;br /&gt;
See the table below:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!GRFID!!purposes&lt;br /&gt;
|-&lt;br /&gt;
|00 00 00 00||n/a&lt;br /&gt;
|-&lt;br /&gt;
|00 00 00 01 .. FE FF FF FF||normal NewGRFs&lt;br /&gt;
|-&lt;br /&gt;
|FF 00 00 00 .. FF FF FF FF||reserved&lt;br /&gt;
|-&lt;br /&gt;
|FF &amp;quot;OT&amp;quot; 00 .. FF &amp;quot;OT&amp;quot; FF||extra base GRFs&lt;br /&gt;
|-&lt;br /&gt;
|FF &amp;quot;OT&amp;quot; 01|| OpenGFX&lt;br /&gt;
|-&lt;br /&gt;
|FF &amp;quot;OTD&amp;quot;|| OpenTTD (extra) base graphics: openttdd.grf (OpenTTD 0.6 - 1.0)&lt;br /&gt;
|-&lt;br /&gt;
|FF &amp;quot;OTT&amp;quot;|| OpenTTD (extra) base graphics: openttd.grf (OpenTTD &amp;gt;= 1.1)&lt;br /&gt;
|-&lt;br /&gt;
|FF &amp;quot;OTW&amp;quot;|| OpenTTD (extra) base graphics: openttdw.grf (OpenTTD 0.6 - 1.0)&lt;br /&gt;
|-&lt;br /&gt;
|FF FF FF FF|| TTDPatch (extra) base graphics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Used ranges ====&lt;br /&gt;
&lt;br /&gt;
The following table shows ranges of GRFIDs that are in use by several authors of NewGRFs. People choosing new GRFIDs are asked to not use a GRFID that falls within the ranges of one of the following. This list is in no way exhaustive; if you want to claim your own range, please update the table.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Range (hex)!!ASCII!!Usage&lt;br /&gt;
|-&lt;br /&gt;
|43 41 XX XX||C A _ _||OzTrans; older versions of Canadian and some North American sets&lt;br /&gt;
|-&lt;br /&gt;
|44 44 XX XX||D D _ _||Pikkabird; UKRS, NARS, Av8&lt;br /&gt;
|-&lt;br /&gt;
|4A 56 XX XX||J V _ _||juzza1; Various Finnish sets&lt;br /&gt;
|-&lt;br /&gt;
|4F 47 2B XX||O G + _||OpenGFX+ sets&lt;br /&gt;
|-&lt;br /&gt;
|4D 65 XX XX||M e _ _||George; ECS, Long vehicles&lt;br /&gt;
|-&lt;br /&gt;
|6D 62 XX XX||m b _ _||Michael Blunck; DBsetXL, NewStations, MariCo&lt;br /&gt;
|-&lt;br /&gt;
|97 87 XX XX||? ? _ _||OzTrans; newer versions of Canadian sets&lt;br /&gt;
|-&lt;br /&gt;
|F1 25 XX XX||? ? _ _||FIRS Industry Replacement Set&lt;br /&gt;
|-&lt;br /&gt;
|FB FB XX XX||? ? _ _||FooBar; Dutch sets, Transrapid/metro tracks&lt;br /&gt;
|-&lt;br /&gt;
|FF XX XX XX||? _ _ _||System reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Used GRFIDs ====&lt;br /&gt;
&lt;br /&gt;
There are several places that have/show lists of GRFIDs that are definitely in use by someone. Absence of a GRFID in any of these lists is not proof that it is not used though.&lt;br /&gt;
&lt;br /&gt;
* [http://bananas.openttd.org/en/newgrf/] Bananas shows the GRFIDs of all currently active NewGRFs that are distributed by the system&lt;br /&gt;
* [http://grfcrawler.tt-forums.net/index.php?do=search&amp;amp;mode=advanced] GRFCrawler allows one to search on GRFIDs of NewGRFs in its system&lt;br /&gt;
* [http://devs.openttd.org/~rubidium/newgrf.html] OpenTTD generates a list that shows all NewGRFs that were ever used in a multiplayer game&lt;br /&gt;
&lt;br /&gt;
=== Name ===&lt;br /&gt;
This short field should contain the name of the set. See [[GRFActionsDetailed#Strings|GRFActionsDetailed]] for instructions to generate the necessary byte codes, and for restrictions on what characters you may use.&lt;br /&gt;
The name must be short because it should fit on one line of the [[GRFStatusWindow|GRF Status window]].&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
This is a longer description of the set. Typically it contains the name of the author and a copyright notice or other attribution. See [[GRFActionsDetailed#Strings|GRFActionsDetailed]] for instructions to generate the necessary byte codes, and for restrictions on what characters you may use.&lt;br /&gt;
The description may be quite long, but should be short enough to fit in the description part of the [[GRFStatusWindow|GRF Status window]], or a part of it may be cut off.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Below is an example of what a real Action 8 pseudo-sprite could look like.&lt;br /&gt;
&lt;br /&gt;
 1 * 43 &#039;&#039;&#039;08&#039;&#039;&#039; 07 &amp;quot;TW&amp;quot; 01 06 &amp;quot;Tutorial Example&amp;quot; 00 &amp;quot;Changes nothing. Author: A kind person&amp;quot; 00&lt;br /&gt;
&lt;br /&gt;
Let&#039;s clarify it bit by bit. In order to understand what the bits say you could use a hexadecimal editor.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Byte&#039;&#039;&#039;!!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|1||&amp;lt;sprite-number&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|43||&amp;lt;length&amp;gt; of the action in bytes; start counting at 08 (&amp;lt;action&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|08||&amp;lt;action&amp;gt;: sets this pseudo-sprite to function as action 8&lt;br /&gt;
|-&lt;br /&gt;
|07||&amp;lt;version&amp;gt;: GRF format version 7 (this is the version of the used GRF format, not of your GRF)&lt;br /&gt;
|-&lt;br /&gt;
|54 57 01 06||&amp;lt;-grf-id&amp;gt;: ASCII code for TW, then the numbers 1 and 6 to indicate version 6 of TW&#039;s first set&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;Tutorial...&amp;quot; 00||&amp;lt;name&amp;gt;: Name of the NewGRF&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;Changes...&amp;quot; 00||&amp;lt;description&amp;gt;: Description of the NewGRF&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3472</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3472"/>
		<updated>2013-11-03T09:47:58Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List of rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
Example of a two-way path semaphore with a red light:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
0x00040100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3446</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3446"/>
		<updated>2013-10-11T07:04:04Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: /* Railtype callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List or rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions, and also with path signals, if the &amp;quot;Show reserved tracks&amp;quot; option is enabled in the game settings.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
Example of a two-way path semaphore with a red light:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
0x00040100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3445</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3445"/>
		<updated>2013-10-11T07:01:01Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: /* Railtype callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List or rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions and with PBS.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
Example of a two-way path semaphore with a red light:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
0x00040100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Error&amp;diff=3442</id>
		<title>NML:Error</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Error&amp;diff=3442"/>
		<updated>2013-09-18T13:02:33Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
The general form of an error statement is:&lt;br /&gt;
&lt;br /&gt;
 error(level, message[, extra_text[, parameter1[, parameter2]]]);&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
* &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt; is the severity of the message and one of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NOTICE, WARNING, ERROR, FATAL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Severity!!Meaning!!Prefix!!Action taken&lt;br /&gt;
|-&lt;br /&gt;
|NOTICE||Notice||(none)||continue loading grf file&lt;br /&gt;
|-&lt;br /&gt;
|WARNING||Warning||&amp;quot;Warning: &amp;quot;||continue loading grf file&lt;br /&gt;
|-&lt;br /&gt;
|ERROR||Error||&amp;quot;Error: &amp;quot;||continue loading grf file&lt;br /&gt;
|-&lt;br /&gt;
|FATAL||Fatal error||&amp;quot;Error: &amp;quot;||abort loading of grf file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; can be either a user-defined string or it can be one of the pre-defined strings which already have translations. The first {STRING}-code will always be replaced by the NewGRF name. The second {STRING}-code (if present) will be replaced by the value of &amp;lt;code&amp;gt;extra_text&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_text&amp;lt;/code&amp;gt; can be a string defined in the language files or it can be a literal string, in which case it cannot be translated. You should only use a literal string in those cases where you are sure it doesn&#039;t have to be translated, for example to provide a version string like &amp;quot;0.7.0&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;parameter1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parameter2&amp;lt;/code&amp;gt; are numeric parameters than can have any value, these can be used in the string using {COMMA}-codes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! actual text&lt;br /&gt;
! Contents of extra_text&lt;br /&gt;
|-&lt;br /&gt;
| REQUIRES_TTDPATCH&lt;br /&gt;
| &amp;quot;{STRING} requires at least TTDPatch version {STRING}&amp;quot;&lt;br /&gt;
| version string&lt;br /&gt;
|-&lt;br /&gt;
| REQUIRES_DOS_WINDOWS&lt;br /&gt;
| &amp;quot;{STRING} is for the {STRING} version of TTD.&amp;quot;&lt;br /&gt;
| [DOS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; Windows] Palette type&lt;br /&gt;
|-&lt;br /&gt;
| USED_WITH&lt;br /&gt;
| &amp;quot;{STRING} is designed to be used with {STRING}&amp;quot;&lt;br /&gt;
| switchname + value, e.g. &amp;quot;multihead 0&amp;quot;. This is designed to be used for incompatible settings that you can check via ttdpatch_flags.&lt;br /&gt;
|-&lt;br /&gt;
| INVALID_PARAMETER&lt;br /&gt;
| &amp;quot;Invalid parameter for {STRING}: parameter {STRING} ({COMMA})&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;extra_text&amp;lt;/code&amp;gt; should be the parameter number written out as string. {COMMA} is replaced by the value of &amp;lt;code&amp;gt;parameter1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MUST_LOAD_BEFORE&lt;br /&gt;
| &amp;quot;{STRING} must be loaded before {STRING}.&amp;quot;&lt;br /&gt;
| NewGRF name of the other grf&lt;br /&gt;
|-&lt;br /&gt;
| MUST_LOAD_AFTER&lt;br /&gt;
| &amp;quot;{STRING} must be loaded after {STRING}.&amp;quot;&lt;br /&gt;
| NewGRF name of the other grf&lt;br /&gt;
|-&lt;br /&gt;
| REQUIRES_OPENTTD&lt;br /&gt;
| &amp;quot;{STRING} requires OpenTTD version {STRING} or better.&amp;quot;&lt;br /&gt;
| version string&lt;br /&gt;
|-&lt;br /&gt;
| string(STR_MY_ERROR_MESSAGE)&lt;br /&gt;
| (user-defined string)&lt;br /&gt;
| The message-string can use the code {STRING} up to 2 times, the first usage will be replaced by the NewGRF name and the second usage by &amp;lt;code&amp;gt;extra_text&amp;lt;/code&amp;gt;. After 2 {STRING}-codes you can include up to 2 {COMMA}-codes that will be replaced by the contents of &amp;lt;code&amp;gt;parameter1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;parameter2&amp;lt;/code&amp;gt;. See also the note below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 error(NOTICE, USED_WITH, string(STR_REGRESSION_CARE));&lt;br /&gt;
 error(FATAL, string(STR_REGRESSION_ERROR), string(STR_ANSWER), 14, param[1] + 12 * param[2]);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that only the following combinations of string codes are valid in custom strings:&lt;br /&gt;
* {STRING}&lt;br /&gt;
* {STRING}{STRING}&lt;br /&gt;
* {STRING}{STRING}{COMMA}&lt;br /&gt;
* {STRING}{STRING}{COMMA}{COMMA}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3441</id>
		<title>NML:General</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3441"/>
		<updated>2013-09-18T10:45:28Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==General variables==&lt;br /&gt;
&lt;br /&gt;
A number of global variables are available. Some are only available in switch-blocks, while others can be used in any expression. This is indicated by the second column in the following table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Available outside switch blocks&lt;br /&gt;
! Value range&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttd_platform&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PLATFORM_TTDPATCH&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PLATFORM_OPENTTD&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttdpatch_version&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;openttd_version&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;version_openttd(MAJOR, MINOR, BUILD)&amp;lt;/code&amp;gt; to test and compare for a release version and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;version_openttd(MAJOR, MINOR, BUILD, REVISION)&amp;lt;/code&amp;gt; to test for a specific svn version of OpenTTD&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_palette&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PALETTE_DOS&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PALETTE_WIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| days since year 0&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date(year, month, day)&amp;lt;/code&amp;gt; to compare with.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_month&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 11&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_day_of_month&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 30&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_day_of_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 364 (365 in leap years)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;is_leapyear&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date_loaded&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| days since year 0&lt;br /&gt;
| Set to the time of game load, which is the current date in single player, and the date the server started in multiplayer. This to prevent desyncs.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;year_loaded&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| years since year 0&lt;br /&gt;
| See &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date_loaded&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;starting_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| years since year 0&lt;br /&gt;
| Years before 1920 are clamped to 1920&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;animation_counter&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| Increased by 1 each tick&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;climate&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange&amp;gt;The value of these variables can change during the game. Reading them from a switch block (which reads the current value) may result in a different value than in the rest of the code (which is evaluated when the game is loaded).&amp;lt;/ref&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;CLIMATE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TEMPERATE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ARCTIC&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TROPICAL&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TOYLAND&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;game_mode&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;GAMEMODE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MENU&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;GAME&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EDITOR&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;loading_stage&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;LOADING_STAGE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;INITIALIZE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;RESERVE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ACTIVATE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TEST&amp;lt;/code&amp;gt;]&lt;br /&gt;
| &#039;Phase&#039; of the GRF loading process.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;difficulty_level&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange /&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DIFFICULTY_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EASY&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MEDIUM&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;HARD&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;CUSTOM&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;display_options&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| bitmask of &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISPLAY_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TOWN_NAMES&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;STATION_NAMES&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;SIGNS&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ANIMATION&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FULL_DETAIL&amp;lt;/code&amp;gt;]&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;hasbit(display_options, DISPLAY_XXX)&amp;lt;/code&amp;gt; to test a particular bit.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;desert_paved_roads&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite&amp;gt;These variables can be written as well as read. Use a normal assignment, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 traininfo_y_offset = -2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| If 1, desert roads have pavement and street lights.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;train_width_32_px&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite /&amp;gt;&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| If 1, train vehicles are 32 instead of 29 pixels wide in the depot view.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;traininfo_y_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite /&amp;gt;&lt;br /&gt;
| -128 .. 127&lt;br /&gt;
| Used to correctly position the depot view of trains.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;snowline_height&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.2}} 16 .. 120 in steps of 8, or 0xFF if no snow.&lt;br /&gt;
{{nml|0.3}} 0..max_tile_height, or 0xFF if no snow.&lt;br /&gt;
| {{nml|0.2}} One tile height is equivalent to 8 units.&lt;br /&gt;
{{nml|0.3}} It&#039;s the height in tiles.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;traffic_side&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange /&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TRAFFIC_SIDE_LEFT&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TRAFFIC_SIDE_RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;freight_trains&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 1 .. 255&lt;br /&gt;
| Weight multiplier for freight trains&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;plane_speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 1 .. 4&lt;br /&gt;
| Speed multiplier for planes. Value of 1 is equal to the original speed (1/4), while 4 means that planes move at full speed (4/4)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttdpatch_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_callback&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
| Set to the ID of the current callback, useful for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| Varies&lt;br /&gt;
| Extra callback information, meaning differs per callback.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| Varies&lt;br /&gt;
| Extra callback information, meaning differs per callback.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;last_computed_result&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
| Result of the last (previously evaluated) switch block.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_2cc&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| Base sprite for 2cc (dual company colour) colour-maps&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_foundations&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for foundations. This sprite block does only contain the extra foundations from [[NML:Replace_new_sprites| replacenew]] type &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FOUNDATIONS_SLOPES_HALFTILES&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FOUNDATIONS_SLOPES&amp;lt;/code&amp;gt;. It does not contain the default foundations of sprites 990 to 1003 (via replace)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_shores&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for shores. All coast sprites in the order of the [[Action5#0D_Coast_tile_sprites|16 sprites version]] of [[NML:Replace_new_sprites| replacenew]] type &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;COAST_TILES&amp;lt;/code&amp;gt;. Note that, it does not matter in which way the sprites were originally defined (whether via replacenew with 10 or 16 sprites, or via replace). The sprite block returned by this variable has always all sprites in the same order.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MAP_TYPE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;RECTANGULAR&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;X_BIGGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;Y_BIGGER&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_min_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the smallest map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_max_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the biggest map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_x_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the x (top-left) map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_y_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the y (top-right) map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_size&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64*64 .. 2048*2048&lt;br /&gt;
| Total number of tiles on the map&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;long_bridges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;gradual_loading&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bridge_speed_limits&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;signals_on_traffic_side&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;electrified_railways&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;unified_maglev&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 .. 3 {{ottd|}} Always 3&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;temperate_snowline&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dynamic_engines&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variable_runningcosts&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newtrains&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newrvs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newships&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newplanes&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newhouses&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newindustries&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newcargos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3440</id>
		<title>NML:General</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3440"/>
		<updated>2013-09-18T10:44:56Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==General variables==&lt;br /&gt;
&lt;br /&gt;
A number of global variables are available. Some are only available in switch-blocks, while others can be used in any expression. This is indicated by the second column in the following table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Available outside switch blocks&lt;br /&gt;
! Value range&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttd_platform&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PLATFORM_TTDPATCH&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PLATFORM_OPENTTD&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttdpatch_version&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;openttd_version&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;version_openttd(MAJOR, MINOR, BUILD)&amp;lt;/code&amp;gt; to test and compare for a release version and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;version_openttd(MAJOR, MINOR, BUILD, REVISION)&amp;lt;/code&amp;gt; to test for a specific svn version of OpenTTD&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_palette&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PALETTE_DOS&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;PALETTE_WIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| days since year 0&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date(year, month, day)&amp;lt;/code&amp;gt; to compare with.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 5000000 (years since year 0)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_month&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 11&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_day_of_month&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 30&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_day_of_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 364 (365 in leap years)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;is_leapyear&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date_loaded&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| days since year 0&lt;br /&gt;
| Set to the time of game load, which is the current date in single player, and the date the server started in multiplayer. This to prevent desyncs.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;year_loaded&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| years since year 0&lt;br /&gt;
| See &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date_loaded&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;starting_year&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| years since year 0&lt;br /&gt;
| Years before 1920 are clamped to 1920&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;animation_counter&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| Increased by 1 each tick&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;climate&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange&amp;gt;The value of these variables can change during the game. Reading them from a switch block (which reads the current value) may result in a different value than in the rest of the code (which is evaluated when the game is loaded).&amp;lt;/ref&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;CLIMATE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TEMPERATE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ARCTIC&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TROPICAL&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TOYLAND&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;game_mode&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;GAMEMODE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MENU&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;GAME&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EDITOR&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;loading_stage&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;LOADING_STAGE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;INITIALIZE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;RESERVE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ACTIVATE&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TEST&amp;lt;/code&amp;gt;]&lt;br /&gt;
| &#039;Phase&#039; of the GRF loading process.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;difficulty_level&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange /&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DIFFICULTY_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EASY&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MEDIUM&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;HARD&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;CUSTOM&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;display_options&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| bitmask of &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISPLAY_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TOWN_NAMES&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;STATION_NAMES&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;SIGNS&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ANIMATION&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FULL_DETAIL&amp;lt;/code&amp;gt;]&lt;br /&gt;
| Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;hasbit(display_options, DISPLAY_XXX)&amp;lt;/code&amp;gt; to test a particular bit.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;desert_paved_roads&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite&amp;gt;These variables can be written as well as read. Use a normal assignment, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 traininfo_y_offset = -2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| If 1, desert roads have pavement and street lights.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;train_width_32_px&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite /&amp;gt;&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| If 1, train vehicles are 32 instead of 29 pixels wide in the depot view.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;traininfo_y_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=readwrite /&amp;gt;&lt;br /&gt;
| -128 .. 127&lt;br /&gt;
| Used to correctly position the depot view of trains.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;snowline_height&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.2}} 16 .. 120 in steps of 8, or 0xFF if no snow.&lt;br /&gt;
{{nml|0.3}} 0..max_tile_height, or 0xFF if no snow.&lt;br /&gt;
| {{nml|0.2}} One tile height is equivalent to 8 units.&lt;br /&gt;
{{nml|0.3}} It&#039;s the height in tiles.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;traffic_side&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes &amp;lt;ref name=gamechange /&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TRAFFIC_SIDE_LEFT&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;TRAFFIC_SIDE_RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;freight_trains&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 1 .. 255&lt;br /&gt;
| Weight multiplier for freight trains&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;plane_speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 1 .. 4&lt;br /&gt;
| Speed multiplier for planes. Value of 1 is equal to the original speed (1/4), while 4 means that planes move at full speed (4/4)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ttdpatch_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;current_callback&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
| Set to the ID of the current callback, useful for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| Varies&lt;br /&gt;
| Extra callback information, meaning differs per callback.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
| Varies&lt;br /&gt;
| Extra callback information, meaning differs per callback.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;last_computed_result&amp;lt;/code&amp;gt;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
| Result of the last (previously evaluated) switch block.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_2cc&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| Base sprite for 2cc (dual company colour) colour-maps&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_foundations&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for foundations. This sprite block does only contain the extra foundations from [[NML:Replace_new_sprites| replacenew]] type &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FOUNDATIONS_SLOPES_HALFTILES&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;FOUNDATIONS_SLOPES&amp;lt;/code&amp;gt;. It does not contain the default foundations of sprites 990 to 1003 (via replace)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;base_sprite_shores&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 65535&lt;br /&gt;
| {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for shores. All coast sprites in the order of the [[Action5#0D_Coast_tile_sprites|16 sprites version]] of [[NML:Replace_new_sprites| replacenew]] type &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;COAST_TILES&amp;lt;/code&amp;gt;. Note that, it does not matter in which way the sprites were originally defined (whether via replacenew with 10 or 16 sprites, or via replace). The sprite block returned by this variable has always all sprites in the same order.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;MAP_TYPE_XXX&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;XXX&amp;lt;/code&amp;gt; = [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;RECTANGULAR&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;X_BIGGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;Y_BIGGER&amp;lt;/code&amp;gt;]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_min_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the smallest map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_max_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the biggest map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_x_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the x (top-left) map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_y_edge&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64 .. 2048&lt;br /&gt;
| Length of the y (top-right) map edge (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;map_size&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 64*64 .. 2048*2048&lt;br /&gt;
| Total number of tiles on the map&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;long_bridges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;gradual_loading&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bridge_speed_limits&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;signals_on_traffic_side&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;electrified_railways&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;unified_maglev&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 .. 3 {{ottd|}} Always 3&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;temperate_snowline&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dynamic_engines&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 or 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variable_runningcosts&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newtrains&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newrvs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newships&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newplanes&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newhouses&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newindustries&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;newcargos&amp;lt;/code&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ttdp|}} 0 or 1 {{ottd|}} Always 1&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3439</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3439"/>
		<updated>2013-09-13T14:47:15Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List or rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions and PBS.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
Example of a two-way path semaphore with a red light:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
0x00040100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3438</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3438"/>
		<updated>2013-09-09T03:01:59Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: /* signals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List or rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions and PBS.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 02 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 03 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 04 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 05 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 01 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
Example of a two-way path semaphore with a red light:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
0x00050100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3433</id>
		<title>NML:Railtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3433"/>
		<updated>2013-09-06T18:37:43Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: /* Railtype callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Railtypes can only be defined in OpenTTD {{ottd|1.0|r18969}} or later. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Railtype IDs==&lt;br /&gt;
Railtype IDs are limited to 16 in total. NewGRF-local IDs may freely be chosen, but must be in the 0..15 range. If other railtype GRFs are loaded, it may be that there are not enough railtype slots available. To prevent your entire NewGRF from being deactivated with the &#039;Attempt to use invalid ID&#039;-error, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 if (railtype_available(&amp;quot;LABL&amp;quot;) || loading_stage == LOADING_STAGE_RESERVE)&lt;br /&gt;
     ... item definition ...&lt;br /&gt;
 } else if (loading_stage == LOADING_STAGE_ACTIVATE) {&lt;br /&gt;
     ... warning / error ...&lt;br /&gt;
 }&lt;br /&gt;
The warning / error is optional, but can be used to inform the user about the missing railtypes.&lt;br /&gt;
&lt;br /&gt;
==Railtype properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| 4-byte string&lt;br /&gt;
| names of default rail types: &amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;, &amp;quot;MGLV&amp;quot;. See the [[RailtypeLabels|List of railtype labels]] in the NewGRF Specs for currently defined custom labels.&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date(yyyy,mm,dd)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} Valid range for yyyy is 0 ... 5000000.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this railtype&lt;br /&gt;
|-&lt;br /&gt;
| toolbar_caption&lt;br /&gt;
| string&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=23129}} Caption of the build rail toolbar. In earlier versions this is the same as the &#039;name&#039;&lt;br /&gt;
|-&lt;br /&gt;
| menu_text&lt;br /&gt;
| string&lt;br /&gt;
| Shown in the dropdown menu for all railtypes&lt;br /&gt;
|-&lt;br /&gt;
| build_window_caption&lt;br /&gt;
| string&lt;br /&gt;
| Caption of the build vehicle window&lt;br /&gt;
|-&lt;br /&gt;
| autoreplace_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the autoreplace window&lt;br /&gt;
|-&lt;br /&gt;
| new_engine_text&lt;br /&gt;
| string&lt;br /&gt;
| String for the &amp;quot;We have invented a new &amp;amp;lt;rail type&amp;amp;gt; engine&amp;quot; news message&lt;br /&gt;
|-&lt;br /&gt;
| compatible_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type can also run on. e.g. [&amp;quot;RAIL&amp;quot;, &amp;quot;ELRL&amp;quot;, &amp;quot;MONO&amp;quot;]&lt;br /&gt;
|-&lt;br /&gt;
| powered_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
| Provide a list of rail types that trains of this type are powered on.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_flags&lt;br /&gt;
| bitmask(RAILTYPE_FLAG_XXX, ...)&lt;br /&gt;
| XXX = [CATENARY &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NO_LEVEL_CROSSING] Flags enable catenary and/or disable level crossings.&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_multiplier&lt;br /&gt;
| 0...65525&lt;br /&gt;
| max curve speed is defined as multiple of the base curve speed (see below)&lt;br /&gt;
|-&lt;br /&gt;
| station_graphics&lt;br /&gt;
| RAILTYPE_STATION_NORMAL, RAILTYPE_STATION_MONORAIL, RAILTYPE_STATION_MAGLEV&lt;br /&gt;
| Type of station graphics to use for the default stations&lt;br /&gt;
|-&lt;br /&gt;
| construction_cost&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} per piece of track as multiplier to PR_BUILD_RAIL base cost. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| speed_limit&lt;br /&gt;
| 0 ... 65525 km/h (speed units)&lt;br /&gt;
| A speed limit of 0 means unlimited speed&lt;br /&gt;
|-&lt;br /&gt;
| acceleration_model&lt;br /&gt;
| ACC_MODEL_RAIL, ACC_MODEL_MONORAIL, ACC_MODEL_MAGLEV&lt;br /&gt;
| ACC_MODEL_RAIL and ACC_MODEL_MONORAIL behave the same currently&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19307}} entry in the colour palette.&lt;br /&gt;
|-&lt;br /&gt;
| requires_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21842}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| introduces_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21841}} 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.&lt;br /&gt;
|-&lt;br /&gt;
| sort_order&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21866}} number which defines the sort order among rail types. If this entry is not defined, it gets assigned sort order n*10+7 for the n-th railtype.&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for each piece of tracks of this railtype. Default cost factors are 8, 12, 16 and 24 for RAIL, ELRL, MONO and MGLV.&lt;br /&gt;
|-&lt;br /&gt;
| alternative_railtype_list&lt;br /&gt;
| list of railtype labels&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23758}} List or rail types which this rail type will act as fallback for, if the corresponding rail type is not defined separately&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sort order===&lt;br /&gt;
&lt;br /&gt;
The sort_order influences the sort order of the drop down lists with rail types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Value&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| normal rail&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| electrified rail&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| monorail&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| maglev&lt;br /&gt;
|-&lt;br /&gt;
| n7&lt;br /&gt;
| railtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Base speeds for curves===&lt;br /&gt;
&lt;br /&gt;
The base speeds relevant for the curve_speed_multiplier are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! curve length&lt;br /&gt;
! base speed [km/h]&lt;br /&gt;
|-&lt;br /&gt;
| 0 (90 degree turn)&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 44&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 66&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 75&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 84&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 91&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 98&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 103&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 108&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 111&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 114&lt;br /&gt;
|-&lt;br /&gt;
| 12+&lt;br /&gt;
| 115&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| enhanced_tunnels&lt;br /&gt;
| 0&lt;br /&gt;
| should custom tunnel entrances be modified other values than 0 might be returned&lt;br /&gt;
|-&lt;br /&gt;
| level_crossing_status&lt;br /&gt;
| LEVEL_CROSSING_CLOSED, LEVEL_CROSSING_OPEN&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0 .. 5000000&lt;br /&gt;
| for depots only: build date of the depot in days since 0&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| Town zone of the tile. (Only available for level crossings and depots.) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Railtype callbacks==&lt;br /&gt;
&lt;br /&gt;
For rail types a number of callbacks are used to define rail type graphics. Each should refer to a sprite set containing the relevant sprites. Refer to the [[#Example sprites|example sprites]] or the example railtype grf in the NML repository, for an example on what sprites are needed in what order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callbacks&lt;br /&gt;
! number of sprites&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| gui&lt;br /&gt;
| 16&lt;br /&gt;
| 4 rail directions, autorail, depot, tunnel and convert rail sprites for rail menu.&lt;br /&gt;
|-&lt;br /&gt;
| track_overlay&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| 6 flat and 4 slope sprites. Track without landscape. Used in junctions and PBS.&lt;br /&gt;
|-&lt;br /&gt;
| underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 16&lt;br /&gt;
| 6 flat and 4 slope, one crossing WITH track, 5 junction pieces without track. Tracks with ballast but without landscape.&lt;br /&gt;
|-&lt;br /&gt;
| tunnels&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| 1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE.&lt;br /&gt;
|-&lt;br /&gt;
| catenary_wire&lt;br /&gt;
| 28&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| catenary_pylons&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bridge_surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| level_crossings&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
| 10&lt;br /&gt;
| For each direction: one track sprite and 4 sprites for road lights etc&lt;br /&gt;
|-&lt;br /&gt;
| depots&amp;lt;ref name=depotr22854&amp;gt;{{ottd|1.2|r22854}} In OpenTTD prior to r22854, depot sprites would not be used if the above &#039;all or none&#039; sprites were not supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 6&lt;br /&gt;
| 2 sprites for each south-ish, 1 sprite for each north-ish depot. Like original depots.&lt;br /&gt;
|-&lt;br /&gt;
| fences&lt;br /&gt;
| 8&lt;br /&gt;
| x, y, vertical, horizontal, SW, SE, NE and NW slopes like original fences at sprite 1301.&lt;br /&gt;
|-&lt;br /&gt;
| tunnel_overlay&amp;lt;ref name=tunnel_overlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
| If this callback is defined, tunnels for this railtype will be drawn differently. First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (tunnel_overlay). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites. &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 0 for normal tunnels, without any extra features (like tracks above). All other values are reserved for future extensions.&lt;br /&gt;
|-&lt;br /&gt;
| signals&lt;br /&gt;
| 8&lt;br /&gt;
| {{ottd|1.3|r24367}} 1 sprite for each direction, order is SW(-facing), NE, SE, NW, E, W, S, N. For more information, see [[#signals|below]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
If a callback is not implemented or fails, graphics from the fallback railtype (picked via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;station_graphics&amp;lt;/code&amp;gt; property) will be used instead.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that there is no &amp;quot;default graphics&amp;quot;-callback.&lt;br /&gt;
&lt;br /&gt;
===Example sprites===&lt;br /&gt;
==== gui ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== track_overlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_overlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== underlay ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== level_crossings ====&lt;br /&gt;
&lt;br /&gt;
You can define a special track piece which crosses the road and for each of two directions and each of the corners of the tile a separate sprite for a light, sign, or whatever should go there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Sprite number for X&lt;br /&gt;
!Sprite number for Y&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Rail overlay&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;North light&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;East light&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;7&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;West light&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;9&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;South light&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_levelcrossing.png]]&lt;br /&gt;
&lt;br /&gt;
==== depots ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== fences ====&lt;br /&gt;
&lt;br /&gt;
[[File:railtype_fences.png]]&lt;br /&gt;
&lt;br /&gt;
==== tunnel_overlay ====&lt;br /&gt;
&lt;br /&gt;
If this callback is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the &#039;tunnels&#039;-sprite. Next, train sprites if applicable and then a grass overlay and finally the sprite from this callback. The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
==== signals ====&lt;br /&gt;
&lt;br /&gt;
This callback can be used to supply custom signal graphics.&lt;br /&gt;
&lt;br /&gt;
The resulting sprite set must consist of 8 sprites, corresponding to the following signal directions: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. Variable &amp;lt;code style:darkgreen&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains information about the kind of signal to be drawn. If resolving fails or results in an empty sprite group, the matching base set sprite will be used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format of extra_callback_info2:&#039;&#039;&#039; 0xRRTTVVSS&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! TT: Signal type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal block signal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Entry pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Exit pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Combo pre-signal&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Two-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| 5 || One-way path signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! VV: Signal variant !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Light (electric) signal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Semaphore&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! SS: Signal state !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Red signal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Green signal&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The most significant byte (RR) is reserved and must be and-masked out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; can be used to distinguish between map and GUI sprites:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Signal is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Signal is drawn in the signal GUI. The returned sprite set must still have 8 sprites, but OpenTTD will only use the 7th sprite, so all other sprites can be empty.&lt;br /&gt;
|-&lt;br /&gt;
| all other values || Reserved&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of &amp;lt;code style:darkgreen&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example code===&lt;br /&gt;
&lt;br /&gt;
A typical implementation for railtypes can look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_RAILTYPES, elrail, 0x01) {&lt;br /&gt;
     property {&lt;br /&gt;
         label:                      &amp;quot;SHIN&amp;quot;;&lt;br /&gt;
         name:                       string(STR_EL_RAIL);&lt;br /&gt;
         menu_text:                  string(STR_EL_RAIL);&lt;br /&gt;
         build_window_caption:       string(STR_BUILD_CAPTION);&lt;br /&gt;
         autoreplace_text:           string(STR_AUTOREPLACE);&lt;br /&gt;
         new_engine_text:            string(STR_NEW_ENGINE);&lt;br /&gt;
         compatile_railtype_list:    [&amp;quot;SHIN&amp;quot;,&amp;quot;RAIL&amp;quot;,&amp;quot;ELRL&amp;quot;];                   // Tracks of rail and electrified rail are compatible&lt;br /&gt;
         powered_railtype_list:      [&amp;quot;ELRL&amp;quot;,&amp;quot;SHIN&amp;quot;];                          // But we got only power when we have electricity&lt;br /&gt;
         railtype_flags:             bitmask(RAILTYPE_FLAG_NO_LEVEL_CROSSING); // High speed tracks should not have level crossings&lt;br /&gt;
         curve_speed_multiplier:     1;&lt;br /&gt;
         station_graphics:           RAILTYPE_STATION_MAGLEV;                  // We want the most modern stations&lt;br /&gt;
         construction_cost:          32;                                       // should be pretty steep&lt;br /&gt;
         speed_limit:                500 km/h;&lt;br /&gt;
         acceleration_model:         ACC_MODEL_RAIL;                           // This is still rail, though&lt;br /&gt;
     }&lt;br /&gt;
     graphics {&lt;br /&gt;
         track_overlay:   ground_switch_overlay;     // defines the sprites drawn as overlay for junctions and highlight&lt;br /&gt;
         underlay:        ground_switch_underlay;    // defines the usual tracks and the underlay for junctions&lt;br /&gt;
         level_crossings: level_crossing_switch;     // defines level crossings including traffic lights and blocking bars&lt;br /&gt;
         tunnels:         tunnel_switch;             // defines the tracks drawn on a funnel tile&lt;br /&gt;
         depots:          depot_switch_electric;     // defines the depot sprites&lt;br /&gt;
         bridge_surfaces: bridge_terrain_switch;     // defines the overlay drawn over bridges&lt;br /&gt;
         fences:          fences_set;                // defines the look of fences&lt;br /&gt;
         // we don&#039;t define catenery wire and pylons, thus we use the default which comes with the base graphics.&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The switches and graphics blocks are defined in the usual way as described in sections [[NML:Switch|switches]], [[NML:Random switch|random switches]] and [[NML:Graphics|graphics block]] sections.&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Parameter_assignment&amp;diff=3425</id>
		<title>NML:Parameter assignment</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Parameter_assignment&amp;diff=3425"/>
		<updated>2013-08-26T13:23:41Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
 param[&amp;amp;lt;expression&amp;amp;gt;] = &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Set a parameter to the given [[NML:Block syntax#Syntax|expression]]. Neither of the two expressions has to be constant, the following is perfectly valid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[param[2] + 1] = param[3] * param[4];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3378</id>
		<title>NML:Builtin functions</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3378"/>
		<updated>2013-05-15T11:43:30Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavExpressions}}&lt;br /&gt;
&lt;br /&gt;
Available builtin functions are&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Function&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| min(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the smallest value&lt;br /&gt;
|-&lt;br /&gt;
| max(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the biggest value&lt;br /&gt;
|-&lt;br /&gt;
| date(&#039;&#039;year&#039;&#039;, &#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| If all values are constants, returns the number of days since year 0. If the year is a variable, the month and day should be 1.&lt;br /&gt;
|-&lt;br /&gt;
| day_of_year(&#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| Return the day of the year since January 1st. Both values must be compile-time constants.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask(&#039;&#039;bitpos1&#039;&#039;, ...)&lt;br /&gt;
| Compose an integer by switching the bits at the given positions on.&lt;br /&gt;
|-&lt;br /&gt;
| STORE_TEMP(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| STORE_PERM(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in permanent storage (industries, airports, towns only). Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_TEMP(&#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Get value from temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_PERM(&#039;&#039;address [, grfid]&#039;&#039;)&lt;br /&gt;
| Get value from permanent storage (industries, airports, towns only). For towns only, specifying a grfid (4-byte string, optional) allows reading the storage of other grfs. Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| hasbit(&#039;&#039;value&#039;&#039;, &#039;&#039;bit_num&#039;&#039;)&lt;br /&gt;
| Test whether a bit in a value is on&lt;br /&gt;
|-&lt;br /&gt;
| version_openttd(&#039;&#039;major&#039;&#039;, &#039;&#039;minor&#039;&#039;, &#039;&#039;revision&#039;&#039;[, &#039;&#039;build&#039;&#039;])&lt;br /&gt;
| Return the constant representing an OpenTTD version&lt;br /&gt;
|-&lt;br /&gt;
| cargotype_available(&#039;&#039;cargotype&#039;&#039;)&lt;br /&gt;
| Check if a certain cargo type is available in this game. &#039;&#039;cargotype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_available(&#039;&#039;railtype&#039;&#039;)&lt;br /&gt;
| Check if a railtype is available in this game. &#039;&#039;railtype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_current_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| 1 if the given GRF is currently active 0, otherwise. If &#039;&#039;mask&#039;&#039; is set, only the bits set in the mask will be tested. Both parameters must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_future_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether the grf will become active instead of whether it&#039;s currently active.&lt;br /&gt;
|-&lt;br /&gt;
| grf_order_behind(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether current grf will become active in the order behind the referenced grf.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered(&#039;&#039;effect&#039;&#039;, &#039;&#039;offset&#039;&#039;, &#039;&#039;powered&#039;&#039;&lt;br /&gt;
| Helper function for the train property visual_effect_and_powered and the VEH_CB_VISUAL_EFFECT_AND_POWERED callback.&lt;br /&gt;
|-&lt;br /&gt;
| str2number(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Interpret the given string as a dword and return the value as integer.&lt;br /&gt;
|-&lt;br /&gt;
| cargotype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given cargo type in the cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| railtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given railtype in the railtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| reserve_sprites(&#039;&#039;number of sprites&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Reserve a number of sprites in the TTD sprite range. This is needed if you want to use your own recolour sprites. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[10] = reserve_sprites(1);&lt;br /&gt;
 replace(param[10]) {&lt;br /&gt;
 	recolour_sprite {&lt;br /&gt;
 		// your colour remap.&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 spritelayout xyz {&lt;br /&gt;
 	building {&lt;br /&gt;
 		...&lt;br /&gt;
 		recolour: param[10];&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| int(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Converts v1 to an int. This is done by cutting off everything after the decimal point.&lt;br /&gt;
|-&lt;br /&gt;
| abs(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Return the absolute value of v1.&lt;br /&gt;
|-&lt;br /&gt;
| acos / asin / atan / cos / sin / tan&lt;br /&gt;
| Standard trigonometric functions.&lt;br /&gt;
|-&lt;br /&gt;
| CMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as signed values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| UCMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as unsigned values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| rotate(&#039;&#039;value, amount&#039;&#039;)&lt;br /&gt;
| Rotates &#039;&#039;value&#039;&#039; to the right &#039;&#039;amount&#039;&#039; steps. This is always a 32 bits rotation.&lt;br /&gt;
|-&lt;br /&gt;
| sound(&#039;&#039;soundfile[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from .wav-file &#039;&#039;soundfile&#039;&#039; into the grf file and return its numeric ID. Including a file multiple times will not cause it to be duplicated. Loaded sound files must be 8 or 16-bit mono sound files in WAV format, PCM encoding. There are three allowed frequencies: 11025 Hz, 22050 Hz and 44100 Hz. &#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| import_sound(&#039;&#039;grfid, id[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from a different grf file. &#039;&#039;grfid&#039;&#039; refers to the grf-file to import the sound from. &#039;&#039;id&#039;&#039; is the zero-based internal ID of the sound within the other grf-file. &#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| relative_coord(&#039;&#039;x, y&#039;&#039;)&lt;br /&gt;
| Returns the coordinates in &#039;&#039;0xYYXX&#039;&#039; format. x and y must be in the [0, 255] range.&lt;br /&gt;
|-&lt;br /&gt;
| num_corners_raised(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the number of corners raised in a slope. Return value is 0 .. 3 for normal slopes and 4 for steep ones. See also [[NML:List of tile slopes|here]] for more information about slopes. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| slope_to_sprite_offset(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the sprite offset corresponding to a given slope. Return value is in range 0 .. 18. See also [[NML:List of tile slopes|here]] for more information about slopes. The section on [[NML:Spritelayout|spritelayouts]] contains some more information one possible uses, as well as an example. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| palette_1cc(&#039;&#039;colour&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 1cc palette for the given company colour, see [[List default colour translation palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| palette_2cc(&#039;&#039;colour1&#039;&#039;, &#039;&#039;colour2&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 2cc palette for the given first and second company colour, see [[List default colour translation palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&lt;br /&gt;
| Returns the curvature state of a vehicle, given the direction differences between the (previous-current) and (current-next) vehicle pairs. For use with the vehicle variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| format_string(&#039;&#039;format&#039;&#039;, args)&lt;br /&gt;
| Use the python string formatting functions to create a literal string. Keep in mind that the output is a literal string which cannot be used by string(). This function can however be used to create filenames.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3374</id>
		<title>NML:Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3374"/>
		<updated>2013-05-07T08:42:50Z</updated>

		<summary type="html">&lt;p&gt;Juzza1: /* Variables without parameter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
== Vehicle IDs ==&lt;br /&gt;
Picking an item ID requires keeping two cases in mind: OpenTTD with the engine pool enabled and OpenTTD with engine pool disabled / TTDPatch. The status of the engine pool may be checked with the global variable [[NML:General#General_variables|dynamic_engines]].&lt;br /&gt;
&lt;br /&gt;
=== Engine pool enabled ===&lt;br /&gt;
With the engine pool enabled, each NewGRF has its own ID range, NewGRFs don&#039;t influence each other. IDs may freely be chosen between 0 and 65535. If the chosen ID belongs to an existing vehicle, this vehicle is overridden by your vehicle. If another NewGRF is already overriding that vehicle, a new vehicle will be allocated, but all the properties will be copied from the old vehicle. If you define an ID for which no original vehicle exists, a new (blank) vehicle is allocated.&lt;br /&gt;
&lt;br /&gt;
This behaviour can be modified using an [[NML:Overriding_vehicles_in_other_NewGRFs|engine_override]], this allows changing the properties of vehicles defined in other NewGRFs instead of allocating a new vehicle.&lt;br /&gt;
&lt;br /&gt;
=== TTDPatch / Engine pool disabled ===&lt;br /&gt;
Each new vehicle has to replace an existing vehicle. If multiple NewGRFs try to replace the same vehicle, the last NewGRF loaded &#039;wins&#039;. [[VehicleIDs|This page]] contains a list of valid vehicle IDs for each vehicle type, look in the &#039;NML ID&#039; column. Note that IDs are not bound to a specific sort of vehicle (e.g. monorail wagons) but to a feature (e.g. trains, road vehicles).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general, you should take the following steps:&lt;br /&gt;
* If your NewGRF is intended as a complete replacement for the default vehicles, disable the relevant default vehicles using [[NML:Disable_items|disable_item]].&lt;br /&gt;
* Re-use IDs of existing vehicles as much as possible.&lt;br /&gt;
* If your NewGRF uses IDs outside of the normal range (for example, because you there are more vehicles than slots available), let your code check if dynamic_engies is enabled. If not, skip the vehicles outside the normal range (using an if-statement) and make sure that the remaining vehicles allow for reasonable gameplay. It is recommended to issue a warning to the user about this. Alternatively, it is also possible to disable your entire NewGRF. If you don&#039;t do this check and dynamic_engines is off, OpenTTD may disable your NewGRF with the somewhat cryptic message &#039;Attempt to use invalid ID&#039;, which will likely lead to bug reports about your NewGRF and/or your OpenTTD.&lt;br /&gt;
&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
| (string)&lt;br /&gt;
| yes&lt;br /&gt;
| for example &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;string(STR_NAME_HEREFORD_TRAM)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;climates_available&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(CLIMATE_XXX, CLIMATE_YYY, ...)&lt;br /&gt;
| set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
;CLIMATE_TEMPERATE&lt;br /&gt;
;CLIMATE_ARCTIC&lt;br /&gt;
;CLIMATE_TROPICAL&lt;br /&gt;
;CLIMATE_TOYLAND&lt;br /&gt;
;NO_CLIMATE&lt;br /&gt;
:Vehicle is availble in no climate (e.g. for articulated parts)&lt;br /&gt;
;ALL_CLIMATES&lt;br /&gt;
:Vehicle is available irrespective of climate&lt;br /&gt;
&lt;br /&gt;
To make a vehicle available in all climates except toyland you could use: &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES &amp;amp;amp; ~bitmask(CLIMATE_TOYLAND)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date&amp;lt;/code&amp;gt;(yyyy,mm,dd)&lt;br /&gt;
| no&lt;br /&gt;
| Valid range for yyyy is 0 ... 5000000. In TTDPatch, dates after 2044 will be limited to 2044. Unless the engine is introduced within two years after game-start (always 1920 in TTDPatch), a random number of days between 0 and 511 will be added to this.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 254 (years) or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
Number of years a model is &amp;quot;supported&amp;quot; by the manufacturer, see [[#Engine life cycle|below]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127 (years)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
Retire the vehicle (make it unavailable in the purchase menu) this many years before reliability starts dropping, see [[#Engine life cycle|below]]. May be negative.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;vehicle_life&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 (years)&lt;br /&gt;
| no&lt;br /&gt;
| Life length of an individual vehicle, before it is considered too old and in need of replacement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;reliability_decay&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| Default vehicles use 20. The higher the value the faster reliability decays, the more frequent service is needed. 0 means reliability never decreases if the vehicle is not too old&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refittable_cargo_classes&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
bit set of [[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
| yes&lt;br /&gt;
| for example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_BULK, CC_COVERED)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;non_refittable_cargo_classes&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
bit set of [[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
| yes&lt;br /&gt;
| for example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_OVERSIZED, CC_SPECIAL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refittable_cargo_types&amp;lt;/code&amp;gt;&lt;br /&gt;
| bit mask of entries into the cargo translation table&lt;br /&gt;
| yes&lt;br /&gt;
| As of NML 0.3, do not use this. Use cargo_[dis]allow_refit (see below) instead.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_allow_refit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23291}} A list of cargo types to allow refitting to, irrespective of cargo classes. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;[COAL, IORE]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_disallow_refit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Yes&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23291}} A list of cargo types to disallow refitting to, irrespective of cargo classes. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;[MAIL]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;loading_speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 (cargo units)&lt;br /&gt;
| yes&lt;br /&gt;
| Units of cargo loaded per time unit. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft. This amount of cargo is loaded to or unloaded from the vehicle every 40 ticks for trains, every 20 ticks for road vehicles and aircraft and every 10 ticks for ships.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cost_factor&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Set to 0&lt;br /&gt;
| multiplier to the base purchase cost&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_factor&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Set to 0&lt;br /&gt;
| multiplier to the base running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_age_period&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22713}} This property specifies after how many ticks cargo is aged. Default value is 185. 74 ticks is equal to 1 day.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Refittability===&lt;br /&gt;
&lt;br /&gt;
To determine whether your vehicle can be refitted to a certain cargo, OpenTTD uses the following table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Cargo matches refittable_cargo_classes&lt;br /&gt;
! Cargo matches non_refittable_cargo_classes&lt;br /&gt;
! Cargo in cargo_allow_refit&lt;br /&gt;
! Cargo in cargo_disallow_refit&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For those that prefer boolean logic, the formula is as follows:&lt;br /&gt;
&lt;br /&gt;
refittable = ((cargo classes in refittable_cargo_classes AND NOT cargo classes in non_refittable_cargo_classes) OR cargo in cargo_allow_refit) AND NOT (cargo in cargo_disallow_refit)&lt;br /&gt;
&lt;br /&gt;
In general, you should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only then use cargo_allow_refit and cargo_disallow_refit to allow/disallow specific cargos.&lt;br /&gt;
&lt;br /&gt;
===Engine life cycle===&lt;br /&gt;
&lt;br /&gt;
The life cycle of a vehicle model consists of three phases, as outlined in the following table.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! phase&lt;br /&gt;
! duration&lt;br /&gt;
! reliability&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 7 to 38 months&lt;br /&gt;
| increases from 48-73% to 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; - 8 years&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.5 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Sorting vehicles in the purchase list==&lt;br /&gt;
This is a special property that is not encoded in an item/property-block like most other properties but it has it&#039;s own block instead. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 sort(&amp;lt;feature&amp;gt;, [&amp;lt;ID&amp;gt;, &amp;lt;ID&amp;gt;, &amp;lt;ID&amp;gt;...]);&lt;br /&gt;
&lt;br /&gt;
The engines will be sorted in the given order on the position where originally the first element was. Say the original engine sorting is this: A B C D E and you use this code &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sort(FEAT_TRAINS, [D, B, A]);&amp;lt;/code&amp;gt; the final sorting will be this: C D B A E&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sprite_id&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;SPRITE_ID_NEW_TRAIN&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;speed&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
| Max speed for engines, speed limit for wagons&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(TRAIN_FLAG_XXX, ...)&lt;br /&gt;
| FLIP should not be set, TILT and MU TO the same value as the 1st part&lt;br /&gt;
| &lt;br /&gt;
;TRAIN_FLAG_TILT&lt;br /&gt;
: enable the tilt bonus (20% speed in curves, if all vehicles in consist have it set)&lt;br /&gt;
;TRAIN_FLAG_2CC&lt;br /&gt;
:Enable use of the 2nd company colour&lt;br /&gt;
;TRAIN_FLAG_MU&lt;br /&gt;
:act as multiple unit (used for livery selection only)&lt;br /&gt;
;TRAIN_FLAG_FLIP&lt;br /&gt;
:Allow vehicle to be flipped (reversed) in depot&lt;br /&gt;
;TRAIN_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autoreffitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;TRAIN_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| in 50% units of the purchase price cost base&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;callback_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 10 * weight (in tons), with 10 being an approximation of the acceleration of gravity (9.81 m/s). Default value is 0.3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! available for&amp;lt;br /&amp;gt;articulated&amp;lt;br /&amp;gt;vehicle&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_ROADVEH&lt;br /&gt;
| yes&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 ... 514km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(ROADVEH_FLAG_XXX, ...)&lt;br /&gt;
| partly; tram flag must the same&lt;br /&gt;
| &lt;br /&gt;
;ROADVEH_FLAG_TRAM&lt;br /&gt;
:The vehicle requires tram tracks to run on&lt;br /&gt;
;ROADVEH_FLAG_2CC&lt;br /&gt;
:Enable 2nd company colour&lt;br /&gt;
;ROADVEH_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;ROADVEH_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| in 25% units of the purchase price cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_base&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 10 * weight (in tons), with 10 being an approximation of the acceleration of gravity (9.81 m/s). Default value is 0.3.&lt;br /&gt;
|-&lt;br /&gt;
| air_drag_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_SHIP&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 ... 127 km/h (float, speed units)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(SHIP_FLAG_XXX)&lt;br /&gt;
| Bitmask with to possible flags, set to 0 to disable all. &lt;br /&gt;
&lt;br /&gt;
;SHIP_FLAG_2CC&lt;br /&gt;
:Enable use of the 2nd company colour&lt;br /&gt;
;SHIP_FLAG_AUTOREFIT&lt;br /&gt;
:llow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;SHIP_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of the default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| is_refittable&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 0=false, 1=true. Note: if you do not set this property to 1, then refittable_cargo_classes / non_refittable_cargo_classes have no effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| For ships (unlike other vehicle types) the capacity set here is not affected by the cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| sprite_id&lt;br /&gt;
| SPRITE_ID_NEW_AIRCRAFT&lt;br /&gt;
| Set this property to enable new graphics&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| 0 .. 3280 km/h (float, speed units)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| 0 .. 2894&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.2|no|ottdrev=r23504}} Maximum (euclidean) distance the aircraft can cover between two airports. Set to 0 for unlimited range.&lt;br /&gt;
|-&lt;br /&gt;
| misc_flags&lt;br /&gt;
| bitmask(AIRCRAFT_FLAG_2CC, AIRCRAFT_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with to possible flags, set to 0 to disable all. &lt;br /&gt;
&lt;br /&gt;
;AIRCRAFT_FLAG_2CC&lt;br /&gt;
:Enable 2nd company colour&lt;br /&gt;
;AIRCRAFT_FLAG_AUTOREFIT&lt;br /&gt;
:Allow autorefitting. To enable autorefit, furthermore the [[#Vehicle callbacks|refit_cost]]-callback has to allow it, or else (if this callback is not implemented or fails) the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;refit_cost&amp;lt;/code&amp;gt;-property (see below) must be set to 0.&lt;br /&gt;
;AIRCRAFT_FLAG_NO_BREAKDOWN_SMOKE&lt;br /&gt;
:{{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Not that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_refit&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|cargo class]]&lt;br /&gt;
| No&lt;br /&gt;
| cargo class most often refit to&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_consist_info&lt;br /&gt;
| Bitmask 8 bit&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Binary OR of the values of [[#bitmask vehicle info|bitmask_vehicle_info]] of all vehicles (engines, wagons) in the consist. Only available for rail vehicles.&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Yes&lt;br /&gt;
| company number of the vehicle owner. TTDPatch only supports up to 8 companies (0 ... 7)&lt;br /&gt;
|-&lt;br /&gt;
| company_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Yes&lt;br /&gt;
|&lt;br /&gt;
Same as company_colour1, if no 2nd company colour is chosen. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_height&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Height difference between the aircraft and its shadow. 8 Units are equivalent to one height level on the map.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XX&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
;AIRPORTTYPE_SMALL&lt;br /&gt;
;AIRPORTTYPE_LARGE&lt;br /&gt;
;AIRPORTTYPE_HELIPORT&lt;br /&gt;
;AIRPORTTYPE_OILRIG&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_prev_cur&lt;br /&gt;
| -2 ... 2&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the previous (towards engine) vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_cur_next&lt;br /&gt;
| -2 ... 2&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between this vehicle and the next (towards rear end) vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info_prev_next&lt;br /&gt;
| -4 ... 4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the previous (towards engine) and next (towards rear end) vehicle. Curvature to the right is positive. 1 unit is 45 degrees. Equal to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curve_invo_prev_cur + curv_info_cur_next&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| curv_info&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&#039;&#039;&#039;&#039;&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Returns a magic number that represents the curvature state of the prev-cur-next vehicle triplet. Do not try to make sense of this magic number, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;vehicle_curv_info()&amp;lt;/code&amp;gt; instead to make comparisons. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info == vehicle_curv_info(a, b)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;(curv_info_prev_cur == a) &amp;amp;amp;&amp;amp;amp; (curv_info_cur_next == b)&amp;lt;/code&amp;gt;, however the former can easily be used in a switch-block.&lt;br /&gt;
|-&lt;br /&gt;
| motion_counter&lt;br /&gt;
| 0 ... 15&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for animations.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_in_veh&lt;br /&gt;
| entry in cargo translation table&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
| 0xFF if not present in the table&lt;br /&gt;
|-&lt;br /&gt;
| cargo_unit_weight&lt;br /&gt;
| weight per unit in 1/16t&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes&lt;br /&gt;
| Bitmask of [[NML:Cargos#Cargo properties|cargo class]]&lt;br /&gt;
| Yes, for the default cargo&lt;br /&gt;
| class of the currently transported cargo&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_available&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is available on the open market&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_testing&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is currently being tested&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_offered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Yes&lt;br /&gt;
| Value is 1 if the vehicle is currently being offered for exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
| build_year&lt;br /&gt;
| 0 ... 5000000&lt;br /&gt;
| Yes&lt;br /&gt;
| 0-based year when the vehicle was built, current year if the vehicle is not built yet&lt;br /&gt;
|-&lt;br /&gt;
| direction&lt;br /&gt;
| DIRECTION_XX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of direction constants|here]] for an overview of possible values and their meaning.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Cargo capacity (number of units) of the vehicle&lt;br /&gt;
|-&lt;br /&gt;
| cargo_count&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Number of cargo units of cargo in the vehicle&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Cargo subtype, used to provide more than one refit option for the same cargo type. See also the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype_text&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle provides power and is on the correct track type&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_not_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle is either on a wrong track type or it doesn&#039;t provide power at all&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_potentially_powered&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle provides power, if it is on a suitable track type&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_reversed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has reversed an odd number of times&lt;br /&gt;
|-&lt;br /&gt;
| built_during_preview&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle was built during the exclusive preview stage&lt;br /&gt;
|-&lt;br /&gt;
| current_railtype&lt;br /&gt;
| No&lt;br /&gt;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| Don&#039;t use this variable unless you&#039;ve defined a railtype translation table. If the train is running on a railtype that is not listed in your railtype translation table this variable will contain 0xFF. Available since OpenTTD r20164.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Value range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&lt;br /&gt;
The following table contains a list of available vehicle callbacks. Additionally, it&#039;s possible to provide cargo-specific graphics, using the identifier from the [[NML:Cargotable|cargo table]] as callback name. These callbacks will be used if the vehicle is refitted to the corresponding cargo type. If no cargo-specific graphics match the cargo that the vehicle is carrying, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback is used instead. Cargo-specific graphics callbacks are never called from the purchase menu, refer to the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt; callback below instead.&lt;br /&gt;
&lt;br /&gt;
Note that the above affects &#039;&#039;&#039;graphics only&#039;&#039;&#039;, other callbacks are unaffected.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Sprite group&lt;br /&gt;
| &#039;Normal&#039; vehicle graphics, if no cargo-specific graphics apply. See also the section on [[#Sprites in GUI|GUI sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
| Sprite group&lt;br /&gt;
| Graphics to show in the buy menu (only the horizontal view is needed, except for dual-headed trains. With the &amp;lt;code&amp;gt;dual_headed&amp;lt;/code&amp;gt; property set, special rules for the purchase menu sprite apply: two sprites are drawn (for front and back) as if the vehicle is normally constructed. If you supply one purchase menu sprite, it will be used for both vehicle parts in the purchase menu. Provide a set of 8 sprites, and the 7th resp. 3rd sprite will be drawn; provide a set of 8 blank sprites except the 7th if you want to fully control a single purchase menu sprite for a dual-headed engine. ) See also the section on [[#Sprites in GUI|GUI sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| rotor&lt;br /&gt;
| Aircraft (helicopters)&lt;br /&gt;
| No&lt;br /&gt;
| Sprite group&lt;br /&gt;
| Graphics for the helicopter rotor (4 sprites; 1 stopped and 3 moving)&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| N/A&lt;br /&gt;
| See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_text&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| String, or CB_RESULT_NO_TEXT&lt;br /&gt;
| With this callback, you can display extra text after the cargo in the vehicle information window. This callback is called during refitting, with succesively increased values of the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype&amp;lt;/code&amp;gt; variable, until the callback returns CB_RESULT_NO_TEXT. All returned strings are then displayed as refit options. The chosen refit option is saved in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype&amp;lt;/code&amp;gt; variable, so it can be used later for other things. In the HEQS grf for example, this mechanism is used to let the user choose between different capacities of the same vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the purchase list.&lt;br /&gt;
|-&lt;br /&gt;
| colour_mapping&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_colour_mapping&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Recolour sprite number&lt;br /&gt;
|&lt;br /&gt;
With this callback, you can use a different recolour sprite instead of the standard 1cc / 2cc company colour remappings. See [[NML:List of default colour translation palettes|here]] for a list of default palettes. See the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;reserve_sprites()&amp;lt;/code&amp;gt; for info on how to allocate your own sprite. For performance, the result is cached and only updated if the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt; every_32_days&amp;lt;/code&amp;gt; callback requires so. Add CB_RESULT_COLOUR_MAPPING_ADD_CC to the result to add the company colour to the sprites, this requires 16 (1cc) or 256 (2cc) sprites in total.&lt;br /&gt;
|-&lt;br /&gt;
| start_stop&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| Called when starting or stopping a vehicle. Mainly useful to prevent vehicles from leaving the depot unless a certain condition is met. Return CB_RESULT_NO_TEXT to allow or a string (containing an error message) to disallow starting/stopping.&lt;br /&gt;
|-&lt;br /&gt;
| every_32_days&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| bitmask(CB_RESULT_32_DAYS_XXX, ...)&lt;br /&gt;
| Called every 32 days. Set CB_RESULT_32_DAYS_TRIGGER in the bitmask to trigger TRIGGER_VEHICLE_32_CALLBACK. Set CB_RESULT_32_DAYS_COLOUR_MAPPING in the bitmask to update the colour mapping by re-running the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour_mapping&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
| SOUND_XXX, sound(&amp;quot;sound.wav&amp;quot;), import_sound(grfid, number) or CB_RESULT_NO_SOUND&lt;br /&gt;
|&lt;br /&gt;
Called to play various vehicle sounds. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the sound event, see the [[#Sound events|table]] below. Return SOUND_XXX (see [[NML:List_of_sound_effects|here]]) to return a default sound. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sound(&amp;quot;soundfile&amp;quot;)&amp;lt;/code&amp;gt; imports a sound from a .wav file. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; imports a sound from another grf. A failed (or not implemented) callback will cause the default sound to be played. Return CB_RESULT_NO_SOUND to play no sound at all.&lt;br /&gt;
|-&lt;br /&gt;
| articulated_part&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes (no separate callback)&lt;br /&gt;
| Vehicle ID, or CB_RESULT_NO_MORE_ARTICULATED_PARTS&lt;br /&gt;
| With this callback, you can add articulated parts (e.g. tenders) to your vehicle. Called repeatedly, until CB_RESULT_NO_MORE_ARTICULATED_PARTS is returned. After each call, the returned vehicleID is added to your vehicle. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc. Note that callback may be called from the purchase list, using vehicle variables is not possible. Or CB_RESULT_REVERSED_VEHICLE to the returned vehicle ID to display the vehicle backwards. &lt;br /&gt;
&lt;br /&gt;
For NML 0.2 and lower the vehicle ID of the articulated part must be in the range 0 .. 127.&lt;br /&gt;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. This callback has to be defined at the engine. However, variables in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; scope refer to the wagon being attached, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; scope refers to the engine that the wagon is being attached to. Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well. Variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains information about the target cargo type in the format 0xccccsstt, with tt being the new cargo type, ss the new cargo subtype (see &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_subtype_text&amp;lt;/code&amp;gt;-callback) and cccc a bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following callbacks all have an equivalent property. The property description applies here also, except where otherwise noted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Sprites in GUI===&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r23080}} Since OpenTTD r23080 you can use variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; to display different sprites in the GUI and on the map. Currently these cases are available:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of extra_callback_info1 !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Vehicle is drawn in a viewport, i.e. on the map.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01..0x0F || reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Vehicle is drawn in the depot GUI. &amp;lt;ref&amp;gt;OpenTTD also uses this value with the purchase-list chain (cargotype FF) to determine the gridsize in ship and aircraft depots.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || Vehicle is drawn in the vehicle details GUI. (This includes the refit GUI.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || Vehicle is drawn in the vehicle list.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13..0x1F || reserved for other future GUIs.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Vehicle is drawn in the purchase list. (This includes the autoreplace GUI.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Vehicle is drawn in the exclusive preview GUI or in the advertisement news.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22..0x2F || reserved for other future GUIs with non-purchased vehicles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30..0xFF || reserved&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
The other bytes of variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; are reserved, and must be masked.&lt;br /&gt;
The cases 0x20..0x2F are called using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt;-callback, the other cases are called for the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt;- or cargo-specific callbacks. Exception is the the special depot-gridsize call, which uses the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Event&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_START&lt;br /&gt;
| Vehicle leaves station or depot, plane takes off&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_TUNNEL&lt;br /&gt;
| Vehicle enters tunnel&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_BREAKDOWN&lt;br /&gt;
| Vehicle breaks down (not for planes)&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_RUNNING&lt;br /&gt;
| Once per engine tick, but no more than once per vehicle motion&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_TOUCHDOWN&lt;br /&gt;
| Aircraft touches down&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_VISUAL_EFFECT&lt;br /&gt;
| Visual effect is generated (steam plume, diesel smoke, electric spark)&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_RUNNING_16&lt;br /&gt;
| Every 16 engine ticks if in motion&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_STOPPED&lt;br /&gt;
| Every 16 engine ticks if stopped&lt;br /&gt;
|-&lt;br /&gt;
| SOUND_EVENT_LOAD_UNLOAD&lt;br /&gt;
| Consist loads or unloads cargo&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Juzza1</name></author>
	</entry>
</feed>