<?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=Yexo</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=Yexo"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Yexo"/>
	<updated>2026-05-14T09:25:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Tramtypes&amp;diff=4043</id>
		<title>Action0/Tramtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Tramtypes&amp;diff=4043"/>
		<updated>2020-05-20T19:47:51Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Speed limit (14) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Action 0 properties for tram types&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for tram types =&lt;br /&gt;
&lt;br /&gt;
Defining properties of tram types.&lt;br /&gt;
&lt;br /&gt;
Up to 63 tramtypes can be defined.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Size&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|4*B&lt;br /&gt;
|Tram type label&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build tram toolbar caption&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, setting property 09 sets property 1B as well.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Tram construction dropdown text&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build vehicle window caption&lt;br /&gt;
|-&lt;br /&gt;
|0C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Autoreplace text&lt;br /&gt;
|-&lt;br /&gt;
|0D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: New engine text&lt;br /&gt;
|-&lt;br /&gt;
|0F&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Powered tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot;&amp;gt;Tram type labels in this list are &#039;&#039;not&#039;&#039; resolved using the alternate label list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Tram type flags&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Construction costs&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Speed limit&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Minimap colour&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|D&lt;br /&gt;
|Introduction date&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduction required tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduced tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Sort order&lt;br /&gt;
|-&lt;br /&gt;
|1B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Tram type name&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, set property 1B &#039;&#039;after&#039;&#039; setting property 09, as property 09 sets the rail type name as well for backwards compatibility.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Infrastructure maintenance cost factor&lt;br /&gt;
|-&lt;br /&gt;
|1D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D&lt;br /&gt;
|Alternate tram type labels that shall be &amp;quot;redirected&amp;quot; to this tram type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In NFO, tram type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing tram type, specify its label in property 08. To create a new tram type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label &#039;clashes&#039; with another GRF, then one GRF will end up modifying the properties instead of creating a new tram type.&lt;br /&gt;
&lt;br /&gt;
When a new tram type is created, it is populated with the information from the first tram type, except that the powered list contains only the tram type being created. However, no default values should be assumed, as the first tram type may have been modified.&lt;br /&gt;
&lt;br /&gt;
== Vehicle and Tramtype availability ==&lt;br /&gt;
&lt;br /&gt;
Vehicle and tramtype availability and compatibility is influenced by multiple properties.&lt;br /&gt;
Generally, the vehicle defines which tramtype it is, and the tramtypes define the compatibility between each other.&lt;br /&gt;
* A vehicle exists, if its tramtype (road vehicle prop 05) is defined. Otherwise the vehicle is disabled.&lt;br /&gt;
* When a vehicle is introduced, it always introduces its tramtype (road vehicle prop 05).&lt;br /&gt;
* A tramtype is introduced, if at least one of the following conditions is met:&lt;br /&gt;
** A vehicle is introduced, that references the tramtype (road vehicle prop 05).&lt;br /&gt;
** Another tramtype is introduced, that references the tramtype via the introduced tramtype list (tramtype prop 19).&lt;br /&gt;
** The introduction date (tramtype prop 17) is passed and all required tramtypes (tramtype prop 18) are available.&lt;br /&gt;
&lt;br /&gt;
Via tramtype property 1D multiple tramtypes can be defined, which shall be considered equivalent to a tramtype.&lt;br /&gt;
This affects the interpretation of road vehicle property 05. If road vehicle property 05 references an undefined tramtype, then&lt;br /&gt;
tramtype property 1D is checked for all defined tramtypes, whether the vehicle can be reassigned to some other tramtype.&lt;br /&gt;
Otherwise the vehicle is disabled.&lt;br /&gt;
&lt;br /&gt;
== Tram type label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique four-letter identifiers for specific tram types (analoguous to [[Action0Cargos#Cargo label 17|cargo labels]]), used to make various tram types accessible from road vehicle grfs. Reserved labels for default tram types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Label&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Tram Type&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|RAIL &lt;br /&gt;
| Normal Tram&lt;br /&gt;
|-&lt;br /&gt;
|ELRL &lt;br /&gt;
| Electrified Tram&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Tram type sets may use up to 63 tramtypes and have to specify their own [[TramtypeLabels|labels]].&lt;br /&gt;
&lt;br /&gt;
See also [[Action0/Global Settings#Tram type translation table 12|Tram Type Translation Table]] for further info.&lt;br /&gt;
&lt;br /&gt;
== Build tram toolbar caption (09) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the tram type as shown in the toolbar caption.&lt;br /&gt;
&lt;br /&gt;
== Tram construction dropdown text (0A) ==&lt;br /&gt;
&lt;br /&gt;
String ID for text in the dropdown of all tram types.&lt;br /&gt;
&lt;br /&gt;
This string must never start with a colour control code.&lt;br /&gt;
&lt;br /&gt;
== Build vehicle window caption (0B) ==&lt;br /&gt;
&lt;br /&gt;
String ID for build vehicle window caption.&lt;br /&gt;
&lt;br /&gt;
== Autoreplace text (0C) ==&lt;br /&gt;
&lt;br /&gt;
String ID for tram type shown in autoreplace window.&lt;br /&gt;
&lt;br /&gt;
== New engines (0D) ==&lt;br /&gt;
&lt;br /&gt;
StringID to use for showing texts of the type &amp;quot;We have invented a new &amp;amp;lt;tram type&amp;amp;gt; engine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Powered tram type list (0F) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types on which road vehicles of this tram type are powered. E.g. vehicles of &amp;quot;normal tram&amp;quot;-type are powered on &amp;quot;electrified tram&amp;quot;- and &amp;quot;haul-tram&amp;quot;-type as well. Note that there is no &amp;quot;compatible tram type list&amp;quot; since there is no difference between &amp;quot;powered&amp;quot; and &amp;quot;compatible&amp;quot; for tramtypes&lt;br /&gt;
&lt;br /&gt;
The format is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;0E &amp;amp;lt;nvar&amp;amp;gt; (&amp;amp;lt;tram type label&amp;amp;gt;){n}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is you give the number of compatible tram types in a single byte followed by a list of that length of tram type labels. A tram type is automatically powered with itself, so you don&#039;t need to list the current tram type.&lt;br /&gt;
&lt;br /&gt;
Note that these properties apply to road vehicles of this tram type, not the tram itself. If you want road vehicles of other tram types to be able to run on your tram types, you must set the powered tram types property for each tram type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other tram type, you cannot remove poweredness once it is set (by some other grf).&lt;br /&gt;
&lt;br /&gt;
== Tram type flags (10) ==&lt;br /&gt;
&lt;br /&gt;
Flags to define properties related to the tram type:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Draw catenary for this tram type&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|Disallow level crossings for this tram type&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|Disallow construction of houses along tramtype&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|Hide this tram type from construction menu&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|Enables towns to build tramtype, but towns don&#039;t build trams...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Speed limit (14) ==&lt;br /&gt;
&lt;br /&gt;
Speed limit in mph*0.8 (approx. 0.5km/h). Set to &amp;quot;0&amp;quot; for no limit at all.&lt;br /&gt;
&lt;br /&gt;
== Map colour (16) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the colour this tram type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates|DOS palette]].&lt;br /&gt;
&lt;br /&gt;
== Introduction date (17) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the long date formatted introduction date of this tram type. With this property set the tram type will be introduced at (or after) this date when all of the introduction required tram types are available to the company of the player, or whenever a vehicle using this tram type gets introduced whichever is first.&lt;br /&gt;
&lt;br /&gt;
== Introduction required tram type list (18) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types on that need to be available to the company of the player for this tram type to be introduced at (or after) the introduction date. This limit does not apply when the tram type is introduced by the introduction of a vehicle.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
This can, for example, be used to introduce a tram type with catenary when both normal tram and electrified tram types are available.&lt;br /&gt;
&lt;br /&gt;
== Introduced tram type list (19) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types that get introduced when this tram type is introduced. For example, to make sure that when a fast tram type is introduced the slow variant exists.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
== Sort order (1A) ==&lt;br /&gt;
&lt;br /&gt;
Property for influencing the sort order of the drop down lists with tram types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|07&lt;br /&gt;
|Normal Tram&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Electrified Tram&lt;br /&gt;
|-&lt;br /&gt;
|n7&lt;br /&gt;
|Tramtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thus the tram 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;
== Tram type name (1B) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the tram type.&lt;br /&gt;
&lt;br /&gt;
== Alternate tram type labels (1D) ==&lt;br /&gt;
&lt;br /&gt;
A list of alternate labels that get &amp;quot;redirected&amp;quot; to this tram type when used e.g. as tram type of road vehicle or when testing if a label is defined. The redirection only happens if the alternate label isn&#039;t defined as a real tram type. Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
Alternate labels are not considered when evaluating properties 0F, 18, and 19.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
To be written&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Roadtypes&amp;diff=4042</id>
		<title>Action0/Roadtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Roadtypes&amp;diff=4042"/>
		<updated>2020-05-20T19:47:29Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Speed limit (14) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Action 0 properties for road types&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for road types =&lt;br /&gt;
&lt;br /&gt;
Defining properties of road types.&lt;br /&gt;
&lt;br /&gt;
Up to 63 roadtypes can be defined.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Size&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|4*B&lt;br /&gt;
|Road type label&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build road toolbar caption&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, setting property 09 sets property 1B as well.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Road construction dropdown text&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build vehicle window caption&lt;br /&gt;
|-&lt;br /&gt;
|0C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Autoreplace text&lt;br /&gt;
|-&lt;br /&gt;
|0D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: New engine text&lt;br /&gt;
|-&lt;br /&gt;
|0F&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Powered road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot;&amp;gt;Road type labels in this list are &#039;&#039;not&#039;&#039; resolved using the alternate label list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Road type flags&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Construction costs&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Speed limit&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Minimap colour&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|D&lt;br /&gt;
|Introduction date&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduction required road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduced road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Sort order&lt;br /&gt;
|-&lt;br /&gt;
|1B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Road type name&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, set property 1B &#039;&#039;after&#039;&#039; setting property 09, as property 09 sets the rail type name as well for backwards compatibility.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Infrastructure maintenance cost factor&lt;br /&gt;
|-&lt;br /&gt;
|1D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D&lt;br /&gt;
|Alternate road type labels that shall be &amp;quot;redirected&amp;quot; to this road type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In NFO, road type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing road type, specify its label in property 08. To create a new road type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label &#039;clashes&#039; with another GRF, then one GRF will end up modifying the properties instead of creating a new road type.&lt;br /&gt;
&lt;br /&gt;
When a new road type is created, it is populated with the information from the first road type, except that the powered list contains only the road type being created. However, no default values should be assumed, as the first road type may have been modified.&lt;br /&gt;
&lt;br /&gt;
== Vehicle and Roadtype availability ==&lt;br /&gt;
&lt;br /&gt;
Vehicle and roadtype availability and compatibility is influenced by multiple properties.&lt;br /&gt;
Generally, the vehicle defines which roadtype it is, and the roadtypes define the compatibility between each other.&lt;br /&gt;
* A vehicle exists, if its roadtype (road vehicle prop 05) is defined. Otherwise the vehicle is disabled.&lt;br /&gt;
* When a vehicle is introduced, it always introduces its roadtype (road vehicle prop 05).&lt;br /&gt;
* A roadtype is introduced, if at least one of the following conditions is met:&lt;br /&gt;
** A vehicle is introduced, that references the roadtype (road vehicle prop 05).&lt;br /&gt;
** Another roadtype is introduced, that references the roadtype via the introduced roadtype list (roadtype prop 19).&lt;br /&gt;
** The introduction date (roadtype prop 17) is passed and all required roadtypes (roadtype prop 18) are available.&lt;br /&gt;
&lt;br /&gt;
Via roadtype property 1D multiple roadtypes can be defined, which shall be considered equivalent to a roadtype.&lt;br /&gt;
This affects the interpretation of road vehicle property 05. If road vehicle property 05 references an undefined roadtype, then&lt;br /&gt;
roadtype property 1D is checked for all defined roadtypes, whether the vehicle can be reassigned to some other roadtype.&lt;br /&gt;
Otherwise the vehicle is disabled.&lt;br /&gt;
&lt;br /&gt;
== Road type label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique four-letter identifiers for specific road types (analoguous to [[Action0Cargos#Cargo label 17|cargo labels]]), used to make various road types accessible from road vehicle grfs. Reserved labels for default road types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Label&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Road Type&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|ROAD &lt;br /&gt;
| Normal Road&lt;br /&gt;
|-&lt;br /&gt;
|ELRD &lt;br /&gt;
| Electrified Road&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Road type sets may use up to 63 roadtypes and have to specify their own [[RoadtypeLabels|labels]].&lt;br /&gt;
&lt;br /&gt;
See also [[Action0/Global Settings#Road type translation table 12|Road Type Translation Table]] for further info.&lt;br /&gt;
&lt;br /&gt;
== Build road toolbar caption (09) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the road type as shown in the toolbar caption.&lt;br /&gt;
&lt;br /&gt;
== Road construction dropdown text (0A) ==&lt;br /&gt;
&lt;br /&gt;
String ID for text in the dropdown of all road types.&lt;br /&gt;
&lt;br /&gt;
This string must never start with a colour control code.&lt;br /&gt;
&lt;br /&gt;
== Build vehicle window caption (0B) ==&lt;br /&gt;
&lt;br /&gt;
String ID for build vehicle window caption.&lt;br /&gt;
&lt;br /&gt;
== Autoreplace text (0C) ==&lt;br /&gt;
&lt;br /&gt;
String ID for road type shown in autoreplace window.&lt;br /&gt;
&lt;br /&gt;
== New engines (0D) ==&lt;br /&gt;
&lt;br /&gt;
StringID to use for showing texts of the type &amp;quot;We have invented a new &amp;amp;lt;road type&amp;amp;gt; engine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Powered road type list (0F) ==&lt;br /&gt;
&lt;br /&gt;
List of road types on which road vehicles of this road type are powered. E.g. vehicles of &amp;quot;normal road&amp;quot;-type are powered on &amp;quot;electrified road&amp;quot;- and &amp;quot;haul-road&amp;quot;-type as well. Note that there is no &amp;quot;compatible road type list&amp;quot; since there is no difference between &amp;quot;powered&amp;quot; and &amp;quot;compatible&amp;quot; for roadtypes&lt;br /&gt;
&lt;br /&gt;
The format is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;0E &amp;amp;lt;nvar&amp;amp;gt; (&amp;amp;lt;road type label&amp;amp;gt;){n}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is you give the number of compatible road types in a single byte followed by a list of that length of road type labels. A road type is automatically powered with itself, so you don&#039;t need to list the current road type.&lt;br /&gt;
&lt;br /&gt;
Note that these properties apply to road vehicles of this road type, not the road itself. If you want road vehicles of other road types to be able to run on your road types, you must set the powered road types property for each road type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other road type, you cannot remove poweredness once it is set (by some other grf).&lt;br /&gt;
&lt;br /&gt;
== Road type flags (10) ==&lt;br /&gt;
&lt;br /&gt;
Flags to define properties related to the road type:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Draw catenary for this road type&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|Disallow level crossings for this road type&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|Disallow construction of houses along roadtype&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|Hide this road type from construction menu&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|Enables road type to be built by towns, picked by highest speed limit (defaults to ROAD label if no speed limits?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Speed limit (14) ==&lt;br /&gt;
&lt;br /&gt;
Speed limit in mph*0.8 (approx. 0.5km/h). Set to &amp;quot;0&amp;quot; for no limit at all.&lt;br /&gt;
&lt;br /&gt;
== Map colour (16) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the colour this road type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates|DOS palette]].&lt;br /&gt;
&lt;br /&gt;
== Introduction date (17) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the long date formatted introduction date of this road type. With this property set the road type will be introduced at (or after) this date when all of the introduction required road types are available to the company of the player, or whenever a vehicle using this road type gets introduced whichever is first.&lt;br /&gt;
&lt;br /&gt;
== Introduction required road type list (18) ==&lt;br /&gt;
&lt;br /&gt;
List of road types on that need to be available to the company of the player for this road type to be introduced at (or after) the introduction date. This limit does not apply when the road type is introduced by the introduction of a vehicle.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
This can, for example, be used to introduce a road type with streetlights when both paved road and electrified road types are available.&lt;br /&gt;
&lt;br /&gt;
== Introduced road type list (19) ==&lt;br /&gt;
&lt;br /&gt;
List of road types that get introduced when this road type is introduced. For example, to make sure that when a fast road type is introduced the slow variant exists.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
== Sort order (1A) ==&lt;br /&gt;
&lt;br /&gt;
Property for influencing the sort order of the drop down lists with road types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|07&lt;br /&gt;
|Normal Road&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Electrified Road&lt;br /&gt;
|-&lt;br /&gt;
|n7&lt;br /&gt;
|Roadtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thus the road type that (internally) gets index 8 will get a default value of 87. These defaults are to keep the ordering when this property is not supported as they were.&lt;br /&gt;
&lt;br /&gt;
== Road type name (1B) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the road type.&lt;br /&gt;
&lt;br /&gt;
== Alternate road type labels (1D) ==&lt;br /&gt;
&lt;br /&gt;
A list of alternate labels that get &amp;quot;redirected&amp;quot; to this road type when used e.g. as road type of road vehicle or when testing if a label is defined. The redirection only happens if the alternate label isn&#039;t defined as a real road type. Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
Alternate labels are not considered when evaluating properties 0F, 18, and 19.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
To be written&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Tramtypes&amp;diff=4041</id>
		<title>Action0/Tramtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Tramtypes&amp;diff=4041"/>
		<updated>2020-05-19T18:09:58Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Speed limit (14) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Action 0 properties for tram types&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for tram types =&lt;br /&gt;
&lt;br /&gt;
Defining properties of tram types.&lt;br /&gt;
&lt;br /&gt;
Up to 63 tramtypes can be defined.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Size&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|4*B&lt;br /&gt;
|Tram type label&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build tram toolbar caption&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, setting property 09 sets property 1B as well.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Tram construction dropdown text&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build vehicle window caption&lt;br /&gt;
|-&lt;br /&gt;
|0C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Autoreplace text&lt;br /&gt;
|-&lt;br /&gt;
|0D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: New engine text&lt;br /&gt;
|-&lt;br /&gt;
|0F&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Powered tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot;&amp;gt;Tram type labels in this list are &#039;&#039;not&#039;&#039; resolved using the alternate label list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Tram type flags&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Construction costs&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Speed limit&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Minimap colour&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|D&lt;br /&gt;
|Introduction date&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduction required tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduced tram type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Sort order&lt;br /&gt;
|-&lt;br /&gt;
|1B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Tram type name&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, set property 1B &#039;&#039;after&#039;&#039; setting property 09, as property 09 sets the rail type name as well for backwards compatibility.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Infrastructure maintenance cost factor&lt;br /&gt;
|-&lt;br /&gt;
|1D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D&lt;br /&gt;
|Alternate tram type labels that shall be &amp;quot;redirected&amp;quot; to this tram type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In NFO, tram type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing tram type, specify its label in property 08. To create a new tram type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label &#039;clashes&#039; with another GRF, then one GRF will end up modifying the properties instead of creating a new tram type.&lt;br /&gt;
&lt;br /&gt;
When a new tram type is created, it is populated with the information from the first tram type, except that the powered list contains only the tram type being created. However, no default values should be assumed, as the first tram type may have been modified.&lt;br /&gt;
&lt;br /&gt;
== Vehicle and Tramtype availability ==&lt;br /&gt;
&lt;br /&gt;
Vehicle and tramtype availability and compatibility is influenced by multiple properties.&lt;br /&gt;
Generally, the vehicle defines which tramtype it is, and the tramtypes define the compatibility between each other.&lt;br /&gt;
* A vehicle exists, if its tramtype (road vehicle prop 05) is defined. Otherwise the vehicle is disabled.&lt;br /&gt;
* When a vehicle is introduced, it always introduces its tramtype (road vehicle prop 05).&lt;br /&gt;
* A tramtype is introduced, if at least one of the following conditions is met:&lt;br /&gt;
** A vehicle is introduced, that references the tramtype (road vehicle prop 05).&lt;br /&gt;
** Another tramtype is introduced, that references the tramtype via the introduced tramtype list (tramtype prop 19).&lt;br /&gt;
** The introduction date (tramtype prop 17) is passed and all required tramtypes (tramtype prop 18) are available.&lt;br /&gt;
&lt;br /&gt;
Via tramtype property 1D multiple tramtypes can be defined, which shall be considered equivalent to a tramtype.&lt;br /&gt;
This affects the interpretation of road vehicle property 05. If road vehicle property 05 references an undefined tramtype, then&lt;br /&gt;
tramtype property 1D is checked for all defined tramtypes, whether the vehicle can be reassigned to some other tramtype.&lt;br /&gt;
Otherwise the vehicle is disabled.&lt;br /&gt;
&lt;br /&gt;
== Tram type label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique four-letter identifiers for specific tram types (analoguous to [[Action0Cargos#Cargo label 17|cargo labels]]), used to make various tram types accessible from road vehicle grfs. Reserved labels for default tram types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Label&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Tram Type&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|RAIL &lt;br /&gt;
| Normal Tram&lt;br /&gt;
|-&lt;br /&gt;
|ELRL &lt;br /&gt;
| Electrified Tram&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Tram type sets may use up to 63 tramtypes and have to specify their own [[TramtypeLabels|labels]].&lt;br /&gt;
&lt;br /&gt;
See also [[Action0/Global Settings#Tram type translation table 12|Tram Type Translation Table]] for further info.&lt;br /&gt;
&lt;br /&gt;
== Build tram toolbar caption (09) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the tram type as shown in the toolbar caption.&lt;br /&gt;
&lt;br /&gt;
== Tram construction dropdown text (0A) ==&lt;br /&gt;
&lt;br /&gt;
String ID for text in the dropdown of all tram types.&lt;br /&gt;
&lt;br /&gt;
This string must never start with a colour control code.&lt;br /&gt;
&lt;br /&gt;
== Build vehicle window caption (0B) ==&lt;br /&gt;
&lt;br /&gt;
String ID for build vehicle window caption.&lt;br /&gt;
&lt;br /&gt;
== Autoreplace text (0C) ==&lt;br /&gt;
&lt;br /&gt;
String ID for tram type shown in autoreplace window.&lt;br /&gt;
&lt;br /&gt;
== New engines (0D) ==&lt;br /&gt;
&lt;br /&gt;
StringID to use for showing texts of the type &amp;quot;We have invented a new &amp;amp;lt;tram type&amp;amp;gt; engine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Powered tram type list (0F) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types on which road vehicles of this tram type are powered. E.g. vehicles of &amp;quot;normal tram&amp;quot;-type are powered on &amp;quot;electrified tram&amp;quot;- and &amp;quot;haul-tram&amp;quot;-type as well. Note that there is no &amp;quot;compatible tram type list&amp;quot; since there is no difference between &amp;quot;powered&amp;quot; and &amp;quot;compatible&amp;quot; for tramtypes&lt;br /&gt;
&lt;br /&gt;
The format is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;0E &amp;amp;lt;nvar&amp;amp;gt; (&amp;amp;lt;tram type label&amp;amp;gt;){n}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is you give the number of compatible tram types in a single byte followed by a list of that length of tram type labels. A tram type is automatically powered with itself, so you don&#039;t need to list the current tram type.&lt;br /&gt;
&lt;br /&gt;
Note that these properties apply to road vehicles of this tram type, not the tram itself. If you want road vehicles of other tram types to be able to run on your tram types, you must set the powered tram types property for each tram type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other tram type, you cannot remove poweredness once it is set (by some other grf).&lt;br /&gt;
&lt;br /&gt;
== Tram type flags (10) ==&lt;br /&gt;
&lt;br /&gt;
Flags to define properties related to the tram type:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Draw catenary for this tram type&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|Disallow level crossings for this tram type&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|Disallow construction of houses along tramtype&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|Hide this tram type from construction menu&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|Enables towns to build tramtype, but towns don&#039;t build trams...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Speed limit (14) ==&lt;br /&gt;
&lt;br /&gt;
Speed limit in mph*3.2 (approx. km/h*2). Set to &amp;quot;0&amp;quot; for no limit at all.&lt;br /&gt;
&lt;br /&gt;
== Map colour (16) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the colour this tram type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates|DOS palette]].&lt;br /&gt;
&lt;br /&gt;
== Introduction date (17) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the long date formatted introduction date of this tram type. With this property set the tram type will be introduced at (or after) this date when all of the introduction required tram types are available to the company of the player, or whenever a vehicle using this tram type gets introduced whichever is first.&lt;br /&gt;
&lt;br /&gt;
== Introduction required tram type list (18) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types on that need to be available to the company of the player for this tram type to be introduced at (or after) the introduction date. This limit does not apply when the tram type is introduced by the introduction of a vehicle.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
This can, for example, be used to introduce a tram type with catenary when both normal tram and electrified tram types are available.&lt;br /&gt;
&lt;br /&gt;
== Introduced tram type list (19) ==&lt;br /&gt;
&lt;br /&gt;
List of tram types that get introduced when this tram type is introduced. For example, to make sure that when a fast tram type is introduced the slow variant exists.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
== Sort order (1A) ==&lt;br /&gt;
&lt;br /&gt;
Property for influencing the sort order of the drop down lists with tram types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|07&lt;br /&gt;
|Normal Tram&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Electrified Tram&lt;br /&gt;
|-&lt;br /&gt;
|n7&lt;br /&gt;
|Tramtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thus the tram 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;
== Tram type name (1B) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the tram type.&lt;br /&gt;
&lt;br /&gt;
== Alternate tram type labels (1D) ==&lt;br /&gt;
&lt;br /&gt;
A list of alternate labels that get &amp;quot;redirected&amp;quot; to this tram type when used e.g. as tram type of road vehicle or when testing if a label is defined. The redirection only happens if the alternate label isn&#039;t defined as a real tram type. Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
Alternate labels are not considered when evaluating properties 0F, 18, and 19.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
To be written&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Roadtypes&amp;diff=4040</id>
		<title>Action0/Roadtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Roadtypes&amp;diff=4040"/>
		<updated>2020-05-19T18:09:35Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Speed limit (14) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Action 0 properties for road types&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for road types =&lt;br /&gt;
&lt;br /&gt;
Defining properties of road types.&lt;br /&gt;
&lt;br /&gt;
Up to 63 roadtypes can be defined.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Size&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|4*B&lt;br /&gt;
|Road type label&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build road toolbar caption&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, setting property 09 sets property 1B as well.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Road construction dropdown text&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Build vehicle window caption&lt;br /&gt;
|-&lt;br /&gt;
|0C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Autoreplace text&lt;br /&gt;
|-&lt;br /&gt;
|0D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: New engine text&lt;br /&gt;
|-&lt;br /&gt;
|0F&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Powered road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot;&amp;gt;Road type labels in this list are &#039;&#039;not&#039;&#039; resolved using the alternate label list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Road type flags&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Construction costs&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Speed limit&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Minimap colour&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|D&lt;br /&gt;
|Introduction date&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduction required road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D &lt;br /&gt;
|Introduced road type list&amp;lt;ref name=&amp;quot;alt_label&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1A&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B&lt;br /&gt;
|Sort order&lt;br /&gt;
|-&lt;br /&gt;
|1B&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|StringID: Road type name&amp;lt;!--&amp;lt;ref&amp;gt;{{grfTill|7}} For GRF version 7 or earlier, set property 1B &#039;&#039;after&#039;&#039; setting property 09, as property 09 sets the rail type name as well for backwards compatibility.&amp;lt;/ref&amp;gt;--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1C&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|W&lt;br /&gt;
|Infrastructure maintenance cost factor&lt;br /&gt;
|-&lt;br /&gt;
|1D&lt;br /&gt;
|{{ottdp|1.10}}&lt;br /&gt;
|B n*D&lt;br /&gt;
|Alternate road type labels that shall be &amp;quot;redirected&amp;quot; to this road type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In NFO, road type IDs will be GRF local, with an ID to label mapping. Therefore to modify an existing road type, specify its label in property 08. To create a new road type, again just specify its label in property 08. This way there is no need for complex GRM mechanisms to allocate IDs. If a label &#039;clashes&#039; with another GRF, then one GRF will end up modifying the properties instead of creating a new road type.&lt;br /&gt;
&lt;br /&gt;
When a new road type is created, it is populated with the information from the first road type, except that the powered list contains only the road type being created. However, no default values should be assumed, as the first road type may have been modified.&lt;br /&gt;
&lt;br /&gt;
== Vehicle and Roadtype availability ==&lt;br /&gt;
&lt;br /&gt;
Vehicle and roadtype availability and compatibility is influenced by multiple properties.&lt;br /&gt;
Generally, the vehicle defines which roadtype it is, and the roadtypes define the compatibility between each other.&lt;br /&gt;
* A vehicle exists, if its roadtype (road vehicle prop 05) is defined. Otherwise the vehicle is disabled.&lt;br /&gt;
* When a vehicle is introduced, it always introduces its roadtype (road vehicle prop 05).&lt;br /&gt;
* A roadtype is introduced, if at least one of the following conditions is met:&lt;br /&gt;
** A vehicle is introduced, that references the roadtype (road vehicle prop 05).&lt;br /&gt;
** Another roadtype is introduced, that references the roadtype via the introduced roadtype list (roadtype prop 19).&lt;br /&gt;
** The introduction date (roadtype prop 17) is passed and all required roadtypes (roadtype prop 18) are available.&lt;br /&gt;
&lt;br /&gt;
Via roadtype property 1D multiple roadtypes can be defined, which shall be considered equivalent to a roadtype.&lt;br /&gt;
This affects the interpretation of road vehicle property 05. If road vehicle property 05 references an undefined roadtype, then&lt;br /&gt;
roadtype property 1D is checked for all defined roadtypes, whether the vehicle can be reassigned to some other roadtype.&lt;br /&gt;
Otherwise the vehicle is disabled.&lt;br /&gt;
&lt;br /&gt;
== Road type label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique four-letter identifiers for specific road types (analoguous to [[Action0Cargos#Cargo label 17|cargo labels]]), used to make various road types accessible from road vehicle grfs. Reserved labels for default road types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Label&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Road Type&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|ROAD &lt;br /&gt;
| Normal Road&lt;br /&gt;
|-&lt;br /&gt;
|ELRD &lt;br /&gt;
| Electrified Road&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Road type sets may use up to 63 roadtypes and have to specify their own [[RoadtypeLabels|labels]].&lt;br /&gt;
&lt;br /&gt;
See also [[Action0/Global Settings#Road type translation table 12|Road Type Translation Table]] for further info.&lt;br /&gt;
&lt;br /&gt;
== Build road toolbar caption (09) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the road type as shown in the toolbar caption.&lt;br /&gt;
&lt;br /&gt;
== Road construction dropdown text (0A) ==&lt;br /&gt;
&lt;br /&gt;
String ID for text in the dropdown of all road types.&lt;br /&gt;
&lt;br /&gt;
This string must never start with a colour control code.&lt;br /&gt;
&lt;br /&gt;
== Build vehicle window caption (0B) ==&lt;br /&gt;
&lt;br /&gt;
String ID for build vehicle window caption.&lt;br /&gt;
&lt;br /&gt;
== Autoreplace text (0C) ==&lt;br /&gt;
&lt;br /&gt;
String ID for road type shown in autoreplace window.&lt;br /&gt;
&lt;br /&gt;
== New engines (0D) ==&lt;br /&gt;
&lt;br /&gt;
StringID to use for showing texts of the type &amp;quot;We have invented a new &amp;amp;lt;road type&amp;amp;gt; engine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Powered road type list (0F) ==&lt;br /&gt;
&lt;br /&gt;
List of road types on which road vehicles of this road type are powered. E.g. vehicles of &amp;quot;normal road&amp;quot;-type are powered on &amp;quot;electrified road&amp;quot;- and &amp;quot;haul-road&amp;quot;-type as well. Note that there is no &amp;quot;compatible road type list&amp;quot; since there is no difference between &amp;quot;powered&amp;quot; and &amp;quot;compatible&amp;quot; for roadtypes&lt;br /&gt;
&lt;br /&gt;
The format is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;0E &amp;amp;lt;nvar&amp;amp;gt; (&amp;amp;lt;road type label&amp;amp;gt;){n}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is you give the number of compatible road types in a single byte followed by a list of that length of road type labels. A road type is automatically powered with itself, so you don&#039;t need to list the current road type.&lt;br /&gt;
&lt;br /&gt;
Note that these properties apply to road vehicles of this road type, not the road itself. If you want road vehicles of other road types to be able to run on your road types, you must set the powered road types property for each road type. Setting these properties behaves always incremental, so you only need to the set additional bits for each other road type, you cannot remove poweredness once it is set (by some other grf).&lt;br /&gt;
&lt;br /&gt;
== Road type flags (10) ==&lt;br /&gt;
&lt;br /&gt;
Flags to define properties related to the road type:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Draw catenary for this road type&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|Disallow level crossings for this road type&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|Disallow construction of houses along roadtype&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|Hide this road type from construction menu&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|Enables road type to be built by towns, picked by highest speed limit (defaults to ROAD label if no speed limits?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Speed limit (14) ==&lt;br /&gt;
&lt;br /&gt;
Speed limit in mph*3.2 (approx. km/h*2). Set to &amp;quot;0&amp;quot; for no limit at all.&lt;br /&gt;
&lt;br /&gt;
== Map colour (16) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the colour this road type is drawn in the minimap view. The byte value specifies the colour entry in the [[PalettesAndCoordinates|DOS palette]].&lt;br /&gt;
&lt;br /&gt;
== Introduction date (17) ==&lt;br /&gt;
&lt;br /&gt;
This property defines the long date formatted introduction date of this road type. With this property set the road type will be introduced at (or after) this date when all of the introduction required road types are available to the company of the player, or whenever a vehicle using this road type gets introduced whichever is first.&lt;br /&gt;
&lt;br /&gt;
== Introduction required road type list (18) ==&lt;br /&gt;
&lt;br /&gt;
List of road types on that need to be available to the company of the player for this road type to be introduced at (or after) the introduction date. This limit does not apply when the road type is introduced by the introduction of a vehicle.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
This can, for example, be used to introduce a road type with streetlights when both paved road and electrified road types are available.&lt;br /&gt;
&lt;br /&gt;
== Introduced road type list (19) ==&lt;br /&gt;
&lt;br /&gt;
List of road types that get introduced when this road type is introduced. For example, to make sure that when a fast road type is introduced the slow variant exists.&lt;br /&gt;
&lt;br /&gt;
Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
== Sort order (1A) ==&lt;br /&gt;
&lt;br /&gt;
Property for influencing the sort order of the drop down lists with road types. Default values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|07&lt;br /&gt;
|Normal Road&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Electrified Road&lt;br /&gt;
|-&lt;br /&gt;
|n7&lt;br /&gt;
|Roadtype #n&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thus the road type that (internally) gets index 8 will get a default value of 87. These defaults are to keep the ordering when this property is not supported as they were.&lt;br /&gt;
&lt;br /&gt;
== Road type name (1B) ==&lt;br /&gt;
&lt;br /&gt;
String ID of the name of the road type.&lt;br /&gt;
&lt;br /&gt;
== Alternate road type labels (1D) ==&lt;br /&gt;
&lt;br /&gt;
A list of alternate labels that get &amp;quot;redirected&amp;quot; to this road type when used e.g. as road type of road vehicle or when testing if a label is defined. The redirection only happens if the alternate label isn&#039;t defined as a real road type. Same format as for property 0F above.&lt;br /&gt;
&lt;br /&gt;
Alternate labels are not considered when evaluating properties 0F, 18, and 19.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
To be written&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=3331</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=3331"/>
		<updated>2012-11-15T23:13:53Z</updated>

		<summary type="html">&lt;p&gt;Yexo: OpenTTD GUI sprites now up to 168&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and [[PathBasedSignalling|PBS]] graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6|no|ottdrev=11433}}||Flag sprites||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 168&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites (1) is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1(r).pcx.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in trg1(r).pcx. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 162 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2&amp;diff=3309</id>
		<title>VariationalAction2</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2&amp;diff=3309"/>
		<updated>2012-09-28T20:33:06Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Type */ Airports don&amp;#039;t have a parent scope yet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
To support changes in graphics based on other factors than just the load states, you use a VarAction2. This provides a sophisticated way of deciding what graphics to use.&lt;br /&gt;
&lt;br /&gt;
A VarAction2 can be used like any other action 2, but it provides an additional step in-between: instead of defining the action 1 sets right away, it instead specifies a list of additional action 2 entry, one of which is used depending on the kind of variation that is defined. These action 2 entries that are referred can in turn be variational or random (to provide chains of decisions), or they can be the final element, that is a regular action 2 which contains definitions of action 1 sets, or a callback result.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 02 &amp;lt;feature&amp;gt; &amp;lt;set-id&amp;gt; &amp;lt;type&amp;gt; &amp;lt;variable&amp;gt; &amp;lt;varadjust&amp;gt; &amp;lt;nvar&amp;gt; (&amp;lt;set-id&amp;gt; &amp;lt;low-range&amp;gt; &amp;lt;high-range&amp;gt;){n} &amp;lt;default&amp;gt;&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 used in this action.&lt;br /&gt;
|-&lt;br /&gt;
|02||B||Defines action 02&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;feature&amp;gt;||B||For what type of vehicle/station should this definition be used?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;set-id&amp;gt;||B||The ID of this action 2 (used like a cargo ID)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||Type of VarAction2, see below&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;variable&amp;gt;||B||Which variable we base the decision on&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;varadjust&amp;gt;||V||How to manipulate the value before deciding.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;nvar&amp;gt;||B||Number of different ranges of the value (not counting the default)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;set-id&amp;gt;||W||Action 2 set-id to use for the following range.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;low-range&amp;gt;||B/W/D||Minimum (inclusive) of the range for which to use the above set-id&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;high-range&amp;gt;||B/W/D||Maximum (inclusive) of the range&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;default&amp;gt;||W||Action 2 set-id to use if no range matches&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You repeat the sequence of &amp;lt;set-id&amp;gt; &amp;lt;low-range&amp;gt; &amp;lt;high-range&amp;gt; as often as &amp;lt;nvar&amp;gt; specifies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;low-range&amp;gt; and &amp;lt;high-range&amp;gt; have a size of B, W, or D, depending on &amp;lt;type&amp;gt;. See that entry for more information.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== Feature ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of [[Features|feature]] that you wish to change. Set it to:&lt;br /&gt;
&lt;br /&gt;
{|- |&lt;br /&gt;
!Value!![[Features|Feature]]&lt;br /&gt;
|-&lt;br /&gt;
|00||[[VariationalAction2/Vehicles | Trains]]&lt;br /&gt;
|-&lt;br /&gt;
|01||[[VariationalAction2/Vehicles | Road Vehicles]]&lt;br /&gt;
|-&lt;br /&gt;
|02||[[VariationalAction2/Vehicles | Ships]]&lt;br /&gt;
|-&lt;br /&gt;
|03||[[VariationalAction2/Vehicles | Aircraft]]&lt;br /&gt;
|-&lt;br /&gt;
|04||[[VariationalAction2/Stations | Stations]]&lt;br /&gt;
|-&lt;br /&gt;
|05||[[VariationalAction2/Canals | Canals/Rivers]]&lt;br /&gt;
|-&lt;br /&gt;
|06||[[VariationalAction2/Bridges | Bridges]]&lt;br /&gt;
|-&lt;br /&gt;
|07||[[VariationalAction2/Houses | Houses]]&lt;br /&gt;
|-&lt;br /&gt;
|09||[[VariationalAction2/Industry Tiles | Industry Tiles]]&lt;br /&gt;
|-&lt;br /&gt;
|0A||[[VariationalAction2/Industries | Industries]]&lt;br /&gt;
|-&lt;br /&gt;
|0B||Cargos (no feature specific variables)&lt;br /&gt;
|-&lt;br /&gt;
|0C||Sound Effects (no feature specific variables)&lt;br /&gt;
|-&lt;br /&gt;
|0D||[[VariationalAction2/Airports | Airports]]&lt;br /&gt;
|-&lt;br /&gt;
|0E||[[VariationalAction2/Signals | Signals]]&lt;br /&gt;
|-&lt;br /&gt;
|0F||[[VariationalAction2/Objects | Objects]]&lt;br /&gt;
|-&lt;br /&gt;
|10||[[VariationalAction2/Railtypes | Railtypes]]&lt;br /&gt;
|-&lt;br /&gt;
|11||[[VariationalAction2/Airport Tiles | Airport Tiles]]&lt;br /&gt;
|-&lt;br /&gt;
|12||[[VariationalAction2/Towns | Towns]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Set-ID ===&lt;br /&gt;
&lt;br /&gt;
This defines the number of this action 2. &amp;amp;nbsp;The ID can then be used as target in an action 3 or another variational/random action 2.&lt;br /&gt;
&lt;br /&gt;
=== Type ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! !! B&amp;lt;br/&amp;gt;Access lowest byte !! {{ottdp|0.6|2.5}} W&amp;lt;br/&amp;gt;Access lowest word !! {{ottdp|0.6|2.5}} D&amp;lt;br/&amp;gt;Access lowest doubleword&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;left&amp;quot;| Access general variable or&amp;lt;br/&amp;gt;variable of the primary object&lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 81 &lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 85 &lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 89&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;left&amp;quot;| Access variable of &amp;quot;related&amp;quot; object&lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 82 &lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 86 &lt;br /&gt;
|align=&amp;quot;center&amp;quot;| 8A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The access type specifies both the size of the variable access, and selects between general variables and the object&#039;s innate variables, or variables of a specific &amp;quot;related&amp;quot; object.&lt;br /&gt;
&lt;br /&gt;
{|- |&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|[[Features|Feature]]!!Related object&lt;br /&gt;
|-&lt;br /&gt;
|00-03||[[VariationalAction2/Vehicles | Vehicles]]||First [[VariationalAction2/Vehicles | vehicle]] of consist&lt;br /&gt;
|-&lt;br /&gt;
|04||[[VariationalAction2/Stations | Stations]]||[[VariationalAction2/Towns | Town]] to which station belongs&lt;br /&gt;
|-&lt;br /&gt;
|05||[[VariationalAction2/Canals | Canals/Rivers]]||N/A&lt;br /&gt;
|-&lt;br /&gt;
|06||[[VariationalAction2/Bridges | Bridges]]||[[VariationalAction2/Towns | Town]] of bridge&lt;br /&gt;
|-&lt;br /&gt;
|07||[[VariationalAction2/Houses | Houses]]||[[VariationalAction2/Towns | Town]] of house&lt;br /&gt;
|-&lt;br /&gt;
|09||[[VariationalAction2/Industry Tiles | Industry Tiles]]||[[VariationalAction2/Industries | Industry]] containing tile&lt;br /&gt;
|-&lt;br /&gt;
|0A||[[VariationalAction2/Industries | Industries]]||[[VariationalAction2/Towns | Town]] of industry&lt;br /&gt;
|-&lt;br /&gt;
|0B||Cargos||N/A&lt;br /&gt;
|-&lt;br /&gt;
|0C||Sound Effects||N/A&lt;br /&gt;
|-&lt;br /&gt;
|0D||[[VariationalAction2/Airports | Airports]]||N/A&lt;br /&gt;
|-&lt;br /&gt;
|0E||[[VariationalAction2/Signals | Signals]]||N/A&lt;br /&gt;
|-&lt;br /&gt;
|0F||[[VariationalAction2/Objects | Objects]]||[[VariationalAction2/Towns | Town]] of object&lt;br /&gt;
|-&lt;br /&gt;
|10||[[VariationalAction2/Railtypes | Railtypes]]||N/A&lt;br /&gt;
|-&lt;br /&gt;
|11||[[VariationalAction2/Airport Tiles | Airport Tiles]]||N/A&lt;br /&gt;
|-&lt;br /&gt;
|12||[[VariationalAction2/Towns | Towns]]||N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Every variable specifies a size for it. Not every variable is a doubleword.&lt;br /&gt;
If the accessed variable is smaller than the size given here, the extra bits may contain junk, and should be &amp;lt;and-masked&amp;gt; out.&lt;br /&gt;
&lt;br /&gt;
=== Variable ===&lt;br /&gt;
&lt;br /&gt;
Variational Action 2 allows accessing these variables:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!Version!!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|00-3F|| || ||See [[GlobalVariables| global variables page]].&lt;br /&gt;
|-&lt;br /&gt;
|40+x||D|| ||specially calculated feature-specific variable, see following feature-specific pages&lt;br /&gt;
|-&lt;br /&gt;
|5F||D||{{ottdp|0.7|2.6|ttdprev=r1928}}||Feature-specific random data: triggers in low byte, bits in other three bytes. Bits of the variable not associated with random or trigger bits are reserved.&lt;br /&gt;
|-&lt;br /&gt;
|60+x||D|| ||similar to 40+x variables, but the variable number must be followed by a byte, which will be given to the variable handler as parameter.&lt;br /&gt;
|-&lt;br /&gt;
|7B||-||{{ottdp|1.1|2.6|ottdrev=r21604|ttdprev=r2359}}||A special 60+x variable to be used in Advanced Variational Action 2. It allows to evaluate any other 60+x variable using a non-constant parameter from a register. The parameter of variable 7B specifies another 60+x variable which is evaluated. The parameter for that variable is read from the accumulator (&#039;val1&#039;), i.e. the result from the preceding operations of the same Advanced Variational Action 2. Hence variable 7B may not be the first variable used in the calculation. Variable 7B itself and 7E (procedure call) are not allowed to be used as parameter for variable 7B.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r23138}} Since OpenTTD r23138 you can use this to pass 32 bit parameters to 60+x variables. Currently this is only useful for a few variables, e.g. vehicle variable 60. For most variables the higher bits of the parameter are considered reserved. So, make sure to mask the higher bits in the preceding calculations.&lt;br /&gt;
|-&lt;br /&gt;
|7C||D||{{ottdp|0.6|2.6|ttdprev=r1315}}||A special 60+x variable used to access values stored in the registers of [[Storages#Persistent storage|persistent storage]].&lt;br /&gt;
|-&lt;br /&gt;
|7D||D||{{ottdp|0.6|2.6|ttdprev=r1246}}||A special 60+x variable used to access values stored in the registers of [[Storages#Temporary storage|temporary storage]]. Available in the purchase list.&lt;br /&gt;
|-&lt;br /&gt;
|7E||D||{{ottdp|0.6|2.5}}||A special 60+x variable indicating a [[VarAction2Advanced#Using procedures|procedure call]]. Available in the purchase list.&lt;br /&gt;
|-&lt;br /&gt;
|7F||D||{{ottdp|0.6|2.5}}||A special 60+x variable that reads GRF parameter whose number is given by the 60+x parameter. Available in the purchase list.&lt;br /&gt;
|-&lt;br /&gt;
|80+x|| || ||Feature-specific variable, see following feature-specific pages. While most of these variables actually refer to raw memory locations of original TTD structures, you cannot rely on that. Some variables were added later, some were moved or replaced. Only the variables listed in the specs are somewhat set to not be changed in the future.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all features, the 80+x variables are offsets into the corresponding structure in TTD&#039;s game data. &amp;amp;nbsp;The 40+x and 60+x variables are special variables that are computed on-the-fly, and aren&#039;t actually stored anywhere in memory, unless stated otherwise. Therefore they should be used as little as necessary so as not to slow down the game too much with the calculation of these variables (which can be called thousands of times per second, whenever any vehicle moves).&lt;br /&gt;
&lt;br /&gt;
When displaying a vehicle (etc.) in the purchase list, the game will show those variations based on external variables (dates etc.) correctly, but variations based on vehicle variables (variables 40+x, 60+x and 80+x) will always show the first (not the default) cargo-ID unless otherwise specified for the given variable. If you do a calculation, the first cargo-ID will be selected if any of the needed variables is inaccessible.&lt;br /&gt;
&lt;br /&gt;
The lists of 80+x variables on the following pages are not exhaustive; only the useful variables are listed there. For a full list check the definition of corresponding structures in TTD. Marcin Grzegorczyk has a pretty good list of the structure definitions on his [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html savegame internals page].&lt;br /&gt;
&lt;br /&gt;
=== varadjust ===&lt;br /&gt;
&lt;br /&gt;
Adjust variable to a more useful range. It has the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  &amp;lt;shift-num&amp;gt; &amp;lt;and-mask&amp;gt; &amp;lt;nowiki&amp;gt;[&amp;lt;add-val&amp;gt; &amp;lt;divide-val&amp;gt;/&amp;lt;modulo-val&amp;gt;]&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&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;
|shift-num||B||value to right-shift the variable, and some special bits. See below.&lt;br /&gt;
|-&lt;br /&gt;
|and-mask||B/W/D||value with which to AND the variable after shifting. Return this value if neither bit 6 nor bit 7 of shift-num are set.&lt;br /&gt;
|-&lt;br /&gt;
|add-val||B/W/D||value to add to the variable after ANDing. Only present if bits 6 or 7 are set in shift-num.&lt;br /&gt;
|-&lt;br /&gt;
|divide-val||B/W/D||return the sum divided by this value. Only present if bit 6 is set in shift-num.&lt;br /&gt;
|-&lt;br /&gt;
|modulo-val||B/W/D||return the sum modulo (remainder of division by) this value. Only present if bit 7 is set in shift-num.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;shift-num&amp;gt; is a partial bit-mask; its bits have the following meanings:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit(s)!!Value!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0..4||0..1F||{{ottdp|0.6|2.0}}||number of bits to right shift &amp;lt;variable&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|0.6|2.5}}||This is an [[VarAction2Advanced|advanced VarAction2]]&lt;br /&gt;
|-&lt;br /&gt;
|6||40||{{ottdp|0.6|2.5}}||This is a shift-and-add-divide adjustment.&lt;br /&gt;
|-&lt;br /&gt;
|7||80||{{ottdp|0.6|2.5}}||This is a shift-and-add-modulo adjustment.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bits 6 and 7 may not both be set. If neither are set, this varadjust is a shift-and adjustment.&lt;br /&gt;
&lt;br /&gt;
Note that for the add and divide operations, both the variable and the divisor are taken to be signed numbers. This means that if the high bit is set, the number is taken to be negative, so you may need to mask out the most significant bit to do an unsigned division.&lt;br /&gt;
&lt;br /&gt;
=== nvar ===&lt;br /&gt;
&lt;br /&gt;
Here you set how many different ranges to check for. If the value of the variable, after the above manipulations, is not within one of these ranges, the default will be used. &amp;amp;nbsp;When displayed in the purchase window, the game will always show the first range if the variable is of the 40+x or 80+x type (because the variable is undefined since the vehicle doesn&#039;t exist yet).&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 57}} Since TTDPatch 2.0.1 alpha 57, nvar=0 is a special case. Instead of using ranges, nvar=0 means that the result of an [[VarAction2Advanced|advanced]] calculation (or, if no calculation is performed, the adjusted variable value itself) is returned as callback result, with bit 15 set. &amp;amp;nbsp;This is useful for those callbacks where many different return values are possible and it is easier to calculate them than list them in ranges. &amp;amp;nbsp;The default value must still be specified, and will be used in case the variable(s) used are not available.&lt;br /&gt;
&lt;br /&gt;
=== sets and ranges ===&lt;br /&gt;
&lt;br /&gt;
For each of the ranges to check, you give the set-id as a &#039;&#039;&#039;WORD&#039;&#039;&#039; value (i.e. with a 00 following, e.g. set-id 5 becomes 05 00, or - in case of a callback result - by setting the high bit, e.g. 05 80), followed by the low and high limits of this range. &amp;amp;nbsp;The first range that matches will be used.&lt;br /&gt;
&lt;br /&gt;
The various \b, \w, and \d escape sequences can be useful for &amp;lt;min-range&amp;gt; and &amp;lt;max-range&amp;gt;. See [[GRFActionsDetailed#Byte order|the discussion of escape sequences]] for further information.&lt;br /&gt;
&lt;br /&gt;
=== default ===&lt;br /&gt;
&lt;br /&gt;
The set-id to use if none of the ranges matches.&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 -1 * 15       02 05 03 81        // Action2, Feature 05 (canals), action2ID 03, 1-byte variable&lt;br /&gt;
                   81 00 04       // variable 81 (terrain type), shift 00, mask 0x04 (=bit for &amp;quot;on or above snowline&amp;quot;)&lt;br /&gt;
                   01             // check one range&lt;br /&gt;
                   02 00    04 04 // snowy tile: link to action2ID 02&lt;br /&gt;
                   01 00          // default:    link to action2ID 01&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Builtin_functions&amp;diff=3307</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=3307"/>
		<updated>2012-09-23T11:00:51Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Update list of builtin functions&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-bit mono sound files in WAV format, PCM encoding. There are two allowed frequencies: 11025 Hz and 22050 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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3297</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=3297"/>
		<updated>2012-09-14T20:33:23Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Document town_zone var&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&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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3296</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3296"/>
		<updated>2012-09-12T19:02:59Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* LanguageIDs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STATION       || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{1:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a case changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_case pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##map_case t t_old&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a gender changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_gender pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##gender m f&lt;br /&gt;
##map_gender m male&lt;br /&gt;
##map_gender f female&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 8 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3295</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3295"/>
		<updated>2012-09-12T19:00:33Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Document ##map_gender and ##map_case&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STATION       || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{1:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a case changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_case pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##map_case t t_old&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a gender changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_gender pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##gender m f&lt;br /&gt;
##map_gender m male&lt;br /&gt;
##map_gender f female&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 16 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3188</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3188"/>
		<updated>2012-05-13T14:44:54Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* LanguageIDs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STATION       || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{1:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 16 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3187</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=3187"/>
		<updated>2012-05-13T13:46:11Z</updated>

		<summary type="html">&lt;p&gt;Yexo: fix type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STATION       || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{1:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and number of plural forms is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 16 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2950</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=2950"/>
		<updated>2012-01-06T10:02:40Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Variables without parameter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&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 two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Storages&amp;diff=2939</id>
		<title>Storages</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Storages&amp;diff=2939"/>
		<updated>2011-12-27T16:58:14Z</updated>

		<summary type="html">&lt;p&gt;Yexo: fix variable numbers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Storages are arrays of registers that can be accessed when using [[VariationalAction2]]. Registers (temporary and persistent alike) always have a size of 4 bytes. If you&#039;re writing them using smaller sizes (anything but type 89/8A), the given value will be sign-extended to 4 bytes. Therefore, be careful when you read a register using a bigger size than it was written with. This also applies to registers read by TTDPatch; if not indicated specifically, TTDPatch reads all 4 bytes of the register.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
===Temporary storage===&lt;br /&gt;
{{ottdp|0.6|2.6}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - FF (256) (from TTDPatch r1246 to r1301) or 00 - 10F (272) (since TTDPatch r1301 and OpenTTD r9707)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2sto (0E)]] allows to store values inside the registers of this storage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The first 256 registers 00 to FF can be read using [[VariationalAction2#Variable|variable 7D]]. The rest of the values (100 to 10F) are write only: they are used to pass extra data to some 4x and 6x variables, as well as for returning extra data from callbacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Temporary storage contains values local to the current [[VariationalAction2]] chain. When a new chain starts, the values inside the temporary storage are undefined. Therefore, they should not be used unless they have been properly initialized. During the execution of a chain, only that chain can modify the values in the temporary storage.&lt;br /&gt;
&lt;br /&gt;
===Persistent storage===&lt;br /&gt;
{{ottdp|0.6|2.6}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - 0F (16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2psto (10)]] allows to store values inside the registers of this storage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The registers can be read using [[VariationalAction2#Variable|variable 7C]]. Note that it is possible to access the persistent storage of related objects (see [[VariationalAction2#Type]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Features that support it:&#039;&#039;&#039; Industries (0A)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Persistent storage is associated to a single item. When the item is created, all of the values of the persistent storage are set to zero. Persistent storage values cannot be accessed or modified by items that are being created. Persistent storage should not be read if the current feature doesn&#039;t support it.&lt;br /&gt;
&lt;br /&gt;
===Persistent storage accessed by GRFID===&lt;br /&gt;
{{ottdp|1.2|ottdrev=r22569}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - 0F (16) for each GRFID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2psto (10)]] allows to store values inside the registers of this storage. The GRFID to access must be stored in temporary register 0x100 before using Operator 10. 0xFFFFFFFF can be used to access the GRFID of the item using the current [[VariationalAction2]] chain.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The registers can be read using [[VariationalAction2#Variable|variable 7D]]. Note that it is possible to access the persistent storage of related objects (see [[VariationalAction2#Type]]). The GRFID to access must be stored in temporary register 0x100 before checking variable 7D. 0xFFFFFFFF can be used to access the GRFID of the item using the current [[VariationalAction2]] chain.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Features that support it:&#039;&#039;&#039; Towns (since OpenTTD r22569)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Features supporting persistent storage accessed by GRFID are not restricted to a single persistent storage; there is a persistent storage associated to every GRFID. An item only has write access to the persistent storage associated to its own GRFID, but it can read the registers of any GRFID. Persistent storage values cannot be accessed or modified by items that are being created. Persistent storage should not be read if the current feature doesn&#039;t support it.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2935</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=2935"/>
		<updated>2011-12-24T22:54:13Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Typo in constant name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&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 two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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 HEQS 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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Disable_items&amp;diff=2934</id>
		<title>NML:Disable items</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Disable_items&amp;diff=2934"/>
		<updated>2011-12-22T22:58:47Z</updated>

		<summary type="html">&lt;p&gt;Yexo: fix example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
With a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;disable_item&amp;lt;/code&amp;gt; statement, it&#039;s possible to disable one or more existing items. This works for vehicles, houses, industries, cargos and airports. The general syntax is:&lt;br /&gt;
&lt;br /&gt;
 disable_item(feature[, first_id[, last_id]]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;feature&amp;lt;/code&amp;gt; specifies the feature of the item(s) to disable. If no further arguments are given, all default items of that feature are disabled. If one more argument (&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;first_id&amp;lt;/code&amp;gt;) is given, only that ID is disabled. With two more arguments, all items from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;first_id&amp;lt;/code&amp;gt; up to and including &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;last_id&amp;lt;/code&amp;gt; are disabled. For lists of default IDs, consult the documentation about that feature. An example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 /* disable all monorail and maglev vehicles */&lt;br /&gt;
 disable_item(FEAT_TRAINS, 54, 115);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2933</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2933"/>
		<updated>2011-12-14T16:20:12Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== New named constants ==&lt;br /&gt;
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback &amp;quot;articulated_part&amp;quot; use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.&lt;br /&gt;
For callbacks &amp;quot;cargo_subtype_text&amp;quot;, &amp;quot;cargo_subtype_display&amp;quot; and &amp;quot;start_stop&amp;quot; use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Heights ==&lt;br /&gt;
The &amp;quot;snowline_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nearby_tile_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavPropVarCB&amp;diff=2932</id>
		<title>Template:NMLNavPropVarCB</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavPropVarCB&amp;diff=2932"/>
		<updated>2011-12-14T15:51:00Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is the NML navigation template for Properties/Variables/Callbacks pages and includes the main navigation tempate by itself.&amp;lt;/noinclude&amp;gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;&lt;br /&gt;
{{NMLNavMain}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px; border:1px solid #2f6fab; background:#b1cff8; padding:5px; font-size: 12pt; margin-top: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;Props, Vars and CBs&amp;lt;/font&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px; border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; -moz-border-radius-bottomleft:5px; -moz-border-radius-bottomright:8px; font-size: 8pt; line-height: 11pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[NML:General|General]]&lt;br /&gt;
* [[NML:General#General variables|variables]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Vehicles|Vehicles]]&lt;br /&gt;
*[[NML:Vehicles#Properties common to all vehicle types|common props]] | [[NML:Vehicles#Vehicle variables|vars]] | [[NML:Vehicles#Vehicle callbacks|CBs]]&lt;br /&gt;
*[[NML:Vehicles#Train properties|train]] | [[NML:Vehicles#Road vehicle properties|roadveh]] | [[NML:Vehicles#Ship properties|ship]] | [[NML:Vehicles#Aircraft properties|aircr props]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Stations|Stations]]&lt;br /&gt;
*[[NML:Stations#Station properties|properties]] | [[NML:Stations#Station variables|variables]] | [[NML:Stations#Station callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Canals|Canals]]&lt;br /&gt;
*[[NML:Canals#Canal properties|properties]] | [[NML:Canals#Canal variables|variables]] | [[NML:Canals#Canal callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Bridges|Bridges]]&lt;br /&gt;
*[[NML:Bridges#Bridge properties|properties]] | [[NML:Bridges#Bridge variables|variables]] | [[NML:Bridges#Bridge callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Towns|Towns]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Houses|Houses]]&lt;br /&gt;
*[[NML:Houses#House properties|properties]] | [[NML:Houses#House variables|variables]] | [[NML:Houses#House callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Industries|Industries]]&lt;br /&gt;
*[[NML:Industries#Common variables|common variables]] &lt;br /&gt;
*[[NML:Industries#Industry properties|industry props]] | [[NML:Industries#Industry variables|vars]] | [[NML:Industries#Industry callbacks|CBs]]&lt;br /&gt;
*[[NML:Industries#Industry tile properties|tile props]] | [[NML:Industries#Industry tile variables|vars]] | [[NML:Industries#Industry tile callbacks|CBs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Cargos|Cargos]]&lt;br /&gt;
*[[NML:Cargos#Cargo properties|properties]] | [[NML:Cargos#Cargo variables|variables]] | [[NML:Cargos#Cargo callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Airports|Airports]]&lt;br /&gt;
*[[NML:Airports#Airport properties|airport props]] | [[NML:Airports#Airport variables|vars]] | [[NML:Airports#Airport callbacks|CBs]]&lt;br /&gt;
*[[NML:Airports#Airport tile properties|tile props]] | [[NML:Airports#Airport tile variables|vars]] | [[NML:Airports#Airport tile callbacks|CBs]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Objects|Objects]]&lt;br /&gt;
*[[NML:Objects#Object properties|properties]] | [[NML:Objects#Object variables|variables]] | [[NML:Objects#Object callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
[[NML:Railtypes|Railtypes]]&lt;br /&gt;
*[[NML:Railtypes#Railtype properties|properties]] | [[NML:Railtypes#Railtype variables|variables]] | [[NML:Railtypes#Railtype callbacks|callbacks]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2931</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2931"/>
		<updated>2011-12-14T15:39:04Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Heights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== New named constants ==&lt;br /&gt;
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback &amp;quot;articulated_part&amp;quot; use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.&lt;br /&gt;
For callbacks &amp;quot;cargo_subtype_text&amp;quot;, &amp;quot;cargo_subtype_display&amp;quot; and &amp;quot;start_stop&amp;quot; use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Heights ==&lt;br /&gt;
The &amp;quot;snowline_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nearby_tile_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Canals&amp;diff=2930</id>
		<title>NML:Canals</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Canals&amp;diff=2930"/>
		<updated>2011-12-14T15:37:03Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Canal variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==Canal properties==&lt;br /&gt;
&lt;br /&gt;
  item (FEAT_CANAL, item_name, id) { ... }&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;
| graphic_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
| only possible value other than undefined: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;WATERFEATURE_ALTERNATIVE_SPRITES&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== graphic_flags ===&lt;br /&gt;
the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;WATERFEATURE_ALTERNATIVE_SPRITES&amp;lt;/code&amp;gt; defines the type of spritesets used by the single &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ids&amp;lt;/code&amp;gt; of canals (compare also [[Action3/Canals#id| nfo specs]])&lt;br /&gt;
&lt;br /&gt;
== Canal 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;
|tile_height&lt;br /&gt;
|0 .. max_tile_height&lt;br /&gt;
| {{nml|0.2}} Tile height in pixels (=tiles * 8).&lt;br /&gt;
{{nml|0.3}} Tile height in tiles.&lt;br /&gt;
|-&lt;br /&gt;
|terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
|random_bits&lt;br /&gt;
|0 .. 255&lt;br /&gt;
|random bits of that tile&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Canal callbacks ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
|default&lt;br /&gt;
|spriteset&lt;br /&gt;
|graphics for the canal id&lt;br /&gt;
|-&lt;br /&gt;
|sprite_offset&lt;br /&gt;
|&lt;br /&gt;
|numeric offset into the spriteset for the canal id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Canal ids ==&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
!name&lt;br /&gt;
!use&lt;br /&gt;
!normal sprites&lt;br /&gt;
!alternative sprites&lt;br /&gt;
|-&lt;br /&gt;
|WF_WATERCLIFFS&lt;br /&gt;
|{{ottdp|1.1|2.6|ottdrev=r20352|ttdprev=r1573}} water for canals / locks&lt;br /&gt;
|4 slope sprites&lt;br /&gt;
|1 flat ground sprite followed by 4 slope sprites&lt;br /&gt;
|-&lt;br /&gt;
|WF_LOCKS&lt;br /&gt;
|{{ottdp|0.6|2.5}} Locks&lt;br /&gt;
|24&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_DIKES&lt;br /&gt;
|{{ottdp|0.6|2.5}} Dikes&lt;br /&gt;
|12&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_CANAL_GUI&lt;br /&gt;
|{{ottdp|no|2.5}} Canal GUI&lt;br /&gt;
|1&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_FLAT_DOCKS&lt;br /&gt;
|{{ottdp|no|2.5}} Flat docks&lt;br /&gt;
|4&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_RIVER_SLOPE&lt;br /&gt;
|{{ottdp|1.1|2.6|ottdrev=r20352|ttdprev=r1573}} River water&lt;br /&gt;
|4&lt;br /&gt;
|1 flat ground sprite followed by 4 slope sprites&lt;br /&gt;
|-&lt;br /&gt;
|WF_RIVERBANKS&lt;br /&gt;
|{{ottdp|0.6|2.6}} Riverbanks&lt;br /&gt;
|12*5 (Last 4 for slopes)&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_RIVER_GUI&lt;br /&gt;
|{{ottdp|no|2.6}} River GUI&lt;br /&gt;
|2&lt;br /&gt;
|undefined&lt;br /&gt;
|-&lt;br /&gt;
|WF_BUOY&lt;br /&gt;
|{{ottdp|1.2|no|ottdrev=r22973}} Buoy&lt;br /&gt;
|1&lt;br /&gt;
|undefined&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2929</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2929"/>
		<updated>2011-12-14T15:35:16Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Snowline height */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== New named constants ==&lt;br /&gt;
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback &amp;quot;articulated_part&amp;quot; use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.&lt;br /&gt;
For callbacks &amp;quot;cargo_subtype_text&amp;quot;, &amp;quot;cargo_subtype_display&amp;quot; and &amp;quot;start_stop&amp;quot; use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Heights ==&lt;br /&gt;
The &amp;quot;snowline_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;br /&gt;
The &amp;quot;nearby_tile_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=2928</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=2928"/>
		<updated>2011-12-14T15:33:04Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Document change to snowline_height&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;
| 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;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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2927</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2927"/>
		<updated>2011-12-14T15:32:47Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== New named constants ==&lt;br /&gt;
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback &amp;quot;articulated_part&amp;quot; use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.&lt;br /&gt;
For callbacks &amp;quot;cargo_subtype_text&amp;quot;, &amp;quot;cargo_subtype_display&amp;quot; and &amp;quot;start_stop&amp;quot; use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Snowline height ==&lt;br /&gt;
The &amp;quot;snowline_height&amp;quot; variable now returns the height in tiles instead of &amp;quot;tiles * 8&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2926</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=2926"/>
		<updated>2011-12-14T15:30:15Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Aircraft properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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_CLIMATES&amp;lt;/code&amp;gt;&lt;br /&gt;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&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 two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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 HEQS 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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=2922</id>
		<title>Template:NMLNavMain</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=2922"/>
		<updated>2011-12-13T23:37:55Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is the main NML navigation template, it is designed to be included in subnavigation templates. These subnavigation templates in turn are included on each documentation page.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px; border:1px solid #2f6fab; background:#b1cff8; padding:5px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; font-size: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;[[NML:Main|NewGRF Meta Language]]&amp;lt;/font&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[NML:Preface |Preface]]&lt;br /&gt;
;[[NML:Getting started|Getting started]]&lt;br /&gt;
;[[NML:Graphic files|Graphics files]]&lt;br /&gt;
;[[NML:Language structure|Language structure]]&lt;br /&gt;
;[[NML:Block syntax|Block syntax]]&lt;br /&gt;
;[[NML:Units|Units]]&lt;br /&gt;
;[[NML:Expressions|Expressions]]&lt;br /&gt;
;[[NML:Language files|Language files]]&lt;br /&gt;
;[[NML:Properties and variables and callbacks|Lists of props, vars and CBs]]&lt;br /&gt;
;[[NML:Warnings|Warnings]]&lt;br /&gt;
;[[NML:Additional references|Additional references]]&lt;br /&gt;
;[[NML:NewGRF compatibility|NewGRF compatibility]]&lt;br /&gt;
;[[NML:Old style callbacks|Old-style callbacks]]&lt;br /&gt;
;[[NML:changes 0.3|Changes between NML 0.2 and head / 0.3]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
[[NML:Vehicles|Vehicles]],&lt;br /&gt;
[[NML:Stations|Stations]],&lt;br /&gt;
[[NML:Canals|Canals]],&lt;br /&gt;
[[NML:Bridges|Bridges]],&lt;br /&gt;
[[NML:Towns|Towns]],&lt;br /&gt;
[[NML:Houses|Houses]],&lt;br /&gt;
[[NML:Industries|Industries]],&lt;br /&gt;
[[NML:Cargos|Cargos]],&lt;br /&gt;
[[NML:Airports|Airports]],&lt;br /&gt;
[[NML:Objects|Objects]],&lt;br /&gt;
[[NML:Railtypes|Railtypes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:180px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[ttwiki:NMLTutorial|NML Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2921</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2921"/>
		<updated>2011-12-13T23:22:00Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== New named constants ==&lt;br /&gt;
A few constants have recently been introduced in both NML 0.2 and 0.3 that make the transition easier. Make sure to use them. For callback &amp;quot;articulated_part&amp;quot; use CB_RESULT_NO_MORE_ARTICULATED_PARTS and/or CB_RESULT_REVERSED_VEHICLE instead of hard-coded 0xFF / 0x80.&lt;br /&gt;
For callbacks &amp;quot;cargo_subtype_text&amp;quot;, &amp;quot;cargo_subtype_display&amp;quot; and &amp;quot;start_stop&amp;quot; use CB_RESULT_NO_TEXT instead of hard-coded 0xFF.&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2920</id>
		<title>NML:Changes 0.3</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=2920"/>
		<updated>2011-12-13T23:19:41Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Industry availability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Between NML 0.2.x and NML 0.3.x (and their corresponding nightlies) the generated NewGRF version by NML changed from v7 to v8. This brings lot of advantages, but requires a few changes to existing NML files. NewGRFs thus will require a minimum OpenTTD version of 1.2.0 (r23166).&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
NML 0.3 only supports the new style callbacks. Thus all callback_flag properties have been removed as have the callback flag constants *CBF*. For a complete list of affected constants see the [http://dev.openttdcoop.org/projects/nml/repository/revisions/28c88515e5e7/diff/nml/global_constants.py related commit]&lt;br /&gt;
&lt;br /&gt;
== Industry availability ==&lt;br /&gt;
The callback &amp;quot;availability&amp;quot; is no longer available. Use the callback &amp;quot;construction_probability&amp;quot; instead.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spritelayout&amp;diff=2919</id>
		<title>NML:Spritelayout</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spritelayout&amp;diff=2919"/>
		<updated>2011-12-13T22:53:57Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Sprite */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
Stations, houses, industry tiles, objects, and airport tiles use spritelayouts to define layouts how sprites are supposed to be arranged on a tile. A &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spritelayout&amp;lt;/code&amp;gt; can combine multiple sprites into one entity, which represents everything that is to be drawn on a particular tile. A simple example to illustrate how it works:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 spritelayout airport_building1 {&lt;br /&gt;
 	ground { sprite: GROUNDSPRITE_NORMAL; }&lt;br /&gt;
 	childsprite {&lt;br /&gt;
 		sprite: spr_small_dirt_ne; // custom spriteset&lt;br /&gt;
 		always_draw: 1; // also draw in transparent mode&lt;br /&gt;
 	}&lt;br /&gt;
 	building {&lt;br /&gt;
 		sprite: 0xA67; // reuse this existing base set sprite&lt;br /&gt;
 		xoffset: 0x0F;&lt;br /&gt;
 		xextent: 1;&lt;br /&gt;
 		zextent: 6;&lt;br /&gt;
 		recolour_mode: RECOLOUR_REMAP;&lt;br /&gt;
 		palette: PALETTE_USE_DEFAULT;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sprite layout is composed of one or more sprites. Each sprite is defined by a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ground&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;childsprite&amp;lt;/code&amp;gt; block. What block to use depends on how the sprite is to be placed on the tile.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ground&amp;lt;/code&amp;gt; sprites are drawn at the base of the tile, like grass and concrete, rails etc. in normal TTD. With a few exceptions (e.g. when using custom foundations), you should always provide a ground sprite, even when the building above fully covers it. This because in transparent mode, the building becomes invisible. A tile can only have one ground sprite.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building&amp;lt;/code&amp;gt; sprites are drawn on top of the ground sprite. To determine their location and drawing order (what goes in front of what), they have a 3D bounding box.&lt;br /&gt;
* With &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;childsprite&amp;lt;/code&amp;gt;(s), you can effectively compose sprites from multiple parts. When placing these after a building sprite, they will use the same bounding box as the previous building sprite. When placing them before the first building sprite, they will have no bounding box, as if they would use the &#039;bounding box&#039; of the ground tile. Multiple childsprites may be used per ground / building sprite.&lt;br /&gt;
&lt;br /&gt;
The sprite order is genrally determined by the sprite sorter, that evaluates the bounding box (see below) of each sprite. Child sprites are always part of the building (or ground) sprite that precedes them. In the GUI, sprites are always drawn in the order specified in the layout, so be sure to get this correct for spritelayouts that are to be displayed there.&lt;br /&gt;
&lt;br /&gt;
Per sprite, a number of parameters may be set. These are listed below. Unless otherwise indicated, each may have a value that is dependant on &#039;&#039;&#039;variables, parameters or registers&#039;&#039;&#039;. Accessed variables are always in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; scope. Accessing variables inside the purchase list is &#039;&#039;&#039;not&#039;&#039;&#039; supported, make sure that layouts accessed from there do not use them. Using variables and parameters, it&#039;s possible to create wildly differing looks with few spritelayouts.&lt;br /&gt;
&lt;br /&gt;
===Sprite===&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite&amp;lt;/code&amp;gt;, this determines the actual sprite to be drawn. If you set this to a number, a TTD sprite will be drawn, usually from the base set. Pre-defined constants for some base set sprites are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_NORMAL (a)&amp;lt;/code&amp;gt; default terrain type for that climate (temperate, toyland: normal, arctic: without snow, tropical: rainforest).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_DESERT (a)&amp;lt;/code&amp;gt; desert tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_DESERT_1_2 (a)&amp;lt;/code&amp;gt; transition tile between desert and grass&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_SNOW (a)&amp;lt;/code&amp;gt; snowy ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_SNOW_1_4 (a)&amp;lt;/code&amp;gt; 1/4 snowy ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_SNOW_2_4 (a)&amp;lt;/code&amp;gt; half-snowy ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_SNOW_3_4 (a)&amp;lt;/code&amp;gt; 3/4 snowy ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_SNOW_4_4 (a)&amp;lt;/code&amp;gt; snowy ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_CONCRETE&amp;lt;/code&amp;gt; concrete ground tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_WATER&amp;lt;/code&amp;gt; flat water tile&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;GROUNDSPRITE_CLEARED (a)&amp;lt;/code&amp;gt; ground tile that has just been bulldozed (with brown colour)&lt;br /&gt;
&lt;br /&gt;
(a) These constants can be used for sprites on flat ground. There are also equivalent sprites for sloped ground, however. These sprites follow the initial ground sprite, the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;slope_to_sprite_offset(&#039;&#039;slope&#039;&#039;)&amp;lt;/code&amp;gt; may be used to compute the required offset. Refer to the reference on [[NML:List of tile slopes|slopes]] or the [[#Example_.28advanced.29_Spritelayout|example]] below.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can set the value to (the name of) a [[NML:Spriteset|spriteset]], to provide a custom sprite. When the value is just a spriteset identifier, a sprite from that set will be selected depending on the construction stage, see below. All spritesets used in a layout &#039;&#039;&#039;must&#039;&#039;&#039; have the same number of sprites, due to a restriction in the NFO format. If you supply an argument (e.g. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite: some_sprite_set(2);&amp;lt;/code&amp;gt;), the corresponding sprite from the sprite set will be used, with an argument of 0 corresponding to the first sprite. Note that the argument may also be variable, so you could e.g. use &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite: some_set(construction_state);&amp;lt;/code&amp;gt; to use the construction state to select the sprite (as is the default). If the spriteset has labels defined, you can use these labels in the argument expression.&lt;br /&gt;
&lt;br /&gt;
* For stations, objects and airport tiles, there are no construction stages, so the first sprite from the set is used always.&lt;br /&gt;
* For houses and industry tiles, sprite chosen depends on the construction stage and the number of sprites available.&lt;br /&gt;
** If there is only one sprite in the set, it is used always.&lt;br /&gt;
** If there are two sprites, one is used during construction (stages 0-2) and one for the finished building (stage 3)&lt;br /&gt;
** If there are three sprites, one is used for the beginning of construction (stage 0), one for the other construction stages (stages 1-2) and one for the finished building (stage 3).&lt;br /&gt;
** If there are four sprites, one is used for each construction stage.&lt;br /&gt;
** Sprites after the first four are always ignored.&lt;br /&gt;
&lt;br /&gt;
===Recolouring===&lt;br /&gt;
&lt;br /&gt;
Next, you have the option to apply recolouring, i.e. to change the colours of the sprite. This is done via the following attributes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;recolour_mode&amp;lt;/code&amp;gt;: This must be compile-time constant. Available recolour modes are:&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;RECOLOUR_NONE&amp;lt;/code&amp;gt;: Use no colour translation (default)&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;RECOLOUR_REMAP&amp;lt;/code&amp;gt;: Use a colour translation table as defined by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;palette&amp;lt;/code&amp;gt;. This tables maps all colours of the sprite to a new colour.&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;RECOLOUR_TRANSPARENT&amp;lt;/code&amp;gt;: Draw the sprite in transparant mode, using a colour translation table as defined by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;palette&amp;lt;/code&amp;gt;. Normally the palette will be set to PALETTE_TO_TRANSPARANT to draw all underlying colours somewhat darker. Note that the selected palette is applied to the colours of the underlying sprite, whatever that happens to be. The supplied sprite is only used to determine what pixels to recolour.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;palette&amp;lt;/code&amp;gt;: This defines the palette which is used for the colour translation. It may only (and must!) be set when &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;recolour_mode&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;RECOLOUR_REMAP&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;RECOLOUR_TRANSPARENT&amp;lt;/code&amp;gt;. The available values are the same as for &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite&amp;lt;/code&amp;gt;, i.e. you can use either a default sprite or a sprite from a sprite set. In this case, however, the referenced sprite must not be a real sprite, but a [[NML:Recolour sprites|recolour sprite]]. For available default recolour sprites, see the appendix on [[NML:List of default colour translation palettes|available palettes]].&lt;br /&gt;
&lt;br /&gt;
===Display yes/no===&lt;br /&gt;
&lt;br /&gt;
The following attributes allow configuring whether the sprite will be displayed or not.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;hide_sprite&amp;lt;/code&amp;gt;: If set to 1, this sprite will not be drawn at all. Default is 0. If a building sprite is not drawn, all child sprites that share its bounding box are not drawn either. Setting this to a constant value makes little sense, but you can use this to enable/disable drawing certain sprites at runtime depending on certain conditions.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;always_draw&amp;lt;/code&amp;gt;: This must be a compile-time-constant. If set to 1, this sprite will also be drawn when the user has enabled transparant mode. The default value is 0. This is not available for ground sprites (those are drawn always), but it is for child sprites that share their bounding box with the ground sprite.&lt;br /&gt;
&lt;br /&gt;
===Positioning===&lt;br /&gt;
&lt;br /&gt;
How to position the sprite depends on the type of sprite:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ground&amp;lt;/code&amp;gt;: Ground sprites cannot be positioned.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building&amp;lt;/code&amp;gt;: A three-dimensional bounding box may be defined. The X-axis runs from top-right to bottom-left and the Y-axis from top-left to bottom-right. The Z axis is vertical. All units are relative to the tile, with a tile being 16 units in the X and Y directions. Extending the bounding box over the edges of a tile is possible, but not recommended as it may lead to glitches. To define the bounding box, the following attributes can be used:&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;xoffset&amp;lt;/code&amp;gt;: Offset from the northwestern edge to the start of the bounding box (X).&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;yoffset&amp;lt;/code&amp;gt;: Offset from the northeastern edge to the start of the bounding box (Y).&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;zoffset&amp;lt;/code&amp;gt;: Offset from the lowest tile corner (with foundation added) to the start of the bounding box (Z).&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;xextent&amp;lt;/code&amp;gt;: Size of the bounding box, in the X-direction. Must be a compile-time constant.&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;yextent&amp;lt;/code&amp;gt;: Size of the bounding box, in the Y-direction. Must be a compile-time constant.&lt;br /&gt;
** &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;zextent&amp;lt;/code&amp;gt;: Size of the bounding box, in the Z-direction. Must be a compile-time constant.  Default values are 0, 0, 0, 16, 16, 16, respectively. In NewGRF developer mode in OpenTTD, it&#039;s possible to view the bounding boxes of all sprites by pressing Ctrl+B.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;childsprite&amp;lt;/code&amp;gt;: Child sprites may be positioned relative to their &#039;parent&#039; sprite that defines the bounding box. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;xoffset&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;yoffset&amp;lt;/code&amp;gt; may be set to specify an offset in pixels between the origin of the parent and child sprite. When the parent sprite is the ground sprite, TTDPatch does not support offsets other than 0,0. Note that all child sprites should fit inside the bounding box of the parent sprite to avoid visual glitches.&lt;br /&gt;
&lt;br /&gt;
===Example (advanced) Spritelayout===&lt;br /&gt;
&lt;br /&gt;
OpenTTD 1.2 (r22723) allows for nice shorthands in defining multiple views, e.g. for different slopes: Spritelayout can have parameters and may use variables and temporary storage inside of a layout. A common usage for such parametrized spritelayout is taking care of the tile slope and ground type as illustrated in this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 spritelayout company_land_layout {&lt;br /&gt;
 	ground {&lt;br /&gt;
 		// normal ground sprite - always draw&lt;br /&gt;
 		sprite: LOAD_TEMP(0) + LOAD_TEMP(1);&lt;br /&gt;
 	}&lt;br /&gt;
 	childsprite {&lt;br /&gt;
 		// company-coloured border - always draw&lt;br /&gt;
 		sprite:        cc_frame(LOAD_TEMP(0));&lt;br /&gt;
 		always_draw:   1;&lt;br /&gt;
 		recolour_mode: RECOLOUR_REMAP;&lt;br /&gt;
 		palette:       PALETTE_USE_DEFAULT;&lt;br /&gt;
 	}&lt;br /&gt;
 	childsprite {&lt;br /&gt;
 		// again the normal ground sprite. Thus in non-transparent view&lt;br /&gt;
 		// only the normal ground sprite is shown. In transparent view&lt;br /&gt;
 		// this acts as sprite which darkens the other two sprites via&lt;br /&gt;
 		// a translation to transparency.&lt;br /&gt;
 		sprite: LOAD_TEMP(0) + LOAD_TEMP(1);&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // A pseudo-switch which sets the temporary parameters for the sprite layout, storing the sprite number&lt;br /&gt;
 // which belongs to the terrain type and the corresponding offset due to the tile slope&lt;br /&gt;
 switch (FEAT_OBJECTS, SELF, company_land_terrain_switch, [&lt;br /&gt;
 			// We store the offset into the spriteset due to the tile slope into the 1st temporary variable&lt;br /&gt;
 			STORE_TEMP(slope_to_sprite_offset(tile_slope), 0),&lt;br /&gt;
 &lt;br /&gt;
 			// We store the offset to the flat groundsprite we use into the 2nd temporary variable&lt;br /&gt;
 			STORE_TEMP(GROUNDSPRITE_NORMAL, 1),&lt;br /&gt;
 			STORE_TEMP(terrain_type == TILETYPE_DESERT      ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1),&lt;br /&gt;
 			STORE_TEMP(terrain_type == TILETYPE_SNOW        ? GROUNDSPRITE_SNOW   : LOAD_TEMP(1), 1),&lt;br /&gt;
 &lt;br /&gt;
 			1&lt;br /&gt;
 			]) {&lt;br /&gt;
 	company_land_layout;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2918</id>
		<title>NML:Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2918"/>
		<updated>2011-12-13T22:37:46Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Industry callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on both industry and industry tile properties, variables and callbacks.&lt;br /&gt;
&lt;br /&gt;
==Industry properties==&lt;br /&gt;
&lt;br /&gt;
Industry properties. Default industry type numbers can be found at [[NML:Default industries|default industries]].&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;
| substitute&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). This &#039;&#039;must&#039;&#039; be the first property to be set, before any other properties or graphics. All properties of the old type are copied to your new industry.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| Array of tilelayouts&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Tilelayout|Tilelayout]] syntax.&lt;br /&gt;
|-&lt;br /&gt;
| life_type&lt;br /&gt;
| One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; EXTRACTIVE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ORGANIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; PROCESSING&lt;br /&gt;
| The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.&lt;br /&gt;
|-&lt;br /&gt;
| closure_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when the industry announces closure. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_increase_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry increases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_decrease_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry decreases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| fund_cost_multiplier&lt;br /&gt;
| 0..255&lt;br /&gt;
| Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)&lt;br /&gt;
|-&lt;br /&gt;
| min_cargo_distr&lt;br /&gt;
| 0..255&lt;br /&gt;
| Minimal amount of cargo before transporting to stations.&lt;br /&gt;
|-&lt;br /&gt;
| random_sound_effects&lt;br /&gt;
| array of ints&lt;br /&gt;
| Sound effect numbers that are played some times.&lt;br /&gt;
|-&lt;br /&gt;
| conflicting_ind_types&lt;br /&gt;
| array of up to 3x industry_type(IND_TYPE_OLD &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; IND_TYPE_NEW, id)&lt;br /&gt;
|&lt;br /&gt;
Three industry types that should not be nearby. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;industry_type(..)&amp;lt;/code&amp;gt; to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).&lt;br /&gt;
|-&lt;br /&gt;
| prob_random&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while generating initial industries.&lt;br /&gt;
|-&lt;br /&gt;
| prob_in_game&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while creating industries during the game.&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour index from the [[NML:Graphic files|DOS palette]] to use on the minimap for this industry.&lt;br /&gt;
|-&lt;br /&gt;
| spec_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
for flag values see [[#industry_special_flags|Industry special flags]]&lt;br /&gt;
|-&lt;br /&gt;
| new_ind_msg&lt;br /&gt;
| string&lt;br /&gt;
| Message displayed when industry gets built during game play.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_1&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the first accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the second accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the third accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Name of the industry, use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prospect_chance&lt;br /&gt;
| 0 .. 1 (float)&lt;br /&gt;
| Chance of successful prospecting.&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(flags)&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;
| remove_cost_multiplier&lt;br /&gt;
| int&lt;br /&gt;
| Cost multiplier for removing the industry (currently only possible with magic bulldozer).&lt;br /&gt;
|-&lt;br /&gt;
| nearby_station_name&lt;br /&gt;
| string&lt;br /&gt;
| Default additional name for a nearby station&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Industry special flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! flag&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_PERIODICALLY&lt;br /&gt;
| The industry periodically plants fields around itself (temperate and arctic farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CUT_TREES&lt;br /&gt;
| The industry cuts trees around itself and produces its first output cargo from them (lumber mill)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ON_WATER&lt;br /&gt;
| The industry is built on water (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_LARGE_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_NEAR_TOWN&lt;br /&gt;
| The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_WHEN_BUILT&lt;br /&gt;
| Fields are planted around the industry when it&#039;s built (all farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_NO_PRODUCTION_INCREASE&lt;br /&gt;
| The industry cannot increase its production on the temperate climate (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_BEFORE_1950&lt;br /&gt;
| The industry is built only before 1950 (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_AFTER_1960&lt;br /&gt;
| The industry is built only after 1960 (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES&lt;br /&gt;
| AI players will attempt to establish air and ship routes going to this industry (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military airplane (oil refinery)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military helicopter (factory)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CAN_CAUSE_SUBSIDENCE&lt;br /&gt;
| The industry can cause a subsidence (coal mine)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER&lt;br /&gt;
| Automatic production multiplier handing (No industry has this bit set by default.).&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK&lt;br /&gt;
| The production callback needs random bits in var. 10 (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION&lt;br /&gt;
| Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE&lt;br /&gt;
| Allow closing down the last instance of this type (No industry has this bit set by default.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| substitute&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| Number of the default industry tile that replaces this one, if this industry tile is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| id of the default industry tile which this industry tile replaces. This will cause your industry tile to be placed instead of the default industry tile. This is ignored, if the default industry tile has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by this tile. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile accept both COAL and IORE you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[COAL, 8], [IORE, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a tile that doesn&#039;t any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| land_shape_flags&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Land shape flags|Land shape flags]])&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(INDTILE_CBF_XXX, INDTILE_CBF_YYY)&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;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_INDTILE_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|-&lt;br /&gt;
| special_flags&lt;br /&gt;
| bitmask(INDTILE_FLAG_XXX)&lt;br /&gt;
| XXX is a special flag description. Currently there&#039;s only one flag defined: set INDTILE_FLAG_RANDOM_ANIMATION if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NW_EDGE&lt;br /&gt;
| North-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NE_EDGE&lt;br /&gt;
| North-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SW_EDGE&lt;br /&gt;
| South-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SE_EDGE&lt;br /&gt;
| South-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ONLY_ON_FLAT_LAND&lt;br /&gt;
| This tile can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ALLOW_ON_WATER&lt;br /&gt;
| The land/water check is disabled for this tile so it can be built on water. If you need more control over this use callback 0x2F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Common variables==&lt;br /&gt;
&lt;br /&gt;
The following variables are available to both industries and industry tiles. All of them require an x, y offset. For industries, this offset is unsigned and relative to the northernmost tile. For industry tiles, it is signed and relative to the current tile.&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;
| nearby_tile_slope&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of tile slopes|tile slopes]] for an overview of possible values&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| 0..120&lt;br /&gt;
| The height of the lowest corner of the given tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_industrytile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an industry tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original industry tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an industry tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an industry tile or it belongs to another GRF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry 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;
| production_level&lt;br /&gt;
| 0, or 4 .. 128&lt;br /&gt;
| Current production level of the industry. Usually in range 4 .. 128, default starting level is 16. A level of 0 indicates imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the first cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the second cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_3&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the third cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 1&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 2&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_1&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 1&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_2&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 2&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| water_distance&lt;br /&gt;
| Distance to the tile&lt;br /&gt;
| If the industry is built on water, this variable gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile.&lt;br /&gt;
|-&lt;br /&gt;
| layout_num&lt;br /&gt;
| 1..255&lt;br /&gt;
| Number of the layout being used by the industry.&lt;br /&gt;
|-&lt;br /&gt;
| founder&lt;br /&gt;
| 0..16&lt;br /&gt;
| Company number of the industry founder. It will be FOUNDER_GAME (=16) if the industry was generated randomly. TTDPatch only supports up to 8 companies (0..7).&lt;br /&gt;
|-&lt;br /&gt;
| founder_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| founder_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s first colour. 0 if not founded by a company. 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;
| founder_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s second colour. It&#039;s the same as company_colour1, if no second company colour is chosen. 0 if not founded by a company. 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;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Random colour for this industry. 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;
| build_date&lt;br /&gt;
| 0..1826212865&lt;br /&gt;
| Date of the industry foundation in days since year 0.&lt;br /&gt;
|-&lt;br /&gt;
| build_type&lt;br /&gt;
| BUILDTYPE_XX&lt;br /&gt;
| BUILDTYPE_UNKNOWN (if created in an old version or with newindustries disabled), BUILDTYPE_GAMEPLAY (if founded or created by the in-game random industry generator), BUILDTYPE_GENERATION (if created during random map generation) or BUILDTYPE_EDITOR (if created with the scenario editor).&lt;br /&gt;
|-&lt;br /&gt;
| counter&lt;br /&gt;
| 0..65535&lt;br /&gt;
| Decremented every tick, used to time primary industry production in TTD.&lt;br /&gt;
|-&lt;br /&gt;
| last_accept_date&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| Date when cargo was accepted for the last time. Not valid before 1920 and after 2090.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| Random data that can be used to randomize certain descisions. (see [[NML:Random_switch|Random switch]]) (NML r1666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Variables that require some parameters.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| industry_count&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
|&lt;br /&gt;
The value of this variable is the number of industries of a given type that are currently on the map. industry_type is either the ID of an industry. GRFid is the grf in which the industry was defined. The default value is -1, which means current newgrf. A grfid of 0 lets you check the number of default industries of a given type. 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 a grfid to its numeric representation.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_distance&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
| The value of this variable is the manhattan distance the closest instance of the given industry or 0xFFFF if not applicable. See industry_count for a description of the parameters.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_layout_count / industry_layout_distance&lt;br /&gt;
| industry_type, layout, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the given layout number.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_town_count&lt;br /&gt;
| industry_type, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the same town than the current industry.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the Manhattan distance (dx + dy) from the selected tile to the closest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the squared Eucleidean distance (dx^2 + dy^2) from the selected tile to the closest town.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| x, y&lt;br /&gt;
|&lt;br /&gt;
Parameters indicate a signed offset relative to the northern tile. Returns the [[NML:List of town zones|town zone]] that the selected tile is in.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate an unsigned offset relative to the northern tile. Returns the random bits of the selected industry tile, or 0 if it is not an industry tile that&#039;s part of this industry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the industry tile.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Industry tiles have access to the [[#Common variables|common variables]] described above. Additionally, they have access to the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed tile offset relative to the current tile. Returns 1 if the tile is part of the same industry, 0 otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| varies&lt;br /&gt;
| Any unhandled callbacks. Generally this doesn&#039;t need to be used, except for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| produce_cargo_arrival&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo every 256 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| CB_RESULT_IND_ALLOW or CB_RESULT_IND_DISALLOW&lt;br /&gt;
|&lt;br /&gt;
Only available in NML 0.2 or earlier. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]].&lt;br /&gt;
|-&lt;br /&gt;
| construction_probability&lt;br /&gt;
| CB_RESULT_IND_NO_CONSTRUCTION, CB_RESULT_IND_PROBABILITY_FROM_PROPERTY or a relative probability 0..255&lt;br /&gt;
|&lt;br /&gt;
Only available in NML 0.3 or later. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]]. If you return CB_RESULT_IND_NO_CONSTRUCTION or 0 the industry won&#039;t be build. If you return CB_RESULT_IND_PROBABILITY_FROM_PROPERTY it&#039;ll be build according to the relative probability as defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_random&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_in_game&amp;lt;/code&amp;gt; properties, otherwise it&#039;ll use the value as returned as relative probability.&lt;br /&gt;
|-&lt;br /&gt;
| location_check&lt;br /&gt;
|&lt;br /&gt;
See the [[#Location check results|table]] below.&lt;br /&gt;
|&lt;br /&gt;
Called to check if a location is suitable. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]]. Since the industry isn&#039;t built yet, industry variables aren&#039;t available. If this callback is not implemented or fails, constructing the industry will be allowed. Construction might also be prevented via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; industry tile callback, though.&lt;br /&gt;
|-&lt;br /&gt;
| monthly_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Called each month to (possibly) change the industry production. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&lt;br /&gt;
|-&lt;br /&gt;
| random_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Works exactly the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;monthly_prod_change&amp;lt;/code&amp;gt;, except that it&#039;s only called when TTD selects this industry for a random production change.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_display&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning CB_RESULT_NO_TEXT displays nothing. The lowest byte of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains 0 .. 2 to get texts for the first .. third accepted cargo type, and 3 .. 4 for the first ... second produced cargo type. The second byte contains 0 when getting a string for the buy menu (no industry variables available!), 1 when for the industry window and 2 for the industry directory window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_industry&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the industry window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_fund&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the fund window. Since the industry isn&#039;t built, no industry variables are available.&lt;br /&gt;
|-&lt;br /&gt;
| control_special&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called to control various effects from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spec_flags&amp;lt;/code&amp;gt; property. Currently only works for the first two (plant fields / cut trees). Return 1 to execute the action or 0 to not do so. The relevant flag is given in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;. The default (if the flag is enabled, of course) is to plant fields with 1/8th chance every 256 ticks, and to cut trees every 512 ticks. Random bits are supplied in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| stop_accept_cargo&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| With this callback, you can temporarily refuse accepting a certain cargo, for example because the stockpile is full. Return 1 to accept or 0 to refuse. Make sure to synchronize this callback with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_amount_accept&amp;lt;/code&amp;gt; callback for industry tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the cargo type to accept or not.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Called after constructing the industry. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour&amp;lt;/code&amp;gt; variable is set to a random value at this point, you can use this callback to change this.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_input&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Decide the input cargo types. Called repeatedly until 0xFF is returned, although currently not more than three times. Do not rely on this limitation, though. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; starts at 0 and is incremented for every iteration. Return a cargo type (from the table) or 0xFF to stop.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_output&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_input&amp;lt;/code&amp;gt; above, except that it is applied to the output cargo types and currently not called more than twice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Location check results===&lt;br /&gt;
&lt;br /&gt;
The following values can be used as return values for the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;location_check&amp;lt;/code&amp;gt; callback for industries&lt;br /&gt;
and the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; callback for industry tiles and objects.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! return value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| string(..)&lt;br /&gt;
| Item can&#039;t be built, show the string as error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_ALLOW&lt;br /&gt;
| Item can be built.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW&lt;br /&gt;
| Item can&#039;t be built, display the default error message. This is &amp;quot;site unsuitable&amp;quot; for industries and industry tiles, and &amp;quot;land sloped in wrong direction&amp;quot; for objects.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_RAINFOREST&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in rainforest areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_DESERT&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in desert areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_ABOVE_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built above the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_BELOW_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built below the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_OPEN_SEA&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on open sea&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_CANAL&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on canal&amp;quot; error message&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_RIVER&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on river&amp;quot; error message.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Production change callback results===&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;
| CB_RESULT_IND_PROD_NO_CHANGE&lt;br /&gt;
| Do not change industry production&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_HALF&lt;br /&gt;
| Half industry production. If production goes below a quarter of default, the industry closes.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DOUBLE&lt;br /&gt;
| Double production if it&#039;s not 8x default yet.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_CLOSE&lt;br /&gt;
| Announce closoure and remove the industry next month.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_RANDOM&lt;br /&gt;
| Do a random production change, as if the industry is a primary one.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_4&lt;br /&gt;
| Divide production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_8&lt;br /&gt;
| Divide production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_16&lt;br /&gt;
| Divide production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_32&lt;br /&gt;
| Divide production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_4&lt;br /&gt;
| Multiply production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_8&lt;br /&gt;
| Multiply production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_16&lt;br /&gt;
| Multiply production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_32&lt;br /&gt;
| Multiply production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DECREMENT_BY_1&lt;br /&gt;
| Decrement production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_INCREMENT_BY_1&lt;br /&gt;
| Increment production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_SET_BY_0x100&lt;br /&gt;
| Set the production level to the value in bits 16 .. 23 of register 0x100.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting bit 7 of the result disables the associated news message.&amp;lt;br /&amp;gt; Setting bit 8 replaces the news message with a custom message, read from register 0x100 bits 0 .. 15.&lt;br /&gt;
&lt;br /&gt;
===Industry creation types===&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;
| IND_CREATION_GENERATION&lt;br /&gt;
| Industry is created during map generation, or when building &#039;many random industries&#039; in the scenario editor.&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_RANDOM&lt;br /&gt;
| Industry is randomly generated during gameplay&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_FUND&lt;br /&gt;
| Industry is funded by the player (in game or scenario editor)&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_PROSPECT&lt;br /&gt;
| Industry is prospected by the player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the industry tile&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the reason to trigger the animation, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Cargo types are from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[#Location check results|location_check]] industry callback&lt;br /&gt;
|&lt;br /&gt;
Called before constructing the industry, so nothing exists on the map yet. Since the industry isn&#039;t built yet, so you can&#039;t access industry variables. From the tile variables, relative x/y/position, town zone are available, as well as the class, height, slope, terrain type and water status of nearby tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the industry layout number in the lowest (first) byte and the [[#Industry creation types|creation type]] in the second byte. If this callback is not implemented or fails, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;land_shape_flags&amp;lt;/code&amp;gt; property will be used instead to determine if the slope is suitable. This also means that without this callback, the tile may not be built on steep slopes.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|-&lt;br /&gt;
| autoslope&lt;br /&gt;
| CB_RESULT[_NO]_AUTOSLOPE&lt;br /&gt;
| Return CB_RESULT_AUTOSLOPE to allow autoslope (altering the ground below a tile) or CB_RESULT_NO_AUTOSLOPE to disallow it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Trigger&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE&lt;br /&gt;
| the construction state changes&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_TILE_LOOP&lt;br /&gt;
| the tile is processed in the periodic processing loop&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_INDUSTRY_LOOP&lt;br /&gt;
| the industry of the tile is processed in the periodic processing loop (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_RECEIVED_CARGO&lt;br /&gt;
| the industry of the tile receives input cargo from a station (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_DISTRIBUTES_CARGO&lt;br /&gt;
| the industry distributes its output cargo to one of the stations nearby (synchronized for all tiles)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2917</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=2917"/>
		<updated>2011-12-13T22:20:34Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Vehicle callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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_CLIMATES&amp;lt;/code&amp;gt;&lt;br /&gt;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&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;
| 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 two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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 HEQS 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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2916</id>
		<title>NML:Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2916"/>
		<updated>2011-12-13T22:17:06Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Industry callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on both industry and industry tile properties, variables and callbacks.&lt;br /&gt;
&lt;br /&gt;
==Industry properties==&lt;br /&gt;
&lt;br /&gt;
Industry properties. Default industry type numbers can be found at [[NML:Default industries|default industries]].&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;
| substitute&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). This &#039;&#039;must&#039;&#039; be the first property to be set, before any other properties or graphics. All properties of the old type are copied to your new industry.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| Array of tilelayouts&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Tilelayout|Tilelayout]] syntax.&lt;br /&gt;
|-&lt;br /&gt;
| life_type&lt;br /&gt;
| One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; EXTRACTIVE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ORGANIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; PROCESSING&lt;br /&gt;
| The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.&lt;br /&gt;
|-&lt;br /&gt;
| closure_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when the industry announces closure. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_increase_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry increases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_decrease_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry decreases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| fund_cost_multiplier&lt;br /&gt;
| 0..255&lt;br /&gt;
| Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)&lt;br /&gt;
|-&lt;br /&gt;
| min_cargo_distr&lt;br /&gt;
| 0..255&lt;br /&gt;
| Minimal amount of cargo before transporting to stations.&lt;br /&gt;
|-&lt;br /&gt;
| random_sound_effects&lt;br /&gt;
| array of ints&lt;br /&gt;
| Sound effect numbers that are played some times.&lt;br /&gt;
|-&lt;br /&gt;
| conflicting_ind_types&lt;br /&gt;
| array of up to 3x industry_type(IND_TYPE_OLD &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; IND_TYPE_NEW, id)&lt;br /&gt;
|&lt;br /&gt;
Three industry types that should not be nearby. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;industry_type(..)&amp;lt;/code&amp;gt; to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).&lt;br /&gt;
|-&lt;br /&gt;
| prob_random&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while generating initial industries.&lt;br /&gt;
|-&lt;br /&gt;
| prob_in_game&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while creating industries during the game.&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour index from the [[NML:Graphic files|DOS palette]] to use on the minimap for this industry.&lt;br /&gt;
|-&lt;br /&gt;
| spec_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
for flag values see [[#industry_special_flags|Industry special flags]]&lt;br /&gt;
|-&lt;br /&gt;
| new_ind_msg&lt;br /&gt;
| string&lt;br /&gt;
| Message displayed when industry gets built during game play.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_1&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the first accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the second accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the third accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Name of the industry, use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prospect_chance&lt;br /&gt;
| 0 .. 1 (float)&lt;br /&gt;
| Chance of successful prospecting.&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(flags)&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;
| remove_cost_multiplier&lt;br /&gt;
| int&lt;br /&gt;
| Cost multiplier for removing the industry (currently only possible with magic bulldozer).&lt;br /&gt;
|-&lt;br /&gt;
| nearby_station_name&lt;br /&gt;
| string&lt;br /&gt;
| Default additional name for a nearby station&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Industry special flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! flag&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_PERIODICALLY&lt;br /&gt;
| The industry periodically plants fields around itself (temperate and arctic farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CUT_TREES&lt;br /&gt;
| The industry cuts trees around itself and produces its first output cargo from them (lumber mill)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ON_WATER&lt;br /&gt;
| The industry is built on water (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_LARGE_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_NEAR_TOWN&lt;br /&gt;
| The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_WHEN_BUILT&lt;br /&gt;
| Fields are planted around the industry when it&#039;s built (all farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_NO_PRODUCTION_INCREASE&lt;br /&gt;
| The industry cannot increase its production on the temperate climate (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_BEFORE_1950&lt;br /&gt;
| The industry is built only before 1950 (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_AFTER_1960&lt;br /&gt;
| The industry is built only after 1960 (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES&lt;br /&gt;
| AI players will attempt to establish air and ship routes going to this industry (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military airplane (oil refinery)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military helicopter (factory)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CAN_CAUSE_SUBSIDENCE&lt;br /&gt;
| The industry can cause a subsidence (coal mine)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER&lt;br /&gt;
| Automatic production multiplier handing (No industry has this bit set by default.).&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK&lt;br /&gt;
| The production callback needs random bits in var. 10 (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION&lt;br /&gt;
| Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE&lt;br /&gt;
| Allow closing down the last instance of this type (No industry has this bit set by default.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| substitute&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| Number of the default industry tile that replaces this one, if this industry tile is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| id of the default industry tile which this industry tile replaces. This will cause your industry tile to be placed instead of the default industry tile. This is ignored, if the default industry tile has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by this tile. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile accept both COAL and IORE you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[COAL, 8], [IORE, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a tile that doesn&#039;t any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| land_shape_flags&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Land shape flags|Land shape flags]])&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(INDTILE_CBF_XXX, INDTILE_CBF_YYY)&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;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_INDTILE_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|-&lt;br /&gt;
| special_flags&lt;br /&gt;
| bitmask(INDTILE_FLAG_XXX)&lt;br /&gt;
| XXX is a special flag description. Currently there&#039;s only one flag defined: set INDTILE_FLAG_RANDOM_ANIMATION if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NW_EDGE&lt;br /&gt;
| North-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NE_EDGE&lt;br /&gt;
| North-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SW_EDGE&lt;br /&gt;
| South-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SE_EDGE&lt;br /&gt;
| South-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ONLY_ON_FLAT_LAND&lt;br /&gt;
| This tile can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ALLOW_ON_WATER&lt;br /&gt;
| The land/water check is disabled for this tile so it can be built on water. If you need more control over this use callback 0x2F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Common variables==&lt;br /&gt;
&lt;br /&gt;
The following variables are available to both industries and industry tiles. All of them require an x, y offset. For industries, this offset is unsigned and relative to the northernmost tile. For industry tiles, it is signed and relative to the current tile.&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;
| nearby_tile_slope&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of tile slopes|tile slopes]] for an overview of possible values&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| 0..120&lt;br /&gt;
| The height of the lowest corner of the given tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_industrytile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an industry tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original industry tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an industry tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an industry tile or it belongs to another GRF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry 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;
| production_level&lt;br /&gt;
| 0, or 4 .. 128&lt;br /&gt;
| Current production level of the industry. Usually in range 4 .. 128, default starting level is 16. A level of 0 indicates imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the first cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the second cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_3&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the third cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 1&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 2&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_1&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 1&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_2&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 2&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| water_distance&lt;br /&gt;
| Distance to the tile&lt;br /&gt;
| If the industry is built on water, this variable gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile.&lt;br /&gt;
|-&lt;br /&gt;
| layout_num&lt;br /&gt;
| 1..255&lt;br /&gt;
| Number of the layout being used by the industry.&lt;br /&gt;
|-&lt;br /&gt;
| founder&lt;br /&gt;
| 0..16&lt;br /&gt;
| Company number of the industry founder. It will be FOUNDER_GAME (=16) if the industry was generated randomly. TTDPatch only supports up to 8 companies (0..7).&lt;br /&gt;
|-&lt;br /&gt;
| founder_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| founder_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s first colour. 0 if not founded by a company. 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;
| founder_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s second colour. It&#039;s the same as company_colour1, if no second company colour is chosen. 0 if not founded by a company. 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;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Random colour for this industry. 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;
| build_date&lt;br /&gt;
| 0..1826212865&lt;br /&gt;
| Date of the industry foundation in days since year 0.&lt;br /&gt;
|-&lt;br /&gt;
| build_type&lt;br /&gt;
| BUILDTYPE_XX&lt;br /&gt;
| BUILDTYPE_UNKNOWN (if created in an old version or with newindustries disabled), BUILDTYPE_GAMEPLAY (if founded or created by the in-game random industry generator), BUILDTYPE_GENERATION (if created during random map generation) or BUILDTYPE_EDITOR (if created with the scenario editor).&lt;br /&gt;
|-&lt;br /&gt;
| counter&lt;br /&gt;
| 0..65535&lt;br /&gt;
| Decremented every tick, used to time primary industry production in TTD.&lt;br /&gt;
|-&lt;br /&gt;
| last_accept_date&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| Date when cargo was accepted for the last time. Not valid before 1920 and after 2090.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| Random data that can be used to randomize certain descisions. (see [[NML:Random_switch|Random switch]]) (NML r1666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Variables that require some parameters.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| industry_count&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
|&lt;br /&gt;
The value of this variable is the number of industries of a given type that are currently on the map. industry_type is either the ID of an industry. GRFid is the grf in which the industry was defined. The default value is -1, which means current newgrf. A grfid of 0 lets you check the number of default industries of a given type. 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 a grfid to its numeric representation.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_distance&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
| The value of this variable is the manhattan distance the closest instance of the given industry or 0xFFFF if not applicable. See industry_count for a description of the parameters.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_layout_count / industry_layout_distance&lt;br /&gt;
| industry_type, layout, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the given layout number.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_town_count&lt;br /&gt;
| industry_type, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the same town than the current industry.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the Manhattan distance (dx + dy) from the selected tile to the closest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the squared Eucleidean distance (dx^2 + dy^2) from the selected tile to the closest town.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| x, y&lt;br /&gt;
|&lt;br /&gt;
Parameters indicate a signed offset relative to the northern tile. Returns the [[NML:List of town zones|town zone]] that the selected tile is in.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate an unsigned offset relative to the northern tile. Returns the random bits of the selected industry tile, or 0 if it is not an industry tile that&#039;s part of this industry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the industry tile.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Industry tiles have access to the [[#Common variables|common variables]] described above. Additionally, they have access to the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed tile offset relative to the current tile. Returns 1 if the tile is part of the same industry, 0 otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| varies&lt;br /&gt;
| Any unhandled callbacks. Generally this doesn&#039;t need to be used, except for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| produce_cargo_arrival&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo every 256 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| CB_RESULT_IND_ALLOW or CB_RESULT_IND_DISALLOW&lt;br /&gt;
|&lt;br /&gt;
Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]].&lt;br /&gt;
|-&lt;br /&gt;
| location_check&lt;br /&gt;
|&lt;br /&gt;
See the [[#Location check results|table]] below.&lt;br /&gt;
|&lt;br /&gt;
Called to check if a location is suitable. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]]. Since the industry isn&#039;t built yet, industry variables aren&#039;t available. If this callback is not implemented or fails, constructing the industry will be allowed. Construction might also be prevented via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; industry tile callback, though.&lt;br /&gt;
|-&lt;br /&gt;
| monthly_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Called each month to (possibly) change the industry production. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&lt;br /&gt;
|-&lt;br /&gt;
| random_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Works exactly the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;monthly_prod_change&amp;lt;/code&amp;gt;, except that it&#039;s only called when TTD selects this industry for a random production change.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_display&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning CB_RESULT_NO_TEXT displays nothing. The lowest byte of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains 0 .. 2 to get texts for the first .. third accepted cargo type, and 3 .. 4 for the first ... second produced cargo type. The second byte contains 0 when getting a string for the buy menu (no industry variables available!), 1 when for the industry window and 2 for the industry directory window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_industry&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the industry window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_fund&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the fund window. Since the industry isn&#039;t built, no industry variables are available.&lt;br /&gt;
|-&lt;br /&gt;
| control_special&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called to control various effects from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spec_flags&amp;lt;/code&amp;gt; property. Currently only works for the first two (plant fields / cut trees). Return 1 to execute the action or 0 to not do so. The relevant flag is given in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;. The default (if the flag is enabled, of course) is to plant fields with 1/8th chance every 256 ticks, and to cut trees every 512 ticks. Random bits are supplied in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| stop_accept_cargo&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| With this callback, you can temporarily refuse accepting a certain cargo, for example because the stockpile is full. Return 1 to accept or 0 to refuse. Make sure to synchronize this callback with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_amount_accept&amp;lt;/code&amp;gt; callback for industry tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the cargo type to accept or not.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Called after constructing the industry. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour&amp;lt;/code&amp;gt; variable is set to a random value at this point, you can use this callback to change this.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_input&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Decide the input cargo types. Called repeatedly until 0xFF is returned, although currently not more than three times. Do not rely on this limitation, though. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; starts at 0 and is incremented for every iteration. Return a cargo type (from the table) or 0xFF to stop.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_output&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_input&amp;lt;/code&amp;gt; above, except that it is applied to the output cargo types and currently not called more than twice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Location check results===&lt;br /&gt;
&lt;br /&gt;
The following values can be used as return values for the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;location_check&amp;lt;/code&amp;gt; callback for industries&lt;br /&gt;
and the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; callback for industry tiles and objects.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! return value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| string(..)&lt;br /&gt;
| Item can&#039;t be built, show the string as error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_ALLOW&lt;br /&gt;
| Item can be built.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW&lt;br /&gt;
| Item can&#039;t be built, display the default error message. This is &amp;quot;site unsuitable&amp;quot; for industries and industry tiles, and &amp;quot;land sloped in wrong direction&amp;quot; for objects.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_RAINFOREST&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in rainforest areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_DESERT&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in desert areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_ABOVE_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built above the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_BELOW_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built below the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_OPEN_SEA&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on open sea&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_CANAL&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on canal&amp;quot; error message&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_RIVER&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on river&amp;quot; error message.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Production change callback results===&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;
| CB_RESULT_IND_PROD_NO_CHANGE&lt;br /&gt;
| Do not change industry production&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_HALF&lt;br /&gt;
| Half industry production. If production goes below a quarter of default, the industry closes.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DOUBLE&lt;br /&gt;
| Double production if it&#039;s not 8x default yet.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_CLOSE&lt;br /&gt;
| Announce closoure and remove the industry next month.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_RANDOM&lt;br /&gt;
| Do a random production change, as if the industry is a primary one.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_4&lt;br /&gt;
| Divide production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_8&lt;br /&gt;
| Divide production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_16&lt;br /&gt;
| Divide production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_32&lt;br /&gt;
| Divide production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_4&lt;br /&gt;
| Multiply production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_8&lt;br /&gt;
| Multiply production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_16&lt;br /&gt;
| Multiply production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_32&lt;br /&gt;
| Multiply production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DECREMENT_BY_1&lt;br /&gt;
| Decrement production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_INCREMENT_BY_1&lt;br /&gt;
| Increment production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_SET_BY_0x100&lt;br /&gt;
| Set the production level to the value in bits 16 .. 23 of register 0x100.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting bit 7 of the result disables the associated news message.&amp;lt;br /&amp;gt; Setting bit 8 replaces the news message with a custom message, read from register 0x100 bits 0 .. 15.&lt;br /&gt;
&lt;br /&gt;
===Industry creation types===&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;
| IND_CREATION_GENERATION&lt;br /&gt;
| Industry is created during map generation, or when building &#039;many random industries&#039; in the scenario editor.&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_RANDOM&lt;br /&gt;
| Industry is randomly generated during gameplay&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_FUND&lt;br /&gt;
| Industry is funded by the player (in game or scenario editor)&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_PROSPECT&lt;br /&gt;
| Industry is prospected by the player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the industry tile&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the reason to trigger the animation, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Cargo types are from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[#Location check results|location_check]] industry callback&lt;br /&gt;
|&lt;br /&gt;
Called before constructing the industry, so nothing exists on the map yet. Since the industry isn&#039;t built yet, so you can&#039;t access industry variables. From the tile variables, relative x/y/position, town zone are available, as well as the class, height, slope, terrain type and water status of nearby tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the industry layout number in the lowest (first) byte and the [[#Industry creation types|creation type]] in the second byte. If this callback is not implemented or fails, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;land_shape_flags&amp;lt;/code&amp;gt; property will be used instead to determine if the slope is suitable. This also means that without this callback, the tile may not be built on steep slopes.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|-&lt;br /&gt;
| autoslope&lt;br /&gt;
| CB_RESULT[_NO]_AUTOSLOPE&lt;br /&gt;
| Return CB_RESULT_AUTOSLOPE to allow autoslope (altering the ground below a tile) or CB_RESULT_NO_AUTOSLOPE to disallow it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Trigger&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE&lt;br /&gt;
| the construction state changes&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_TILE_LOOP&lt;br /&gt;
| the tile is processed in the periodic processing loop&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_INDUSTRY_LOOP&lt;br /&gt;
| the industry of the tile is processed in the periodic processing loop (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_RECEIVED_CARGO&lt;br /&gt;
| the industry of the tile receives input cargo from a station (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_DISTRIBUTES_CARGO&lt;br /&gt;
| the industry distributes its output cargo to one of the stations nearby (synchronized for all tiles)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2908</id>
		<title>NML:Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=2908"/>
		<updated>2011-12-11T18:38:19Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Fix range for prob_random / prob_in_game&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on both industry and industry tile properties, variables and callbacks.&lt;br /&gt;
&lt;br /&gt;
==Industry properties==&lt;br /&gt;
&lt;br /&gt;
Industry properties. Default industry type numbers can be found at [[NML:Default industries|default industries]].&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;
| substitute&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). This &#039;&#039;must&#039;&#039; be the first property to be set, before any other properties or graphics. All properties of the old type are copied to your new industry.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| Array of tilelayouts&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Tilelayout|Tilelayout]] syntax.&lt;br /&gt;
|-&lt;br /&gt;
| life_type&lt;br /&gt;
| One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; EXTRACTIVE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ORGANIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; PROCESSING&lt;br /&gt;
| The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.&lt;br /&gt;
|-&lt;br /&gt;
| closure_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when the industry announces closure. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_increase_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry increases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_decrease_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry decreases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| fund_cost_multiplier&lt;br /&gt;
| 0..255&lt;br /&gt;
| Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)&lt;br /&gt;
|-&lt;br /&gt;
| min_cargo_distr&lt;br /&gt;
| 0..255&lt;br /&gt;
| Minimal amount of cargo before transporting to stations.&lt;br /&gt;
|-&lt;br /&gt;
| random_sound_effects&lt;br /&gt;
| array of ints&lt;br /&gt;
| Sound effect numbers that are played some times.&lt;br /&gt;
|-&lt;br /&gt;
| conflicting_ind_types&lt;br /&gt;
| array of up to 3x industry_type(IND_TYPE_OLD &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; IND_TYPE_NEW, id)&lt;br /&gt;
|&lt;br /&gt;
Three industry types that should not be nearby. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;industry_type(..)&amp;lt;/code&amp;gt; to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).&lt;br /&gt;
|-&lt;br /&gt;
| prob_random&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while generating initial industries.&lt;br /&gt;
|-&lt;br /&gt;
| prob_in_game&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while creating industries during the game.&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour index from the [[NML:Graphic files|DOS palette]] to use on the minimap for this industry.&lt;br /&gt;
|-&lt;br /&gt;
| spec_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
for flag values see [[#industry_special_flags|Industry special flags]]&lt;br /&gt;
|-&lt;br /&gt;
| new_ind_msg&lt;br /&gt;
| string&lt;br /&gt;
| Message displayed when industry gets built during game play.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_1&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the first accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the second accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the third accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Name of the industry, use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prospect_chance&lt;br /&gt;
| 0 .. 1 (float)&lt;br /&gt;
| Chance of successful prospecting.&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(flags)&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;
| remove_cost_multiplier&lt;br /&gt;
| int&lt;br /&gt;
| Cost multiplier for removing the industry (currently only possible with magic bulldozer).&lt;br /&gt;
|-&lt;br /&gt;
| nearby_station_name&lt;br /&gt;
| string&lt;br /&gt;
| Default additional name for a nearby station&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Industry special flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! flag&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_PERIODICALLY&lt;br /&gt;
| The industry periodically plants fields around itself (temperate and arctic farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CUT_TREES&lt;br /&gt;
| The industry cuts trees around itself and produces its first output cargo from them (lumber mill)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ON_WATER&lt;br /&gt;
| The industry is built on water (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_LARGE_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_NEAR_TOWN&lt;br /&gt;
| The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_WHEN_BUILT&lt;br /&gt;
| Fields are planted around the industry when it&#039;s built (all farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_NO_PRODUCTION_INCREASE&lt;br /&gt;
| The industry cannot increase its production on the temperate climate (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_BEFORE_1950&lt;br /&gt;
| The industry is built only before 1950 (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_AFTER_1960&lt;br /&gt;
| The industry is built only after 1960 (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES&lt;br /&gt;
| AI players will attempt to establish air and ship routes going to this industry (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military airplane (oil refinery)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military helicopter (factory)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CAN_CAUSE_SUBSIDENCE&lt;br /&gt;
| The industry can cause a subsidence (coal mine)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER&lt;br /&gt;
| Automatic production multiplier handing (No industry has this bit set by default.).&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK&lt;br /&gt;
| The production callback needs random bits in var. 10 (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION&lt;br /&gt;
| Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE&lt;br /&gt;
| Allow closing down the last instance of this type (No industry has this bit set by default.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| substitute&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| Number of the default industry tile that replaces this one, if this industry tile is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| id of the default industry tile which this industry tile replaces. This will cause your industry tile to be placed instead of the default industry tile. This is ignored, if the default industry tile has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by this tile. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile accept both COAL and IORE you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[COAL, 8], [IORE, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a tile that doesn&#039;t any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| land_shape_flags&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Land shape flags|Land shape flags]])&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(INDTILE_CBF_XXX, INDTILE_CBF_YYY)&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;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_INDTILE_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|-&lt;br /&gt;
| special_flags&lt;br /&gt;
| bitmask(INDTILE_FLAG_XXX)&lt;br /&gt;
| XXX is a special flag description. Currently there&#039;s only one flag defined: set INDTILE_FLAG_RANDOM_ANIMATION if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NW_EDGE&lt;br /&gt;
| North-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NE_EDGE&lt;br /&gt;
| North-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SW_EDGE&lt;br /&gt;
| South-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SE_EDGE&lt;br /&gt;
| South-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ONLY_ON_FLAT_LAND&lt;br /&gt;
| This tile can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ALLOW_ON_WATER&lt;br /&gt;
| The land/water check is disabled for this tile so it can be built on water. If you need more control over this use callback 0x2F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Common variables==&lt;br /&gt;
&lt;br /&gt;
The following variables are available to both industries and industry tiles. All of them require an x, y offset. For industries, this offset is unsigned and relative to the northernmost tile. For industry tiles, it is signed and relative to the current tile.&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;
| nearby_tile_slope&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of tile slopes|tile slopes]] for an overview of possible values&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| 0..120&lt;br /&gt;
| The height of the lowest corner of the given tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_industrytile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an industry tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original industry tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an industry tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an industry tile or it belongs to another GRF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry 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;
| production_level&lt;br /&gt;
| 0, or 4 .. 128&lt;br /&gt;
| Current production level of the industry. Usually in range 4 .. 128, default starting level is 16. A level of 0 indicates imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the first cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the second cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_3&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the third cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 1&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 2&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_1&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 1&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_2&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 2&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| water_distance&lt;br /&gt;
| Distance to the tile&lt;br /&gt;
| If the industry is built on water, this variable gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile.&lt;br /&gt;
|-&lt;br /&gt;
| layout_num&lt;br /&gt;
| 1..255&lt;br /&gt;
| Number of the layout being used by the industry.&lt;br /&gt;
|-&lt;br /&gt;
| founder&lt;br /&gt;
| 0..16&lt;br /&gt;
| Company number of the industry founder. It will be FOUNDER_GAME (=16) if the industry was generated randomly. TTDPatch only supports up to 8 companies (0..7).&lt;br /&gt;
|-&lt;br /&gt;
| founder_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| founder_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s first colour. 0 if not founded by a company. 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;
| founder_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s second colour. It&#039;s the same as company_colour1, if no second company colour is chosen. 0 if not founded by a company. 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;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Random colour for this industry. 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;
| build_date&lt;br /&gt;
| 0..1826212865&lt;br /&gt;
| Date of the industry foundation in days since year 0.&lt;br /&gt;
|-&lt;br /&gt;
| build_type&lt;br /&gt;
| BUILDTYPE_XX&lt;br /&gt;
| BUILDTYPE_UNKNOWN (if created in an old version or with newindustries disabled), BUILDTYPE_GAMEPLAY (if founded or created by the in-game random industry generator), BUILDTYPE_GENERATION (if created during random map generation) or BUILDTYPE_EDITOR (if created with the scenario editor).&lt;br /&gt;
|-&lt;br /&gt;
| counter&lt;br /&gt;
| 0..65535&lt;br /&gt;
| Decremented every tick, used to time primary industry production in TTD.&lt;br /&gt;
|-&lt;br /&gt;
| last_accept_date&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| Date when cargo was accepted for the last time. Not valid before 1920 and after 2090.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| Random data that can be used to randomize certain descisions. (see [[NML:Random_switch|Random switch]]) (NML r1666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Variables that require some parameters.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| industry_count&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
|&lt;br /&gt;
The value of this variable is the number of industries of a given type that are currently on the map. industry_type is either the ID of an industry. GRFid is the grf in which the industry was defined. The default value is -1, which means current newgrf. A grfid of 0 lets you check the number of default industries of a given type. 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 a grfid to its numeric representation.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_distance&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
| The value of this variable is the manhattan distance the closest instance of the given industry or 0xFFFF if not applicable. See industry_count for a description of the parameters.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_layout_count / industry_layout_distance&lt;br /&gt;
| industry_type, layout, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the given layout number.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_town_count&lt;br /&gt;
| industry_type, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the same town than the current industry.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the Manhattan distance (dx + dy) from the selected tile to the closest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the squared Eucleidean distance (dx^2 + dy^2) from the selected tile to the closest town.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| x, y&lt;br /&gt;
|&lt;br /&gt;
Parameters indicate a signed offset relative to the northern tile. Returns the [[NML:List of town zones|town zone]] that the selected tile is in.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate an unsigned offset relative to the northern tile. Returns the random bits of the selected industry tile, or 0 if it is not an industry tile that&#039;s part of this industry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile 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;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the industry tile.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Industry tiles have access to the [[#Common variables|common variables]] described above. Additionally, they have access to the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed tile offset relative to the current tile. Returns 1 if the tile is part of the same industry, 0 otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| varies&lt;br /&gt;
| Any unhandled callbacks. Generally this doesn&#039;t need to be used, except for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| produce_cargo_arrival&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo every 256 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| CB_RESULT_IND_ALLOW or CB_RESULT_IND_DISALLOW&lt;br /&gt;
|&lt;br /&gt;
Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]].&lt;br /&gt;
|-&lt;br /&gt;
| location_check&lt;br /&gt;
|&lt;br /&gt;
See the [[#Location check results|table]] below.&lt;br /&gt;
|&lt;br /&gt;
Called to check if a location is suitable. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]]. Since the industry isn&#039;t built yet, industry variables aren&#039;t available. If this callback is not implemented or fails, constructing the industry will be allowed. Construction might also be prevented via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; industry tile callback, though.&lt;br /&gt;
|-&lt;br /&gt;
| monthly_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Called each month to (possibly) change the industry production. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&lt;br /&gt;
|-&lt;br /&gt;
| random_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Works exactly the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;monthly_prod_change&amp;lt;/code&amp;gt;, except that it&#039;s only called when TTD selects this industry for a random production change.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_display&lt;br /&gt;
| String or 0xFF&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning 0xFF displays nothing. The lowest byte of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains 0 .. 2 to get texts for the first .. third accepted cargo type, and 3 .. 4 for the first ... second produced cargo type. The second byte contains 0 when getting a string for the buy menu (no industry variables available!), 1 when for the industry window and 2 for the industry directory window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_industry&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the industry window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_fund&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the fund window. Since the industry isn&#039;t built, no industry variables are available.&lt;br /&gt;
|-&lt;br /&gt;
| control_special&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called to control various effects from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spec_flags&amp;lt;/code&amp;gt; property. Currently only works for the first two (plant fields / cut trees). Return 1 to execute the action or 0 to not do so. The relevant flag is given in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;. The default (if the flag is enabled, of course) is to plant fields with 1/8th chance every 256 ticks, and to cut trees every 512 ticks. Random bits are supplied in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| stop_accept_cargo&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| With this callback, you can temporarily refuse accepting a certain cargo, for example because the stockpile is full. Return 1 to accept or 0 to refuse. Make sure to synchronize this callback with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_amount_accept&amp;lt;/code&amp;gt; callback for industry tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the cargo type to accept or not.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Called after constructing the industry. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour&amp;lt;/code&amp;gt; variable is set to a random value at this point, you can use this callback to change this.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_input&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Decide the input cargo types. Called repeatedly until 0xFF is returned, although currently not more than three times. Do not rely on this limitation, though. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; starts at 0 and is incremented for every iteration. Return a cargo type (from the table) or 0xFF to stop.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_output&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_input&amp;lt;/code&amp;gt; above, except that it is applied to the output cargo types and currently not called more than twice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Location check results===&lt;br /&gt;
&lt;br /&gt;
The following values can be used as return values for the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;location_check&amp;lt;/code&amp;gt; callback for industries&lt;br /&gt;
and the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; callback for industry tiles and objects.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! return value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| string(..)&lt;br /&gt;
| Item can&#039;t be built, show the string as error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_ALLOW&lt;br /&gt;
| Item can be built.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW&lt;br /&gt;
| Item can&#039;t be built, display the default error message. This is &amp;quot;site unsuitable&amp;quot; for industries and industry tiles, and &amp;quot;land sloped in wrong direction&amp;quot; for objects.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_RAINFOREST&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in rainforest areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_DESERT&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built in desert areas&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_ABOVE_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built above the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_ONLY_BELOW_SNOWLINE&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can only be built below the snow-line&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_OPEN_SEA&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on open sea&amp;quot; error message.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_CANAL&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on canal&amp;quot; error message&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_LOCATION_DISALLOW_NOT_ON_RIVER&lt;br /&gt;
| Item can&#039;t be built, display the &amp;quot;...can&#039;t build on river&amp;quot; error message.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Production change callback results===&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;
| CB_RESULT_IND_PROD_NO_CHANGE&lt;br /&gt;
| Do not change industry production&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_HALF&lt;br /&gt;
| Half industry production. If production goes below a quarter of default, the industry closes.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DOUBLE&lt;br /&gt;
| Double production if it&#039;s not 8x default yet.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_CLOSE&lt;br /&gt;
| Announce closoure and remove the industry next month.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_RANDOM&lt;br /&gt;
| Do a random production change, as if the industry is a primary one.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_4&lt;br /&gt;
| Divide production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_8&lt;br /&gt;
| Divide production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_16&lt;br /&gt;
| Divide production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_32&lt;br /&gt;
| Divide production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_4&lt;br /&gt;
| Multiply production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_8&lt;br /&gt;
| Multiply production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_16&lt;br /&gt;
| Multiply production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_32&lt;br /&gt;
| Multiply production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DECREMENT_BY_1&lt;br /&gt;
| Decrement production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_INCREMENT_BY_1&lt;br /&gt;
| Increment production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_SET_BY_0x100&lt;br /&gt;
| Set the production level to the value in bits 16 .. 23 of register 0x100.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting bit 7 of the result disables the associated news message.&amp;lt;br /&amp;gt; Setting bit 8 replaces the news message with a custom message, read from register 0x100 bits 0 .. 15.&lt;br /&gt;
&lt;br /&gt;
===Industry creation types===&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;
| IND_CREATION_GENERATION&lt;br /&gt;
| Industry is created during map generation, or when building &#039;many random industries&#039; in the scenario editor.&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_RANDOM&lt;br /&gt;
| Industry is randomly generated during gameplay&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_FUND&lt;br /&gt;
| Industry is funded by the player (in game or scenario editor)&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_PROSPECT&lt;br /&gt;
| Industry is prospected by the player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the industry tile&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the reason to trigger the animation, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Cargo types are from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[#Location check results|location_check]] industry callback&lt;br /&gt;
|&lt;br /&gt;
Called before constructing the industry, so nothing exists on the map yet. Since the industry isn&#039;t built yet, so you can&#039;t access industry variables. From the tile variables, relative x/y/position, town zone are available, as well as the class, height, slope, terrain type and water status of nearby tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the industry layout number in the lowest (first) byte and the [[#Industry creation types|creation type]] in the second byte. If this callback is not implemented or fails, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;land_shape_flags&amp;lt;/code&amp;gt; property will be used instead to determine if the slope is suitable. This also means that without this callback, the tile may not be built on steep slopes.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|-&lt;br /&gt;
| autoslope&lt;br /&gt;
| CB_RESULT[_NO]_AUTOSLOPE&lt;br /&gt;
| Return CB_RESULT_AUTOSLOPE to allow autoslope (altering the ground below a tile) or CB_RESULT_NO_AUTOSLOPE to disallow it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Trigger&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE&lt;br /&gt;
| the construction state changes&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_TILE_LOOP&lt;br /&gt;
| the tile is processed in the periodic processing loop&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_INDUSTRY_LOOP&lt;br /&gt;
| the industry of the tile is processed in the periodic processing loop (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_RECEIVED_CARGO&lt;br /&gt;
| the industry of the tile receives input cargo from a station (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_DISTRIBUTES_CARGO&lt;br /&gt;
| the industry distributes its output cargo to one of the stations nearby (synchronized for all tiles)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=2905</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=2905"/>
		<updated>2011-12-11T13:05:52Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Document &amp;quot;url&amp;quot; property in grf-block&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;
 	[url: &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;
 	[param { ... }]&lt;br /&gt;
 }&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;
 	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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action14&amp;diff=2904</id>
		<title>Action14</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action14&amp;diff=2904"/>
		<updated>2011-12-11T13:03:19Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Document &amp;quot;INFO&amp;quot;-&amp;gt;&amp;quot;URL_&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Static GRF Information&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Static GRF Information&lt;br /&gt;
&lt;br /&gt;
This action allows to specify additional information about the GRF. Every piece of information is considered optional and non-essential, thus OpenTTD/TTDPatch will ignore unknown parts and not display any error. The action is also meant to allow interfacing non-official extensions/patches for OpenTTD.&lt;br /&gt;
&lt;br /&gt;
Currently this action can be used to define&lt;br /&gt;
* {{ottdp|1.1|no|ottdrev=r20250}} translations for the name and description of the GRF. (Those from action 8)&lt;br /&gt;
* {{ottdp|1.1|no|ottdrev=r20254}} the palette (DOS, Windows) the GRF needs, or whether the palette does not matter.&lt;br /&gt;
* {{ottdp|1.2|no|ottdrev=r23001}} the colour depth (8bpp, 32bpp) the GRF needs&lt;br /&gt;
* {{ottdp|1.1|no|ottdrev=r20255}} the number, format and purpose of GRF parameters. (allowed values, names, descriptions, ...)&lt;br /&gt;
* {{ottdp|1.1|no|ottdrev=r20960}} version information and compatibility to older versions of the same GRF.&lt;br /&gt;
* {{ottdp|1.2|no|ottdrev=r23494}} website url that can be opened in-game.&lt;br /&gt;
&lt;br /&gt;
The action itself is available since OpenTTD r20250. TTDPatch ignores the action since r2334, so no skipping is needed. The action is only allowed for GRF version 7 or above.&lt;br /&gt;
&lt;br /&gt;
The action is processed while scanning for GRFs and their action 8 descriptions. This scanning stops when encountering an action 8, thus action 14 needs to appear earlier in the GRF.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data is provided using nestable chunks, and looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;sprite-number&amp;gt; * &amp;lt;length&amp;gt; 14 &amp;lt;chunks ...&amp;gt; 00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;chunks ...&amp;gt; is one or a sequence of&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;C&amp;quot; &amp;lt;identifier&amp;gt; &amp;lt;chunks ...&amp;gt; 00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;B&amp;quot; &amp;lt;identifier&amp;gt; &amp;lt;length&amp;gt; &amp;lt;binary-data&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;T&amp;quot; &amp;lt;identifier&amp;gt; &amp;lt;language-id&amp;gt; &amp;lt;text&amp;gt; 00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These three types of chunks define branch nodes (containers) and binary and textual leafs in a tree-like information structure. A piece of information is identified by the path in the information tree. E.g. the text leaf node at &amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;DESC&amp;quot; provides translatable descriptions for the GRF. It does not matter how many action 14 appear in a GRF, and which information is defined in which. Information with different identifier paths or same identifier paths (but e.g. different language-ids) can be set in the same action 14 or in multiple. If information is assigned to the same identifier-path multiple times, the information adds up resp. the last set information wins.&lt;br /&gt;
&lt;br /&gt;
Chunks with unknown identifiers are just skipped including their subchunks. Following chunks are processed nevertheless.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Element&#039;&#039;&#039;&lt;br /&gt;
! [[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]&lt;br /&gt;
! &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;sprite-number&amp;gt;&lt;br /&gt;
| dec&lt;br /&gt;
| A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;length&amp;gt;&lt;br /&gt;
| dec&lt;br /&gt;
| The total number of bytes in the action&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| B&lt;br /&gt;
| Action 14&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;chunks ...&amp;gt;&lt;br /&gt;
| *&lt;br /&gt;
| Any number of sub chunks.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;C&amp;quot;/&amp;quot;B&amp;quot;/&amp;quot;T&amp;quot;&lt;br /&gt;
| B&lt;br /&gt;
| chunk type (container/binary/text)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;identifier&amp;gt;&lt;br /&gt;
| 4*B&lt;br /&gt;
| Unique identifier for the chunk (see below)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;length&amp;gt;&lt;br /&gt;
| W&lt;br /&gt;
| Number of bytes of binary data following.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;binary-data&amp;gt;&lt;br /&gt;
| length*B&lt;br /&gt;
| Binary data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;language-id&amp;gt;&lt;br /&gt;
| B&lt;br /&gt;
| Which of TTD&#039;s languages the text is used for, see [[action4]]. (only GRF version &amp;gt;= 7 language codes allowed)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;text&amp;gt;&lt;br /&gt;
| S&lt;br /&gt;
| Text data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
=== Custom information for non-official extensions/patches (&amp;quot;CSTM&amp;quot; -&amp;gt; &amp;lt;extension-id&amp;gt; -&amp;gt; ...) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;CSTM&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;lt;extension-id&amp;gt;&lt;br /&gt;
                     ... whatever suits you ...&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Due to the purely-optional character of action 14 it is especially meant for non-official extensions/patches. However, to avoid conflicts custom additions should go into the &amp;quot;CSTM&amp;quot; chunk. Every extension may define its own subchunk with its own custom 4 byte &amp;lt;extension-id&amp;gt; below the &amp;quot;CSTM&amp;quot; chunk. The format of the subchunks below the &amp;lt;extension-id&amp;gt; chunk is freely defineable.&lt;br /&gt;
&lt;br /&gt;
The information there could be used e.g. to notify an extension that the GRF knows about it. Consecutively the extension might then enable custom GRF features and notify the GRF about their existance e.g. via variable 8D. Versions of OpenTTD without the extension will then just skip the &amp;quot;CSTM&amp;quot; chunk and return the usual value in variable 8D.&lt;br /&gt;
&lt;br /&gt;
=== GRF name (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;NAME&amp;quot;) and description (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;DESC&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20250}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;T&amp;quot; &amp;quot;NAME&amp;quot; &amp;lt;language-id&amp;gt; &amp;quot;Translatable GRF name&amp;quot; 00&lt;br /&gt;
                 &amp;quot;T&amp;quot; &amp;quot;DESC&amp;quot; &amp;lt;language-id&amp;gt; &amp;quot;Translatable GRF description&amp;quot; 00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below the top-level chunk &amp;quot;INFO&amp;quot; you can use the leaf-chunks &amp;quot;NAME&amp;quot; and &amp;quot;DESC&amp;quot; to define name and description for additional languages. The information provided in action 8 is used for &amp;quot;other&amp;quot; languages (id 7F).&lt;br /&gt;
&lt;br /&gt;
=== GRF website (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;URL_&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r23494}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;T&amp;quot; &amp;quot;URL_&amp;quot; &amp;lt;language-id&amp;gt; &amp;quot;http://www.example.org&amp;quot; 00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;quot;URL_&amp;quot; chunk to provide an url for this grf. You can translate this like the name and description to provide a localized website.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GRF palette (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PALS&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20254}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;B&amp;quot; &amp;quot;PALS&amp;quot; \w1 &amp;lt;palette&amp;gt;&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies the palette the sprites in the GRF are meant for.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;&amp;lt;palette&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;D&amp;quot;&lt;br /&gt;
|DOS palette&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;W&amp;quot;&lt;br /&gt;
|Windows palette&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;A&amp;quot;&lt;br /&gt;
|Any palette. (e.g. when the GRF does not contain any sprites)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GRF colour depth (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;BLTR&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r23001}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;B&amp;quot; &amp;quot;BLTR&amp;quot; \w1 &amp;lt;blitter&amp;gt;&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies the preferred blitter for a NewGRF. If not given, it will default to the 8 bpp blitter.&lt;br /&gt;
&lt;br /&gt;
This is only a hint, OpenTTD may still select another blitter if necessary. Only 8 bpp sprites are guaranteed to work with any blitter.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;&amp;lt;blitter&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;8&amp;quot;&lt;br /&gt;
|8 bpp blitter&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;3&amp;quot;&lt;br /&gt;
|32 bpp blitter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GRF version (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;VRSN&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20259}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;B&amp;quot; &amp;quot;VRSN&amp;quot; \w4 \d&amp;lt;version&amp;gt;&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies the version of the GRF. This version is then used (by OpenTTD) to internally order GRFs with the same GRFID. That order will determine which GRF is loading as &amp;quot;compatible&amp;quot; GRF and which GRFs to show in the list of GRFs. By default a GRF has version 0.&lt;br /&gt;
&lt;br /&gt;
If all GRFs (with the same GRFID) have version 0 all will be shown in the list of GRFs. If the highest version is shared by multiple GRFs one is randomly chosen as &amp;quot;compatible&amp;quot; GRF. As such it is important to prevent releasing multiple GRFs with the same version number.&lt;br /&gt;
&lt;br /&gt;
If you set a version for the GRF, you should also set the &#039;minimal compatible version&#039; MINV! Else it will default to the value of VRSN, which results in the GRF only being considered compatible to itself (resp. same version).&lt;br /&gt;
&lt;br /&gt;
=== Minimal compatible GRF version (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;MINV&amp;quot;) ===&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20960}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;B&amp;quot; &amp;quot;MINV&amp;quot; \w4 \d&amp;lt;version&amp;gt;&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies the minimal version of GRFs with the same GRFID this GRF is still compatible with.&lt;br /&gt;
&lt;br /&gt;
You have to set MINV after VRSN, and MINV has to be smaller or equal to VRSN.&lt;br /&gt;
&lt;br /&gt;
When loading a game which used an older version of your GRF which is no longer installed, the newest installed version of your GRF will be picked which is still compatible to the version used before. Older GRFs are never considered compatible to GRFs with newer versions though.&lt;br /&gt;
&lt;br /&gt;
If you do not set MINV, but set VRSN, then the GRF is only considered compatible to GRFs with the same version.&lt;br /&gt;
&lt;br /&gt;
If you set MINV to 0, the GRF is also considered compatible to old GRFs without any version information (VRSN).&lt;br /&gt;
&lt;br /&gt;
=== GRF parameters ===&lt;br /&gt;
&lt;br /&gt;
This section describes how to specify information about GRF parameters, and what settings are stored in them. By default a GRF comes with 128 settings, that is a dword setting for every of the 128 GRF parameters.&lt;br /&gt;
&lt;br /&gt;
==== Number of settings (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;NPAR&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20251}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;B&amp;quot; &amp;quot;NPAR&amp;quot; \w1 &amp;lt;number-of-settings&amp;gt;&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines the number of settings a GRF provides. This is independant from the number of allowed GRF parameters, as multiple settings might go into the same GRF parameter (e.g. bitmasks).&lt;br /&gt;
&lt;br /&gt;
==== Setting name (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;NAME&amp;quot;) and description (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;DESC&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20255}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;T&amp;quot; &amp;quot;NAME&amp;quot; &amp;lt;language-id&amp;gt; &amp;quot;Name of setting&amp;quot; 00&lt;br /&gt;
                         &amp;quot;T&amp;quot; &amp;quot;DESC&amp;quot; &amp;lt;language-id&amp;gt; &amp;quot;Setting description&amp;quot; 00&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Defines a name for a setting.&lt;br /&gt;
&lt;br /&gt;
The settings are numbered and identified using &amp;lt;setting-number&amp;gt;. Valid values are 0 up to (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;NPAR&amp;quot;) - 1.&lt;br /&gt;
&lt;br /&gt;
==== Setting to GRF parameter mapping (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;MASK&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20255}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;B&amp;quot; &amp;quot;MASK&amp;quot; \w&amp;lt;length&amp;gt; \b &amp;lt;grf-parameter&amp;gt; [ \b &amp;lt;first-bit&amp;gt; [ \b &amp;lt;num-bit&amp;gt; ] ]&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies which GRF parameter is used to store a setting in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;&lt;br /&gt;
|A chunk length of 1 to 3 is allowed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;grf-parameter&amp;gt;&lt;br /&gt;
|GRF parameter (0 to 127) to store the setting in. Default value is the same as &amp;lt;setting-number&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;first-bit&amp;gt;&lt;br /&gt;
|First bit in the GRF parameter to use for the setting. Default value is &amp;quot;0&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-bit&amp;gt;&lt;br /&gt;
|Number of bits to use for the setting in the GRF parameter. Default value is &amp;quot;32&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you do not specify &amp;lt;first-bit&amp;gt; and &amp;lt;num-bit&amp;gt; the setting uses the whole GRF parameter by default. If you do not specify any &amp;quot;MASK&amp;quot; chunk at all, the setting will use the GRF parameter with the same number as &amp;lt;setting-number&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So if you do not need to store multiple settings in one parameter, you do not need &amp;quot;MASK&amp;quot; chunks.&lt;br /&gt;
&lt;br /&gt;
Note: You cannot store a setting across/using multiple GRF parameters.&lt;br /&gt;
&lt;br /&gt;
==== Setting type (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;TYPE&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20255}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;B&amp;quot; &amp;quot;TYPE&amp;quot; \w1 &amp;lt;setting-type&amp;gt;&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifies the type of a setting.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;&amp;lt;setting-type&amp;gt;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Integer (unsigned) or enumeration. The GUI displays &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; buttons to change the setting resp. allows entering a value from a query window.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Boolean. The GUI displays a toggle button to switch the setting on or off.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The defaut value is &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Allowed value range (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;LIMI&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20255}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;B&amp;quot; &amp;quot;LIMI&amp;quot; \w8 \d&amp;lt;minimum-value&amp;gt; \d&amp;lt;maximum-value&amp;gt;&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets minimal and maximal allowed value for integer/enumeration settings.&lt;br /&gt;
&lt;br /&gt;
The default values are &amp;quot;0&amp;quot; resp. &amp;quot;2^32 - 1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Enumeration values (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;VALU&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20255}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;C&amp;quot; &amp;quot;VALU&amp;quot;&lt;br /&gt;
                             &amp;quot;T&amp;quot; \d&amp;lt;setting-value&amp;gt; &amp;lt;language-id&amp;gt; &amp;quot;Enumeration value&amp;quot; 00&lt;br /&gt;
                             ...&lt;br /&gt;
                             00&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This chunk allows you to specify texts to display instead of the raw value for integer/enumeration. You can also specify texts only for some of the valid values. So if a setting e.g. allows values betweeen 0 to 42 you can instruct the GUI to show &amp;quot;none&amp;quot; instead of &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Default value (&amp;quot;INFO&amp;quot; -&amp;gt; &amp;quot;PARA&amp;quot; -&amp;gt; &amp;lt;setting-number&amp;gt; -&amp;gt; &amp;quot;DFLT&amp;quot;) ====&lt;br /&gt;
{{ottdp|1.1|no|ottdrev=r20602}}&lt;br /&gt;
&amp;lt;pre&amp;gt;-1 * -1   14 &amp;quot;C&amp;quot; &amp;quot;INFO&amp;quot;&lt;br /&gt;
                 &amp;quot;C&amp;quot; &amp;quot;PARA&amp;quot;&lt;br /&gt;
                     &amp;quot;C&amp;quot; \d&amp;lt;setting-number&amp;gt;&lt;br /&gt;
                         &amp;quot;B&amp;quot; &amp;quot;DFLT&amp;quot; \w4 \d&amp;lt;value&amp;gt;&lt;br /&gt;
                         00&lt;br /&gt;
                     00&lt;br /&gt;
                 00&lt;br /&gt;
             00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the default value for a setting.&lt;br /&gt;
&lt;br /&gt;
If you set &amp;quot;DFLT&amp;quot; for any setting the behavior of the &amp;quot;reset&amp;quot; functionality changes. Normally it would unset all parameters. If you have any &amp;quot;DFLT&amp;quot; field in your NewGRF then all parameters are unset after which all settings are set to their default value or to 0 if no default is provided. This means that using ActionD with opcode+80 doesn&#039;t work for any user-changeable parameter when you use a &amp;quot;DFLT&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
This &amp;quot;reset&amp;quot; functionality happens when adding a NewGRF to a configuration or when the user presses the reset button in the parameter window.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2872</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=2872"/>
		<updated>2011-11-22T20:45:25Z</updated>

		<summary type="html">&lt;p&gt;Yexo: fixed link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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_CLIMATES&amp;lt;/code&amp;gt;&lt;br /&gt;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&lt;br /&gt;
==Plane 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;
| misc_flags&lt;br /&gt;
| bitmask(AIRCRAFT_FLAG_2CC, AIRCRAFT_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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;
|&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 0xFF&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 0xFF. 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 HEQS 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 0xFF&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 0xFF 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 0xFF&lt;br /&gt;
| With this callback, you can add articulated parts (e.g. tenders) to your vehicle. Called repeatedly, until 0xFF 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. Add 128 to the returned vehicle ID to display the vehicle backwards. This has the unfortunate side-effect of requiring the vehicle ID of the articulated part to be in the range 0 .. 127, currently there&#039;s no way around this limitation.&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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| 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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2871</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=2871"/>
		<updated>2011-11-22T20:44:36Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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_CLIMATES&amp;lt;/code&amp;gt;&lt;br /&gt;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&amp;lt;/code&amp;gt;&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}} 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}} 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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the above table are always overriden by cargo_allow_refit and cargo_disallow_refit. Whatever the table says, if the cargo is in cargo_allow_refit the vehicle will always be refitable to that cargo.&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type. &lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; AUTOREFIT] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC, ROADVEH_FLAG_AUTOREFIT. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC, SHIP_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&lt;br /&gt;
==Plane 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;
| misc_flags&lt;br /&gt;
| bitmask(AIRCRAFT_FLAG_2CC, AIRCRAFT_FLAG_AUTOREFIT)&lt;br /&gt;
| Bitmask with two possible flags, set to 0 to disable both&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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;
|&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 0xFF&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 0xFF. 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 HEQS 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 0xFF&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 0xFF 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 0xFF&lt;br /&gt;
| With this callback, you can add articulated parts (e.g. tenders) to your vehicle. Called repeatedly, until 0xFF 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. Add 128 to the returned vehicle ID to display the vehicle backwards. This has the unfortunate side-effect of requiring the vehicle ID of the articulated part to be in the range 0 .. 127, currently there&#039;s no way around this limitation.&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;
&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;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| 0 .. 16377 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;
|-&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;
| 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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Add_font_glyphs&amp;diff=2864</id>
		<title>NML:Add font glyphs</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Add_font_glyphs&amp;diff=2864"/>
		<updated>2011-11-20T14:38:18Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;font-glyph&amp;lt;/code&amp;gt; block makes it possible to provide sprites for glyphs that don&#039;t have sprites in normal TTD. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 font_glyph (&amp;amp;lt;font-size&amp;amp;gt;, &amp;amp;lt;base-char&amp;amp;gt;, &amp;amp;lt;image-file&amp;amp;gt;) {&lt;br /&gt;
 	[[NML:Realsprites|list of realsprites]]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The first parameter (&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;font-size&amp;amp;gt;&amp;lt;/code&amp;gt;) should be an identifier of the font size to use. Valid values are &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SMALL&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NORMAL&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;LARGE&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;MONO&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The second parameter (&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;base-char&amp;amp;gt;&amp;lt;/code&amp;gt;) is the number corresponding to the first character to provide a sprite for. Valid values are all unicode code points in the Basic Multilingual Plane (0-0xFFFF)&lt;br /&gt;
&lt;br /&gt;
Parameter three &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;image-file&amp;amp;gt;&amp;lt;/code&amp;gt; is a literal (quoted) string that specifies the file where the sprites are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;real-sprites&amp;amp;gt;&amp;lt;/code&amp;gt; should be a list of real sprites. The first real sprite will be used for the character with code &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;base-char;&amp;lt;/code&amp;gt;, the second for &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;base-char + 1&amp;lt;/code&amp;gt; and so on. These sprites should only use colour palette indices 0 (transparent), 1 (foreground), and 2 (shadow).&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Cargos&amp;diff=2777</id>
		<title>Action0/Cargos</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Cargos&amp;diff=2777"/>
		<updated>2011-11-05T12:32:50Z</updated>

		<summary type="html">&lt;p&gt;Yexo: fix link to train prop. 28/29&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The [[NewCargos]] switch of TTDPatch allows modifying the existing 12 cargos per climate, and allows adding 20 new cargos per climate as well. These cargo slots are numbered from 0 to 31, where slots 0-11 are used by default TTD cargos and slots 12-31 contain uninitialized garbage by default (so you can&#039;t trust them having meaningful information, you must set all of their properties).&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|08||B||{{ottdp|0.6|2.5}}||Bit number for bitmasks&lt;br /&gt;
|-&lt;br /&gt;
|09||W||{{ottdp|0.6|2.5}}||TextID for the cargo type name&lt;br /&gt;
|-&lt;br /&gt;
|0A||W||{{ottdp|0.6|2.5}}||TextID for the name of one unit from the cargo type&lt;br /&gt;
|-&lt;br /&gt;
|0B||W||{{ottdp|0.6|2.5}}||TextID to be displayed for 1 unit of cargo&lt;br /&gt;
|-&lt;br /&gt;
|0C||W||{{ottdp|0.6|2.5}}||TextID to be displayed for multiple units of cargo&lt;br /&gt;
|-&lt;br /&gt;
|0D||W||{{ottdp|0.6|2.5}}||TextID for cargo type abbreviation&lt;br /&gt;
|-&lt;br /&gt;
|0E||W||{{ottdp|0.6|2.5}}||Sprite number for the icon of the cargo&lt;br /&gt;
|-&lt;br /&gt;
|0F||B||{{ottdp|0.6|2.5}}||Weight of one unit of the cargo&lt;br /&gt;
|-&lt;br /&gt;
|10,11||B||{{ottdp|0.6|2.5}}||Penalty times&lt;br /&gt;
|-&lt;br /&gt;
|12||D||{{ottdp|0.6|2.5}}||Base price&lt;br /&gt;
|-&lt;br /&gt;
|13||B||{{ottdp|0.6|2.5}}||Color for the station list window&lt;br /&gt;
|-&lt;br /&gt;
|14||B||{{ottdp|0.6|2.5}}||Color for the cargo payment list window&lt;br /&gt;
|-&lt;br /&gt;
|15||B||{{ottdp|0.6|2.5}}||Freight status (for [[FreightTrains]] switch); 0=not freight, 1=is freight&lt;br /&gt;
|-&lt;br /&gt;
|16||W||{{ottdp|0.6|2.5}}||Cargo classes&lt;br /&gt;
|-&lt;br /&gt;
|17||D||{{ottdp|0.6|2.5}}||Cargo label&lt;br /&gt;
|-&lt;br /&gt;
|18||B||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Substitute type for town growth&lt;br /&gt;
|-&lt;br /&gt;
|19||W||{{ottdp|no|2.5|ttdprev=alpha 72}}||Multiplier for town growth&lt;br /&gt;
|-&lt;br /&gt;
|1A||B||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Callback flags&lt;br /&gt;
|-&lt;br /&gt;
|1B||W||{{ottdp|1.1|no|ottdrev=r21224}}||TextID for displaying the units of a cargo&lt;br /&gt;
|-&lt;br /&gt;
|1C||W||{{ottdp|1.1|no|ottdrev=r21224}}||TextID for displaying the amount of cargo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Bit number for bitmasks (08) ===&lt;br /&gt;
&lt;br /&gt;
This value must be used in [[Action3]] and in cargo bit mask properties such as refit masks. Values 1C-1F should be safe to use (if they aren&#039;t already taken, of course) if you intend to maintain compatibility with GRFs unaware of the newcargos switch. Further assuming that no active GRFs support the toyland climate, you can use values 11-1A as well.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can use the value FFh to disable the given cargo slot. This way, it won&#039;t appear in cargo type lists, but it won&#039;t be removed from things already on the map. If you disable a cargo, you&#039;ll probably want to zero out the cargo label (property 17) as well.&lt;br /&gt;
&lt;br /&gt;
This property only affects GRFs which do not have a [[Action0/Global Settings#Cargo_translation_table_.2809.29 | cargo translation table]]. GRFs with such a table generally use the index of the cargo in the table instead of the value of this property to access a cargo. As such this property is more or less a default value for GRFs without cargo translation table. If you are unsure what value to assign to this property, set it to the same value as the cargo slot ID.&lt;br /&gt;
&lt;br /&gt;
=== TextID for the cargo type name (09) ===&lt;br /&gt;
&lt;br /&gt;
This textID should refer to the name of the cargo, capitalized, to match the TTD style (e.g. &amp;quot;Passengers&amp;quot;, &amp;quot;Coal&amp;quot;, &amp;quot;Gold Ore&amp;quot;, &amp;quot;Milk&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You can reuse existing [[TextIDs]] or create custom strings using [[Action4]] with an offset in the DCxx range. Note that you need to set language-id bit 7 as well in the Action4 for a custom string. (Also applies to properties 0A to 0D)&lt;br /&gt;
&lt;br /&gt;
=== TextID for one unit of the type (0A) ===&lt;br /&gt;
&lt;br /&gt;
This textID should refer to the cargo type name in the singular. Currently, this ID is used only in subsidy messages (&amp;quot;First Passenger service...&amp;quot; instead of &amp;quot;First Passengers service...&amp;quot;, for example)&lt;br /&gt;
&lt;br /&gt;
=== TextID for 1 unit of cargo (0B) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used to display the amount of the cargo if there&#039;s exactly 1 unit waiting. Although there&#039;s only one unit waiting, you&#039;ll still have to use either the special character 7C (print signed word) or 87 (print amount in litres and add suffix &amp;quot; litres&amp;quot;) so TTD removes the amount from its internal reference stack. For example, if you have a new cargo named &amp;quot;gold ore&amp;quot;, this should be &amp;quot;\7C ton of gold ore&amp;quot;, which will expand to &amp;quot;1 ton of gold ore&amp;quot;. On the other hand, a liquid cargo named &amp;quot;milk&amp;quot; should be something like &amp;quot;\87 of milk&amp;quot;, which will expand to either &amp;quot;100 litres of milk&amp;quot; or &amp;quot;1,000 litres of milk&amp;quot; (The multiplier for liquid cargos depends on miscmods.dontfixlitres. If it&#039;s on, the multiplier is 100, otherwise it&#039;s 1000)&lt;br /&gt;
&lt;br /&gt;
=== TextID for multiple units of cargo (0C) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used to display the amount of cargo if the amount waiting isn&#039;t exactly 1. You&#039;ll need the same special characters as above, but now they will be expanded according to the actual cargo waiting. Sticking to the example above, you&#039;ll need &amp;quot;\7C tons of gold ore&amp;quot; and &amp;quot;\87 of milk&amp;quot;, which can expand to &amp;quot;42 tons of gold ore&amp;quot; and &amp;quot;42,000 litres of milk&amp;quot;, accordingly. You will note that liquid cargos can have the same textID for both property 0B and 0C since they always use the plural form.&lt;br /&gt;
&lt;br /&gt;
=== TextID for cargo type abbreviation (0D) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used in the station list window to represent the cargo waiting. It should be a two-letter abbreviation prefixed by the special character 0E to switch to the microscopic font. The microscopic font has every letter capitalized, so capitalization isn&#039;t important here. Continuing the above example, gold ore could have this as &amp;quot;GO&amp;quot; and milk as &amp;quot;MK&amp;quot; (&amp;quot;ML&amp;quot; is already taken by mail).&lt;br /&gt;
&lt;br /&gt;
=== Sprite number for icon (0E) ===&lt;br /&gt;
&lt;br /&gt;
This is a sprite number of an old TTD sprite to be displayed in the station window for this cargo, or FFFFh if the icon should be found by following the action 3 associated with this cargo. The icon must not be bigger than 10x10 pixels. One icon will be shown for every 10 units of the cargo waiting, up to 23 icons, which is the maximum.&lt;br /&gt;
&lt;br /&gt;
=== Weight of one unit of the cargo (0F) ===&lt;br /&gt;
&lt;br /&gt;
This property defines the weight of 1 unit from the cargo, which will be used to calculate the weight of the vehicles when loaded. The unit is 1/16 ton (which is 62.5 kg). With the examples above, gold ore should have this as 16 (since 1 ton of gold ore should weigh exactly 1 ton), while milk should have this slightly above 16 (milk is denser than water).&lt;br /&gt;
&lt;br /&gt;
=== Penalty times and price factor (10,11,12) ===&lt;br /&gt;
&lt;br /&gt;
These three values define how much is paid for the delivery of the cargo type. The price factor is subject to inflation, but GRFs needn&#039;t care about this, the programme will adjust the price for them.&lt;br /&gt;
&lt;br /&gt;
The income generated from cargo delivery is calculated as:&lt;br /&gt;
&lt;br /&gt;
income=((((distance/2) * timefactor * amount_moved) &amp;gt;&amp;gt; 7) * cargopricefactor) &amp;gt;&amp;gt; 13&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
; a &amp;gt;&amp;gt; b : means a is arithmetically shifted right by b bits&lt;br /&gt;
; distance : is the Manhattan distance between the two station signs&lt;br /&gt;
; amount_moved : is the number of cargo units moved&lt;br /&gt;
; cargopricefactor : is the value you set in property 12. Inflation will be applied automatically on it.&lt;br /&gt;
; timefactor : is a multiplier in the range 0..255, calculated in the following way: (T1 is the value of property 10, T2 is the value of property 11, t is the time the delivery took, the unit is 185 game ticks (roughly 2.5 game days) )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if t&amp;lt;=T1 then timefactor=255&lt;br /&gt;
    else if t&amp;lt;=(T1+T2) then timefactor=255-(t-T1)&lt;br /&gt;
    else timefactor=255-(t-T1)-(t-T1-T2)&lt;br /&gt;
    if the above rules result in a timefactor less than 31, 31 is used instead. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Color for the station list window (13) ===&lt;br /&gt;
&lt;br /&gt;
This color index will be used to draw the rectangle representing the amount waiting from the current cargo type in the station list window. The index should be given for the DOS palette. OpenTTD and TTDPatch will automatically translate the index for the Windows palette, if they use the windows base graphics.&lt;br /&gt;
&lt;br /&gt;
=== Color for the cargo payment list window (14) ===&lt;br /&gt;
&lt;br /&gt;
The graph of the current cargo will be drawn using this color in the cargo payment rates graph. The index should be given for the DOS palette, the Windows version of TTDPatch will automatically translate the index for the Windows palette.&lt;br /&gt;
&lt;br /&gt;
=== CargoClasses (16) ===&lt;br /&gt;
&lt;br /&gt;
See [[Action0Trains#Cargo classes .2828.2C_29.29|train prop. 28/29]] for a description of the utility of this property.&lt;br /&gt;
&lt;br /&gt;
This is a bit mask of all cargo classes to which this cargo belongs, out of the following:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Cargo class&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Passengers&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Mail&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Express cargo (any prioritised cargo)&lt;br /&gt;
|-&lt;br /&gt;
|3||8||Armored cargo (needing security measures, e.g. valuables or gold)&lt;br /&gt;
|-&lt;br /&gt;
|4||10||Bulk freight (any non-packaged cargo suitable for pouring, e.g. coal, grain, ore, cement, ...)&lt;br /&gt;
|-&lt;br /&gt;
|5||20||Piece goods (any unitised cargo, packed or unpacked)&lt;br /&gt;
|-&lt;br /&gt;
|6||40||Liquids (any liquid or gaseous cargo, food or chemical)&lt;br /&gt;
|-&lt;br /&gt;
|7||80||Refrigerated cargo (any goods needing temperature-controlling, e.g. perishable goods, food, or chemicals needing cooling/heating)&lt;br /&gt;
|-&lt;br /&gt;
|8||100||Hazardous cargo (explosives, acids, radioactive material, ...)&lt;br /&gt;
|-&lt;br /&gt;
|9||200||covered/sheltered freight (any cargo needing moisture protection, i.e. transportation in box vans, silo wagons or containers required)&lt;br /&gt;
|-&lt;br /&gt;
|10||400||Oversized and/or overweight cargo (any cargo needing special means of transportation, e.g. industrial equipment, machinery, large format glass, ... )&lt;br /&gt;
|-&lt;br /&gt;
|15||8000||Special (used for livery refit tricks rather than actual cargos)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only cargos which are in class 0 (passengers) will appear in bus stations. Only cargos which are &#039;&#039;not&#039;&#039; in class 0 will appear in truck stations.&lt;br /&gt;
&lt;br /&gt;
=== Cargo label (17) ===&lt;br /&gt;
&lt;br /&gt;
Cargo labels are globally [[CargoTypes#Cargo Labels|unique identifiers]] for a cargo type. They are used to allow vehicle grfs to easily support many cargo types, whether they are active or not and no matter what slot or bit they are using.&lt;br /&gt;
&lt;br /&gt;
Read about the [[Action0/Global Settings#Cargo translation table 09|cargo translation table]] for further info.&lt;br /&gt;
&lt;br /&gt;
=== Substitute type and multiplier for town growth (18, 19) ===&lt;br /&gt;
&lt;br /&gt;
These properties allow you to modify how a cargo type affects town growth. Property 18 can contain one of the following values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Value!!Meaning!!{{ottdp|0.7|no}} Details&amp;lt;ref&amp;gt;This is the interpretation of OpenTTD. For TTDPatch see [http://www.tt-wiki.net/wiki/NewTownGrowthSwitches NewTownGrowthMechanism], which is quite different/unrelated.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|00||Affect towns as passengers do||Cargo produced by houses is added to the statistics in the town GUI.&lt;br /&gt;
|-&lt;br /&gt;
|02||Affect towns as mail does||Cargo produced by houses is added to the statistics in the town GUI.&lt;br /&gt;
|-&lt;br /&gt;
|05||Affect towns as goods/candy does||See note about subsidies below.&lt;br /&gt;
|-&lt;br /&gt;
|09||Affect towns as water does||Second required cargo for towngrowth in the desert&lt;br /&gt;
|-&lt;br /&gt;
|0B||Affect towns as food/fizzy drinks do||First required cargo for towngrowth in desert/above snowline. Alse see note about subsidies below.&lt;br /&gt;
|-&lt;br /&gt;
|FF||Don&#039;t affect town growth (default)|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The incoming cargo amount is multiplied by property 19, then divided by 256 before it is added to the town statistics. This allows you to have smaller or bigger impact than original cargoes do. Please note that cargoes accepted by industries affect the closest town as well; for example, if you have an industry that accepts passengers, every passenger brought to the industry affects the town just like if they were transported to the town directly. Usually, it&#039;s not a good idea to have industries that process such cargoes; they should be accepted by towns only.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|no}} In OpenTTD property 18 also affects the creation of subsidies. Usually subsidies apply to cargo transportation between two industries. For cargos with substitution-type 05 or 0B the destination will be a town instead. Independent of property 18 subsidies from town to town are only created for cargo slot 0 (Passengers).&lt;br /&gt;
&lt;br /&gt;
=== Callback flags (1A) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Var. 0C!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||39||Custom profit calculation&lt;br /&gt;
|-&lt;br /&gt;
|1||2||145||Custom station rating calculation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== TextID for displaying the units of a cargo (1B) ===&lt;br /&gt;
&lt;br /&gt;
This textID is used by OpenTTD to show the &amp;quot;short cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 litres&amp;quot; or &amp;quot;10 tonnes&amp;quot;. This textID must be set after property 0B. The text this textID refers to should properly handle plurals, e.g. &amp;quot;\7B item\9A\15\80\9A\10\9A\11s\9A\12&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The default for this textID depends on the default for property 0B; if the default 0B string has &amp;quot;litre&amp;quot;, then the default for this textID will be the unit for litres. OpenTTD maps the following textIDs so you don&#039;t need to provide translations:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!textID!!String&lt;br /&gt;
|-&lt;br /&gt;
|004f||&amp;lt;num&amp;gt; passenger(s)&lt;br /&gt;
|-&lt;br /&gt;
|0050||&amp;lt;num&amp;gt; tonne(s)&lt;br /&gt;
|-&lt;br /&gt;
|0051||&amp;lt;num&amp;gt; bag(s)&lt;br /&gt;
|-&lt;br /&gt;
|0052||&amp;lt;num&amp;gt; litre(s)&lt;br /&gt;
|-&lt;br /&gt;
|0053||&amp;lt;num&amp;gt; item(s)&lt;br /&gt;
|-&lt;br /&gt;
|0054||&amp;lt;num&amp;gt; crate(s)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;tonne&amp;quot; and &amp;quot;litre&amp;quot; strings (textID 0050 and 0052) are automatically updated based on the user settings of unit display, e.g. they &amp;quot;tonne&amp;quot; might become &amp;quot;kg&amp;quot;. The &amp;quot;(s)&amp;quot; is for display purposes; in reality that is a choice list.&lt;br /&gt;
&lt;br /&gt;
=== TextID for displaying the amount of cargo (1C) ===&lt;br /&gt;
&lt;br /&gt;
This textID is used by OpenTTD to show the &amp;quot;long cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 litres of water&amp;quot; or &amp;quot;10 tonnes of coal&amp;quot;. This textID must be set after property 0c. The text this textID refers to should properly handle plurals, e.g. &amp;quot;\7B item\9A\15\80\9A\10\9A\11s\9A\12 of livestock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The default for this textID depends on the default for property 0C, but with support for plurals. For &amp;quot;X litre(s)&amp;quot; or &amp;quot;X tonne(s)&amp;quot; you should respectively use string codes 87 and 9A 0D.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Storages&amp;diff=2762</id>
		<title>Storages</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Storages&amp;diff=2762"/>
		<updated>2011-11-01T20:00:37Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Persistent storage accessed by GRFID */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Storages are arrays of registers that can be accessed when using [[VariationalAction2]]. Registers (temporary and persistent alike) always have a size of 4 bytes. If you&#039;re writing them using smaller sizes (anything but type 89/8A), the given value will be sign-extended to 4 bytes. Therefore, be careful when you read a register using a bigger size than it was written with. This also applies to registers read by TTDPatch; if not indicated specifically, TTDPatch reads all 4 bytes of the register.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
===Temporary storage===&lt;br /&gt;
{{ottdp|0.6|2.6}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - FF (256) (from TTDPatch r1246 to r1301) or 00 - 10F (272) (since TTDPatch r1301 and OpenTTD r9707)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2sto (0E)]] allows to store values inside the registers of this storage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The first 256 registers 00 to FF can be read using [[VariationalAction2#Variable|variable 7C]]. The rest of the values (100 to 10F) are write only: they are used to pass extra data to some 4x and 6x variables, as well as for returning extra data from callbacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Temporary storage contains values local to the current [[VariationalAction2]] chain. When a new chain starts, the values inside the temporary storage are undefined. Therefore, they should not be used unless they have been properly initialized. During the execution of a chain, only that chain can modify the values in the temporary storage.&lt;br /&gt;
&lt;br /&gt;
===Persistent storage===&lt;br /&gt;
{{ottdp|0.6|2.6}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - 0F (16)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2psto (10)]] allows to store values inside the registers of this storage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The registers can be read using [[VariationalAction2#Variable|variable 7D]]. Note that it is possible to access the persistent storage of related objects (see [[VariationalAction2#Type]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Features that support it:&#039;&#039;&#039; Industries (0A)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Persistent storage is associated to a single item. When the item is created, all of the values of the persistent storage are set to zero. Persistent storage values cannot be accessed or modified by items that are being created. Persistent storage should not be read if the current feature doesn&#039;t support it.&lt;br /&gt;
&lt;br /&gt;
===Persistent storage accessed by GRFID===&lt;br /&gt;
{{ottdp|1.2|ottdrev=r22569}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Size:&#039;&#039;&#039; 00 - 0F (16) for each GRFID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data storage:&#039;&#039;&#039; [[VarAction2Advanced#operator|Operator \2psto (10)]] allows to store values inside the registers of this storage. The GRFID to access must be stored in temporary register 0x100 before using Operator 10. 0xFFFFFFFF can be used to access the GRFID of the item using the current [[VariationalAction2]] chain.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Data access:&#039;&#039;&#039; The registers can be read using [[VariationalAction2#Variable|variable 7D]]. Note that it is possible to access the persistent storage of related objects (see [[VariationalAction2#Type]]). The GRFID to access must be stored in temporary register 0x100 before checking variable 7C. 0xFFFFFFFF can be used to access the GRFID of the item using the current [[VariationalAction2]] chain.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Features that support it:&#039;&#039;&#039; Towns (since OpenTTD r22569)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Features supporting persistent storage accessed by GRFID are not restricted to a single persistent storage; there is a persistent storage associated to every GRFID. An item only has write access to the persistent storage associated to its own GRFID, but it can read the registers of any GRFID. Persistent storage values cannot be accessed or modified by items that are being created. Persistent storage should not be read if the current feature doesn&#039;t support it.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=2750</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=2750"/>
		<updated>2011-10-29T21:12:02Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* String parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{!:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and number of plural forms is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| American&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 16 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=StringCodes&amp;diff=2749</id>
		<title>StringCodes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=StringCodes&amp;diff=2749"/>
		<updated>2011-10-29T21:00:45Z</updated>

		<summary type="html">&lt;p&gt;Yexo: stringcodes 9A 19 and 9A 1A&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=String Codes=&lt;br /&gt;
&lt;br /&gt;
Texts in TTD are mostly in the Latin-1 (ISO-8859-1) character set (except when using UTF-8 encoding; see below), however a few characters are different. Also, some characters have special meaning. These are explained in the following table.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Range, hex!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|00..1F||||Control characters, unused except for the following:&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||01 X offset in next byte of string (variable space)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||0D New line&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||0E Set small font size&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||0F Set large font size&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||1F X and Y offsets in next two bytes of string&lt;br /&gt;
|-&lt;br /&gt;
|20..7A||{{ottdp|0.6|2.0}}|| Latin-1/ASCII characters, from space &amp;quot; &amp;quot; up to lower case &amp;quot;z&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|7B..87|||| Formatting instructions, all take their argument from the stack if not otherwise specified&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||7B Print signed dword&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||7C Print signed word&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||7D Print signed byte&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||7E Print unsigned word&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||7F Print dword in currency units&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||80 Print substring (text ID from stack)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||81 Print substring (text ID in next 2 bytes of string)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||82 Print date (day, month, year) (based on year 1920)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||83 Print short date (month and year) (based on year 1920)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||84 Print signed word in speed units&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||85 Discard next word from stack&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||86 Rotate down top 4 words on stack&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||87 Print signed word in litres&lt;br /&gt;
|-&lt;br /&gt;
|88..98||||Colour codes&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||88 Blue&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||89 Light Gray&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8A Light Orange (&amp;quot;Gold&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8B Red&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8C Purple&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8D Gray-Green&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8E Orange&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||8F Green&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||90 Yellow&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||91 Light Green&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||92 Red-Brown&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||93 Brown&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||94 White&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||95 Light Blue&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||96 Dark Gray&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||97 Mauve (grayish purple)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||98 Black&lt;br /&gt;
|-&lt;br /&gt;
|99||{{ottdp|no|2.5|ttdprev=2.0.1 alpha 1}}||Switch to company colour that follows in next byte (enabled by enhancegui)&lt;br /&gt;
|-&lt;br /&gt;
|9A||||Extended format code in next byte:&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.5}}||00 -or- 01 Display 64-bit value from stack in currency units&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|no|2.6}}||02 Ignore next colour byte. Multiple instances will skip multiple colour bytes.&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.6}}||03 WORD Push WORD onto the textref stack&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.6}}||04 BYTE Un-print the previous BYTE characters.&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|no|2.6}}||05 For internal use only. Not valid in GRF files.&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.7|2.6|ttdprev=r2007}}||06 Print byte in hex&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.7|2.6|ttdprev=r2007}}||07 Print word in hex&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.7|2.6|ttdprev=r2007}}||08 Print dword in hex&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|no|2.6|ttdprev=r2128}}||09 For internal use only. Usage in NewGRFs will most likely crash TTDPatch.&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|no|2.6|ttdprev=r2128}}||0A For internal use only. Usage in NewGRFs will most likely crash TTDPatch.&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.0|2.6|ttdprev=r2178}}||0B Print 64-bit value in hex&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|2.6|ttdprev=r2178}}||0C Print name of station with id in next textrefstack word&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21086}}||0D Print unsigned word in tonnes&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21209}}||0E Set gender of string, NewGRF internal ID in next byte. Must be first in a string. &amp;lt;ref name=&amp;quot;gendercasedef&amp;quot;&amp;gt;See [[#Setting_genders_and_cases|Setting genders and cases]].&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21209}}||0F Select case for next substring, NewGRF internal ID in next byte. &amp;lt;ref name=&amp;quot;gendercasedef&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21211}}||10 Begin choice list value, NewGRF internal ID in next byte. &amp;lt;ref name=&amp;quot;choices&amp;quot;&amp;gt;See [[#Choosing_strings_depending_on_required_gender_or_case|Choosing strings depending on required gender or case]].&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21211}}||11 Begin choice list default &amp;lt;ref name=&amp;quot;choices&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21211}}||12 End choice list &amp;lt;ref name=&amp;quot;choices&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21211}}||13 Begin gender choice list, stack offset of substring to get gender from in next byte. &amp;lt;ref name=&amp;quot;choices&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21211}}||14 Begin case choice list &amp;lt;ref name=&amp;quot;choices&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.1|ottdrev=r21216}}||15 Begin plural choice list, stack offset of value to get plural for in next byte. &amp;lt;ref&amp;gt;See [[#Using_plural_forms|Using plural forms]].&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.2|ottdrev=r22778}}||16 Print dword as date (day, month, year) (based on year 0)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.2|ottdrev=r22778}}||17 Print dword as short date (month and year) (based on year 0)&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.2|ottdrev=r22779}}||18 Print unsigned word in horse power&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.2|ottdrev=r23063}}||19 Print unsigned word as short volume&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|1.2|ottdrev=r23063}}||1A Print unsigned word as short weight&lt;br /&gt;
|-&lt;br /&gt;
|9B..9D||||Reserved&lt;br /&gt;
|-&lt;br /&gt;
|9E..FF||{{ottdp|0.6|2.0}}||Latin-1 characters, except for the following:&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||9E Euro character &amp;quot;&amp;amp;euro;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||9F Capital Y umlaut &amp;quot;&amp;amp;Yuml;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||A0 Scroll button up&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||AA Scroll button down&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||AC Tick mark&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||AD X mark&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||AF Scroll button right&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B4 Train symbol&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B5 Truck symbol&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B6 Bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B7 Plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B8 Ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||B9 Superscript -1&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||BC Small scroll button up&lt;br /&gt;
|-&lt;br /&gt;
|||{{ottdp|0.6|2.0}}||BD Small scroll button down&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The formatting instructions must not be used except in strings that expect them, and then they may not be out of order (with the possible exception of code 86 shuffling the internal stack). When used improperly, they will most likely crash TTD. Code 81 is always safe to use (provided that the referenced text ID uses no unsafe formatting instructions either), and will insert the given text ID (e.g. &amp;quot;\81\3D\A0&amp;quot; will insert text ID A03D, &amp;quot;\98Refit Aircraft&amp;quot;). Note however that if you want to include e.g. ID D000/D400, the 00 byte will be considered the end of string, and this will therefore break if additional texts are supposed to follow in the action 4. DCxx IDs must not be included; neither codes 80 nor 81 correctly access DCxx IDs.&lt;br /&gt;
&lt;br /&gt;
Each formatting instructions removes its argument from the stack, so that the next one will receive the following bytes as arguments. Code 86 takes the top four words from the stack, let&#039;s call them W1 through W4, and reorders them as W4 W1 W2 W3. This is used for languages in which industries or stations should be named not &amp;quot;Flinfingbury Power Plant&amp;quot; but &amp;quot;Power Plant Flinfingbury&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Using genders and cases==&lt;br /&gt;
{{ottdp|1.1}} When multiple strings are combined to form a single sentence, the parts affect each other in various languages. E.g. you might have some string &amp;quot;The &amp;lt;industrytype&amp;gt; closes due to next month.&amp;quot;, where &amp;lt;industrytype&amp;gt; is replaced by a name of some industry (e.g &amp;quot;brewery&amp;quot;, &amp;quot;textile mill&amp;quot;). In German however the gender of the &amp;lt;industrytype&amp;gt; affects the string it is inserted into. For &amp;quot;brewery&amp;quot; (&amp;quot;Brauerei&amp;quot;) the article &amp;quot;The&amp;quot; is translated with &amp;quot;Die&amp;quot;, for &amp;quot;textile mill&amp;quot; (&amp;quot;Textilwerk&amp;quot;) &amp;quot;The&amp;quot; is translated with &amp;quot;Das&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In OpenTTD these interactions of strings are called &amp;quot;genders&amp;quot; and &amp;quot;cases&amp;quot;. While these names refer to the common grammatical constructions in various languages, there is a technical definition of these term wrt. OpenTTD. These might match the grammatical usages of genders and cases in some languages, or they might be used to deal with other grammatical constructions.&lt;br /&gt;
&lt;br /&gt;
Generally, when a string I is inserted into a string O:&lt;br /&gt;
* If the inner string I affects the outer O:&lt;br /&gt;
** I is said to have a gender, and &lt;br /&gt;
** O chooses different texts depending on that gender.&lt;br /&gt;
* If the outer string O affects the inner I:&lt;br /&gt;
** O sets a case for I, and &lt;br /&gt;
** I chooses different texts depending on the required case.&lt;br /&gt;
&lt;br /&gt;
===Setting genders and cases===&lt;br /&gt;
{{ottdp|1.1}} String codes 9A 0E and 9A 0F map a NewGRF internal gender or case ID to an OpenTTD gender or case. The internal ID is resolved to the appropriate OpenTTD gender or case at load time by means of the mapping. The first internal ID in the mapping that matches the ID from the string and has an existing OpenTTD gender or case is taken, i.e. the list of mappings is filtered by internal ID and existance of the OpenTTD gender/case and then the top element is used. When the gender or case ID is not known, or there is no existing OpenTTD gender or case with the mapped names the whole mapping is ignored and the default gender or case is taken.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example of gender translation table&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Gender translation table&lt;br /&gt;
// Current OpenTTD German translation uses m, w, n and p but&lt;br /&gt;
// support a (fictitious) previous version that used masculine,&lt;br /&gt;
// feminine, neuter and plural as gender names.&lt;br /&gt;
 0 * 56     00 08 01 01 02&lt;br /&gt;
            13&lt;br /&gt;
            01 &amp;quot;m&amp;quot; 00&lt;br /&gt;
            01 &amp;quot;masculine&amp;quot; 00&lt;br /&gt;
            02 &amp;quot;w&amp;quot; 00&lt;br /&gt;
            02 &amp;quot;feminine&amp;quot; 00&lt;br /&gt;
            03 &amp;quot;n&amp;quot; 00&lt;br /&gt;
            03 &amp;quot;neuter&amp;quot; 00&lt;br /&gt;
            04 &amp;quot;p&amp;quot; 00&lt;br /&gt;
            04 &amp;quot;plural&amp;quot; 00&lt;br /&gt;
            00&lt;br /&gt;
&lt;br /&gt;
// Brauerei is a female word in German; this sets it as female.&lt;br /&gt;
 1 * 40     04 0A 82 01 73 DC C3 9E 9A 0E 02 &amp;quot;Brauerei&amp;quot; 00&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case OpenTTD would look for NewGRF internal ID 2 in the gender table. This would yield &amp;quot;w&amp;quot; and &amp;quot;feminine&amp;quot; as OpenTTD gender names. In current OpenTTD this would match &amp;quot;w&amp;quot;, in the fictitious older version of OpenTTD it will match &amp;quot;feminine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Choosing strings depending on required gender or case===&lt;br /&gt;
{{ottdp|1.1}} String codes 9A 10 to 9A 14 map an OpenTTD gender or case to the NewGRF internal gender or case ID. The mapping is resolved at load time by going through all cases or genders OpenTTD&#039;s translation knows an mapping these to NewGRF internal IDs. If mapping is found the default choice list item is chosen. This happens by filtering the mapping on the gender or case name and then the NewGRF internal ID of the top element is used.&lt;br /&gt;
&lt;br /&gt;
The choice list string codes are related and must be used in a specific manner:&lt;br /&gt;
&lt;br /&gt;
Genders: 9A 13 &amp;amp;lt;offset&amp;amp;gt; (9A 10 &amp;amp;lt;index&amp;amp;gt; &amp;amp;lt;string&amp;amp;gt;)+ 9A 11 &amp;amp;lt;default&amp;amp;gt; 9A 12&lt;br /&gt;
&lt;br /&gt;
Cases: 9A 14 (9A 10 &amp;amp;lt;ndex&amp;amp;gt; &amp;amp;lt;string&amp;amp;gt;)+ 9A 11 &amp;amp;lt;default&amp;amp;gt; 9A 12&lt;br /&gt;
&lt;br /&gt;
Plurals: 9A 13 &amp;amp;lt;offset&amp;amp;gt; (9A 10 &amp;amp;lt;index&amp;amp;gt; &amp;amp;lt;string&amp;amp;gt;)+ 9A 11 &amp;amp;lt;default&amp;amp;gt; 9A 12&lt;br /&gt;
&lt;br /&gt;
The offset is the stack location of the substring/value you want to get the gender/plural for. This is the real offset plus 80, i.e. an offset of 0 becomes 80 and an offset of 1 becomes 81 in the NFO.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example of gender-dependent string&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Assuming the translation table of the previous example&lt;br /&gt;
// A string with a gender choice list and a stack item that gets resolved&lt;br /&gt;
 2 * 29     04 0A FF 01 1A DC &amp;quot;D&amp;quot; 9A 13 80 9A 10 1 &amp;quot;er&amp;quot; 9A 10 3 &amp;quot;as&amp;quot; 9A 11 &amp;quot;ie&amp;quot; 9A 12 &amp;quot; &amp;quot; 80 00&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Imagine the &amp;quot;Brauerei&amp;quot; from the previous example being, as substring, on the stack. Then this string would resolve to &amp;quot;Die Brauerei&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What happens in OpenTTD is that whenever the &amp;quot;begin gender choice list&amp;quot; string code is found it will resolve the string at the given stack location. Of that resolved string the first character is compared to the &amp;quot;set gender&amp;quot; string code and if that is the case the (mapped) OpenTTD gender is retrieved. When there is &amp;quot;set gender&amp;quot; string code the first OpenTTD gender is used. After resolving the OpenTTD gender that gender is reverse mapped to a NewGRF internal ID. If that NewGRF internal ID exists in one of the &amp;quot;choice list values&amp;quot; that (sub)string is taken (up till the next choice list value/default). If there is no reverse mapping the string at the &amp;quot;choice list default&amp;quot; string code is used up till the &amp;quot;end choice list&amp;quot; string code. Further processing of the string happens after the choice list, i.e. the (sub)strings in the choice list may not contain any special string codes except colour codes.&lt;br /&gt;
&lt;br /&gt;
Case choice lists work in a similar matter, except that instead of resolving a case from a (sub)string we &amp;quot;are&amp;quot; the substring; the string that includes this substring has set a case using the &amp;quot;select case&amp;quot; string code. As such no offset has to be given to the choice list, but the rest works in the same way as gender choice lists.&lt;br /&gt;
&lt;br /&gt;
==Using plural forms==&lt;br /&gt;
{{ottdp|1.1}} The plural list works like a gender list, however you have to choose one &amp;quot;mapping&amp;quot; from value to plural index by setting the plural form using [[Action0/Global Settings]] property 15.&lt;br /&gt;
&lt;br /&gt;
If, for example, plural form 0 is chosen using the [[Action0/Global Settings]] property 15, then there are 2 plural indices. If the value at the stack with the given offset equals 1 you get plural index 1, otherwise plural index 2. These plural indices are the indices that are used in the choice lists.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Plural form!!Plural index!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||Two forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||1&lt;br /&gt;
|-&lt;br /&gt;
|||2||rest&lt;br /&gt;
|-&lt;br /&gt;
|1||Only one form:&lt;br /&gt;
|-&lt;br /&gt;
|||1||every form&lt;br /&gt;
|-&lt;br /&gt;
|2||Two forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||0 or 1&lt;br /&gt;
|-&lt;br /&gt;
|||2||rest&lt;br /&gt;
|-&lt;br /&gt;
|3||Three forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 1, but not ending in 11&lt;br /&gt;
|-&lt;br /&gt;
|||2||0&lt;br /&gt;
|-&lt;br /&gt;
|||3||rest&lt;br /&gt;
|-&lt;br /&gt;
|4||Five forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||1&lt;br /&gt;
|-&lt;br /&gt;
|||2||2&lt;br /&gt;
|-&lt;br /&gt;
|||3||3-6&lt;br /&gt;
|-&lt;br /&gt;
|||4||7-10&lt;br /&gt;
|-&lt;br /&gt;
|||5||rest&lt;br /&gt;
|-&lt;br /&gt;
|5||Three forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 1, but not ending in 11&lt;br /&gt;
|-&lt;br /&gt;
|||2||ending in 2-9, but not ending in 1[2-9]&lt;br /&gt;
|-&lt;br /&gt;
|||3||rest&lt;br /&gt;
|-&lt;br /&gt;
|6||Three forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 1, but not ending in 11&lt;br /&gt;
|-&lt;br /&gt;
|||2||ending in 2-4, but not ending in 1[2-4]&lt;br /&gt;
|-&lt;br /&gt;
|||3||rest&lt;br /&gt;
|-&lt;br /&gt;
|7||Three forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||0&lt;br /&gt;
|-&lt;br /&gt;
|||2||ending in 2-4, but not ending in 1[2-4]&lt;br /&gt;
|-&lt;br /&gt;
|||3||rest&lt;br /&gt;
|-&lt;br /&gt;
|8||Four forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 01&lt;br /&gt;
|-&lt;br /&gt;
|||2||ending in 02&lt;br /&gt;
|-&lt;br /&gt;
|||3||ending in 03 or ending in 04&lt;br /&gt;
|-&lt;br /&gt;
|||4||rest&lt;br /&gt;
|-&lt;br /&gt;
|9||Two forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 1, but not ending in 11&lt;br /&gt;
|-&lt;br /&gt;
|||2||ret&lt;br /&gt;
|-&lt;br /&gt;
|10||Three forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||1&lt;br /&gt;
|-&lt;br /&gt;
|||2||2-4&lt;br /&gt;
|-&lt;br /&gt;
|||3||rest&lt;br /&gt;
|-&lt;br /&gt;
|11||Two forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||ending in 0, 1, 3, 6, 7 and 8&lt;br /&gt;
|-&lt;br /&gt;
|||2||ending in 2, 4, 5 and 9&lt;br /&gt;
|-&lt;br /&gt;
|12||Four forms:&lt;br /&gt;
|-&lt;br /&gt;
|||1||1&lt;br /&gt;
|-&lt;br /&gt;
|||2||0 or ending in 02-10&lt;br /&gt;
|-&lt;br /&gt;
|||3||ending in 11-19&lt;br /&gt;
|-&lt;br /&gt;
|||4||rest&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example of string using plural forms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Set the plural type to type 0&lt;br /&gt;
 0 * 7      00 08 01 01 02 15 00&lt;br /&gt;
// In case of the first stack item being 1 use &amp;quot;Tonne&amp;quot;, otherwise use &amp;quot;Tonnen&amp;quot;&lt;br /&gt;
 1 * 34     04 0B 82 01 1A DC C3 9E &amp;quot;\UE07C Tonne&amp;quot; 9A 15 80 9A 10 01 &amp;quot;&amp;quot; 9A 11 &amp;quot;n&amp;quot; 9A 12 &amp;quot; Sand&amp;quot; 00&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=UTF-8 support=&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 68}}&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 68, TTDPatch supports UTF-8 encoded input strings. Use [[Action12|action 12]] to define glyphs for the characters which do not exist in TTD&#039;s .grf files (possible since TTDPatch 2.0.1 alpha 73).&lt;br /&gt;
&lt;br /&gt;
To indicate that a given string is in UTF-8 encoding, start it with a capital thorn (U+00DE, &amp;quot;&amp;amp;THORN;&amp;quot;), encoded in UTF-8 as usual with the bytes C3 9E. Everything in that string is then assumed to be in UTF-8 encoding, with the following exception: if characters appear that are not valid UTF-8 sequences, they are assumed to be one of the above control codes. This way, it is still possible to write, e.g. &amp;quot;&amp;amp;THORN;Capacity: &amp;quot; 87 &amp;quot;litres&amp;quot;, without encoding the 87 in UTF-8 (which would instead refer to a character installed at codepoint U+0087).&lt;br /&gt;
&lt;br /&gt;
In addition, this allows using the non-Unicode characters 9E, 9F, A0, AA, AC, AD, AF, B4..B9, BC and BD from the above list, which when encoded with UTF-8 would refer to their respective Unicode characters instead. To use the TTD characters, simply do not encode them using UTF-8 but enter them directly as bytes. This causes them to be an invalid UTF-8 sequence and allows TTDPatch to use the correct symbol from TTD&#039;s fonts.&lt;br /&gt;
&lt;br /&gt;
Alternatively, these symbols (in fact, the TTD character set from 20 to FF) are also mapped into the Unicode Private Use Area at U+E0xx, so to encode the truck symbol, you may use character U+E0B5 as well, although this will probably be an unprintable character in most text editors.&lt;br /&gt;
&lt;br /&gt;
Finally, characters 7B..7F no longer function as the above formatting instructions, but will display regular glyphs instead (provided they are installed; by default TTD has none at these codepoints). Instead, to use these formatting instructions in UTF-8 mode, you need to use their Private Use Area codepoint at U+E0xx.&lt;br /&gt;
&lt;br /&gt;
Basically there are three possibilities:&lt;br /&gt;
# Characters U+E020..U+E0FF in the E0xx Private Use Area do what their respective character xx would do in TTD, as do the control characters below U+0020&lt;br /&gt;
# All other valid UTF-8 sequences display actual glyphs, if they are available&lt;br /&gt;
# All invalid UTF-8 sequences do what their individual bytes would do in TTD&lt;br /&gt;
&lt;br /&gt;
To summarize, here&#039;s a handy table:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Character!!Encoding in UTF-8 mode!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|7E||7E||Unicode Character &#039;TILDE&#039; (~)&lt;br /&gt;
|-&lt;br /&gt;
|82||82 (invalid UTF-8)||Print date (day, month, year)&lt;br /&gt;
|-&lt;br /&gt;
|82||C2 82||Display glyph for U+0082&lt;br /&gt;
|-&lt;br /&gt;
|AC||AC (invalid UTF-8)||Tick mark&lt;br /&gt;
|-&lt;br /&gt;
|AC||C2 AC||Unicode Character &#039;NOT SIGN&#039; (&amp;amp;not;)&lt;br /&gt;
|-&lt;br /&gt;
|E07E||EE 81 BE||Print unsigned word&lt;br /&gt;
|-&lt;br /&gt;
|E082||EE 82 82||Print date (day, month, year)&lt;br /&gt;
|-&lt;br /&gt;
|E0AC||EE 82 AC||Tick mark&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=2711</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=2711"/>
		<updated>2011-10-20T17:15:22Z</updated>

		<summary type="html">&lt;p&gt;Yexo: small paragraph about sorting vehicles in the purchase list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&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_CLIMATES&amp;lt;/code&amp;gt;&lt;br /&gt;
| XXX = [TEMPERATE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ARCTIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TROPICAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TOYLAND], alternatively &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;NO_CLIMATE&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ALL_CLIMATES&amp;lt;/code&amp;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;
| example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(PASS, MAIL, GOOD)&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 tick. Default vehicles use 5 for trains and road vehicles, 10 for ships and 20 for aircraft&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;
| =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;
| =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 refittable_cargo_types&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| No&lt;br /&gt;
| Doesn&#039;t matter&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Not refittable&lt;br /&gt;
|-&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Refittable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You should use refittable_cargo_classes and non_refittable_cargo_classes to decide to which cargos your vehicle is refittable, and only use refittable_cargo_types as a last resort to include/exclude some cargo type.&lt;br /&gt;
&lt;br /&gt;
Note that the default cargo cannot be selected explicitly. Instead it is automatically set to use the first refittable cargo, whenever one of the refitting properties is set.&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 the same value&lt;br /&gt;
| XXX=[TILT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2CC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; MU &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FLIP] which allows the train to enjoy the tilt bonus, use the 2nd company colour, act as a multiple unit (used for livery selection only) or allow the vehicle to be flipped (reversed) in the depot&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;
| Set to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; to 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;
| =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;
| =0&lt;br /&gt;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&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;
| =0 for both parts&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;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| =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;
| XXX=[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; MONORAIL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 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;
| =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;
| =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;
| =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;shorten_vehicle&amp;lt;/code&amp;gt;&lt;br /&gt;
| SHORTEN_TO_XXX&lt;br /&gt;
| yes&lt;br /&gt;
| XXX=[8_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 7_8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ... &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1_8]&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;
| 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 vehicle. Default means &amp;quot;take from engine_class property&amp;quot;. 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;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| =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;
| The following flags are defined: ROADVEH_FLAG_TRAM, ROADVEH_FLAG_2CC. Use 0 if you don&#039;t want to set any of these flags.&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;
| XXX = [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; ROADVEH &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NONE]&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| 0 ... 2550hp (float, power units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| 0 ... 63.75ton (float, mass units)&lt;br /&gt;
| =0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| =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;
| =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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| yes&lt;br /&gt;
|&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;
| 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 vehicle. 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;
&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_2CC)&lt;br /&gt;
| Bitmask with (currently) only one possible flag, set to 0 to disable&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;
| cargo_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
&lt;br /&gt;
==Plane 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;
| misc_flags&lt;br /&gt;
| bitmask(AIRCRAFT_FLAG_2CC)&lt;br /&gt;
| Bitmask with (currently) only one possible flag, set to 0 to disable&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;
| is_helicopter&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| XXX=[NORMAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; HELICOPTER]&lt;br /&gt;
|-&lt;br /&gt;
| is_large&lt;br /&gt;
| AIRCRAFT_SIZE_XXX&lt;br /&gt;
| XXX=[SMALL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; LARGE]. Set to AIRCRAFT_SIZE_SMALL for helicopters.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| In arbitrary units&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). 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;
| AIRPORTTYPE_SMALL, AIRPORTTYPE_LARGE, AIRPORTTYPE_HELIPORT or 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;
|&lt;br /&gt;
[[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;
| vehicle_type_id&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
| ID of 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_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;
| Not valid before 1920 and after 2090.&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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
==Vehicle callbacks==&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&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)&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;
|&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 0xFF&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 0xFF. 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 HEQS 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 0xFF&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 0xFF 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 0xFF&lt;br /&gt;
| With this callback, you can add articulated parts (e.g. tenders) to your vehicle. Called repeatedly, until 0xFF 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. Add 128 to the returned vehicle ID to display the vehicle backwards. This has the unfortunate side-effect of requiring the vehicle ID of the articulated part to be in the range 0 .. 127, currently there&#039;s no way around this limitation.&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;
&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;
| 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;
| shorten_vehicle&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;
===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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action4&amp;diff=2710</id>
		<title>Action4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action4&amp;diff=2710"/>
		<updated>2011-10-19T11:15:51Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Define strings, e.g vehicle, house or industry names&lt;br /&gt;
&lt;br /&gt;
When making new vehicle graphics, you also need to name the new vehicles, or they&#039;ll show up with their original name from TTD.&lt;br /&gt;
However, custom vehicle names assigned by the player in-game (or for TTDPatch also via TTD&#039;s vehicle.dat) will always take precendence.&lt;br /&gt;
&lt;br /&gt;
In TTDPatch you can also use this action to change most of TTD&#039;s text strings.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; &#039;&#039;&#039;04&#039;&#039;&#039; &amp;amp;lt;feature&amp;amp;gt; &amp;amp;lt;language-id&amp;amp;gt; &amp;amp;lt;num-ent&amp;amp;gt; &amp;amp;lt;offset&amp;amp;gt; &amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;Sprite-number&amp;amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;length&amp;amp;gt;||dec||The total number of bytes used in this action.&lt;br /&gt;
|-&lt;br /&gt;
|04||B||Defines action 04&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;feature&amp;amp;gt;||B||For what type of vehicle/station should this definition be used?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;language-id&amp;amp;gt;||B||Which of TTD&#039;s languages this name is for&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;num-ent&amp;amp;gt;||B||Number of consecutive strings to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;offset&amp;amp;gt;||B/W||First ID to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;text&amp;amp;gt;||S||New text strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Whether &amp;amp;lt;offset&amp;amp;gt; is a &#039;&#039;&#039;BYTE&#039;&#039;&#039; (extended byte in openttd for vehicles) or a &#039;&#039;&#039;WORD&#039;&#039;&#039; is decided by bit 7 of &amp;amp;lt;language-id&amp;amp;gt;, see below.&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== Feature ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of [[Features|feature]] that you wish to change. Set it to:&lt;br /&gt;
&lt;br /&gt;
{|- |&lt;br /&gt;
!Value!![[Features|Feature]]&lt;br /&gt;
|-&lt;br /&gt;
|00||Trains&lt;br /&gt;
|-&lt;br /&gt;
|01||Road Vehicles&lt;br /&gt;
|-&lt;br /&gt;
|02||Ships&lt;br /&gt;
|-&lt;br /&gt;
|03||Aircraft&lt;br /&gt;
|-&lt;br /&gt;
|04||Stations&lt;br /&gt;
|-&lt;br /&gt;
|07||Houses&lt;br /&gt;
|-&lt;br /&gt;
|0A||Industries&lt;br /&gt;
|-&lt;br /&gt;
|0B||Cargos&lt;br /&gt;
|-&lt;br /&gt;
|0D||Airports&lt;br /&gt;
|-&lt;br /&gt;
|0F||Objects&lt;br /&gt;
|-&lt;br /&gt;
|10||Railtypes&lt;br /&gt;
|-&lt;br /&gt;
|48||Original strings; see [[TextIDs]] for a list of TTD&#039;s text IDs.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== language IDs ===&lt;br /&gt;
The meaning of this byte depends on the GRF version of the .grf file as set in [[Action8#version|action 8]].&lt;br /&gt;
&lt;br /&gt;
{{grf|6}} Up to version 6, this is a bit mask of the following bits:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||01||American or &amp;quot;other&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|1||02||English&lt;br /&gt;
|-&lt;br /&gt;
|2||04||German&lt;br /&gt;
|-&lt;br /&gt;
|3||08||French&lt;br /&gt;
|-&lt;br /&gt;
|4||10||Spanish&lt;br /&gt;
|-&lt;br /&gt;
|7||80||Flag for 16 bit string IDs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Add the bits of all languages for which the following strings apply. Bit 7 controls, whether the following string ID consists of 16 or 8 bit. Unknown languages will use the American strings as fallback. Otherwise the string would remain undefined for these languages. To actually define strings for any new language, you must use grf version 7.&lt;br /&gt;
&lt;br /&gt;
{{grf|7}} For version 7 and higher, it is a simple language ID from the list below. (This has changed with TTDPatch 2.5 beta 4). Bit 7 has the same meaning as in the earlier versions above.&lt;br /&gt;
&lt;br /&gt;
In either scheme, you can use the value 7F or FF, respectively, to define strings shown for languages that you do not provide translation for. First set all strings to a default value using this, and later override the language specific ones if they exist.&lt;br /&gt;
&lt;br /&gt;
Currently, the scheme is to use international phone codes as language IDs, unless they&#039;re out of range, in which case pick a number vaguely related in some way. Or something else.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!ID (hex)!!Language!!Plural form &amp;lt;ref&amp;gt;For a list of plural forms see [[StringCodes]]. As the assignment of plural forms to languages is in fact not as fixed as one might expect, the used plural form is defined by each GRF separately for its strings using [[Action0GeneralVariables]] property 15.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|00||American||0&lt;br /&gt;
|-&lt;br /&gt;
|01||English||0&lt;br /&gt;
|-&lt;br /&gt;
|02||German||0&lt;br /&gt;
|-&lt;br /&gt;
|03||French||2&lt;br /&gt;
|-&lt;br /&gt;
|04||Spanish||0&lt;br /&gt;
|-&lt;br /&gt;
|05||Esperanto||0&lt;br /&gt;
|-&lt;br /&gt;
|06||Ido||0&lt;br /&gt;
|-&lt;br /&gt;
|07||Russian||6&lt;br /&gt;
|-&lt;br /&gt;
|08||Irish||4&lt;br /&gt;
|-&lt;br /&gt;
|09||Maltese||12&lt;br /&gt;
|-&lt;br /&gt;
|0A||Tamil||0&lt;br /&gt;
|-&lt;br /&gt;
|0B||Chuvash||0&lt;br /&gt;
|-&lt;br /&gt;
|0C||Chinese (Traditional)||1&lt;br /&gt;
|-&lt;br /&gt;
|0D||Serbian||6&lt;br /&gt;
|-&lt;br /&gt;
|0E||Norwegian (Nynorsk)||0&lt;br /&gt;
|-&lt;br /&gt;
|0F||Welsh||0&lt;br /&gt;
|-&lt;br /&gt;
|10||Belarusian||6&lt;br /&gt;
|-&lt;br /&gt;
|11||Marathi||0&lt;br /&gt;
|-&lt;br /&gt;
|12||Faroese||0&lt;br /&gt;
|-&lt;br /&gt;
|14||Arabic (Egypt)||1&lt;br /&gt;
|-&lt;br /&gt;
|15||Czech||10&lt;br /&gt;
|-&lt;br /&gt;
|16||Slovak||10&lt;br /&gt;
|-&lt;br /&gt;
|18||Bulgarian||0&lt;br /&gt;
|-&lt;br /&gt;
|1B||Afrikaans||0&lt;br /&gt;
|-&lt;br /&gt;
|1E||Greek||2&lt;br /&gt;
|-&lt;br /&gt;
|1F||Dutch||0&lt;br /&gt;
|-&lt;br /&gt;
|21||Basque||0&lt;br /&gt;
|-&lt;br /&gt;
|22||Catalan||0&lt;br /&gt;
|-&lt;br /&gt;
|23||Luxembourgish||0&lt;br /&gt;
|-&lt;br /&gt;
|24||Hungarian||2&lt;br /&gt;
|-&lt;br /&gt;
|26||Macedonian||0&lt;br /&gt;
|-&lt;br /&gt;
|27||Italian||0&lt;br /&gt;
|-&lt;br /&gt;
|28||Romanian||0&lt;br /&gt;
|-&lt;br /&gt;
|29||Icelandic||0&lt;br /&gt;
|-&lt;br /&gt;
|2A||Latvian||3&lt;br /&gt;
|-&lt;br /&gt;
|2B||Lithuanian||5&lt;br /&gt;
|-&lt;br /&gt;
|2C||Slovenian||8&lt;br /&gt;
|-&lt;br /&gt;
|2D||Danish||0&lt;br /&gt;
|-&lt;br /&gt;
|2E||Swedish||0&lt;br /&gt;
|-&lt;br /&gt;
|2F||Norwegian (Bokmal)||0&lt;br /&gt;
|-&lt;br /&gt;
|30||Polish||7&lt;br /&gt;
|-&lt;br /&gt;
|31||Galician||0&lt;br /&gt;
|-&lt;br /&gt;
|32||Frisian||0&lt;br /&gt;
|-&lt;br /&gt;
|33||Ukrainian||6&lt;br /&gt;
|-&lt;br /&gt;
|34||Estonian||0&lt;br /&gt;
|-&lt;br /&gt;
|35||Finnish||0&lt;br /&gt;
|-&lt;br /&gt;
|36||Portuguese||0&lt;br /&gt;
|-&lt;br /&gt;
|37||Brazilian Portuguese||2&lt;br /&gt;
|-&lt;br /&gt;
|38||Croatian||6&lt;br /&gt;
|-&lt;br /&gt;
|39||Japanese||1&lt;br /&gt;
|-&lt;br /&gt;
|3A||Korean||11&lt;br /&gt;
|-&lt;br /&gt;
|3C||Malay||0&lt;br /&gt;
|-&lt;br /&gt;
|3E||Turkish||1&lt;br /&gt;
|-&lt;br /&gt;
|42||Thai||1&lt;br /&gt;
|-&lt;br /&gt;
|54||Vietnamese||1&lt;br /&gt;
|-&lt;br /&gt;
|56||Chinese (Simplified)||1&lt;br /&gt;
|-&lt;br /&gt;
|5A||Indonesian||1&lt;br /&gt;
|-&lt;br /&gt;
|5C||Urdu||0&lt;br /&gt;
|-&lt;br /&gt;
|61||Hebrew||0&lt;br /&gt;
|-&lt;br /&gt;
|62||Persian||0&lt;br /&gt;
|-&lt;br /&gt;
|80||Flag 16 bit string IDs (added to language ID)||&lt;br /&gt;
|-&lt;br /&gt;
|7F||any (will be applied no matter what language is active)||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When translating for a new language, please simply edit this document and add the new definition here.&lt;br /&gt;
&lt;br /&gt;
=== num-ent ===&lt;br /&gt;
&lt;br /&gt;
How many consecutive entries to change.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The ID of the first string to change.&lt;br /&gt;
&lt;br /&gt;
When language-id bit 7 is clear, this is a byte value; For OpenTTD since r13482, where it is an extended byte value for vehicles.&lt;br /&gt;
&lt;br /&gt;
When language-id bit 7 is set, this is a word value in little endian notation, e.g. 8134 becomes 34 81.&lt;br /&gt;
&lt;br /&gt;
The 8 bit version is only allowed for vehicles to set their name, in which case the text ID is just the vehicle ID.&lt;br /&gt;
To replace original texts, or to define texts for usage in callbacks or properties of vehicles, stations, houses or industries you have to use the 16 bit version. However, town names are changed with [[ActionF|Action F]].&lt;br /&gt;
&lt;br /&gt;
For the usable 16 bit text IDs see the table below, resp. for feature 48 see [[TextIDs]].&lt;br /&gt;
&lt;br /&gt;
Though these ranges are shared across all features, you should still set the proper feature you are using them for.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!ID!!Content&lt;br /&gt;
|-&lt;br /&gt;
|C4xx||Set name of station class associated with station ID xx; this is the text above the preview (where otherwise TTD shows &amp;quot;Orientation&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|C5xx||New station names, this changes the text &amp;quot;number of platforms&amp;quot; into the given text when the station with this ID from the current set is selected (i.e. xx=station-id from action 3 and 0)&lt;br /&gt;
|-&lt;br /&gt;
|C9xx||Name of the house type of this ID. If both property 12 and this is set, the latest definition is used always. You should prefer setting property 12 instead of this, so executables translated with TTD Translator will show the name in the current language. However, if you can&#039;t find any suitable old TTD texts, this can be used to specify your custom name. Don&#039;t forget to set the same text for all parts of a multi-tile building.&lt;br /&gt;
|-&lt;br /&gt;
|D0xx||Miscellaneous graphics texts, unique to each .grf file. Used for newobjects and several callbacks. Some callbacks as well as newobjects support IDs up to D3FF.&lt;br /&gt;
|-&lt;br /&gt;
|D4xx||&#039;&#039;&#039;Never use in Action4&#039;&#039;&#039;, only for displaying textids in range D000-D3FF (grf specific), see [[TextIDs]]&lt;br /&gt;
|-&lt;br /&gt;
|D8xx||&#039;&#039;&#039;Never use in Action4&#039;&#039;&#039;, only usable in Action0 features, see [[TextIDs]]&lt;br /&gt;
|-&lt;br /&gt;
|DCxx||Set miscellaneous persistent GRF texts. Unlike the D0xx GRF texts, these IDs can be used to set properties. The text ID must be set before any action 0 references it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The DCxx IDs are allocated internally when defined, and are persistent in the savegame data. Each .grf file gets its own separate map of these internal IDs and thus may set all 256 of them. &amp;amp;nbsp;However, only 1024 IDs are available in total, to be shared by all .grf files ever activated in the savegame. This means these IDs should be used as sparingly as possible. But use them when they are useful!&lt;br /&gt;
&lt;br /&gt;
=== text ===&lt;br /&gt;
&lt;br /&gt;
This is a list of zero-terminated strings, there must be as many strings as num-ent specifies.&lt;br /&gt;
&lt;br /&gt;
Grfcodec version 0.9.6 or later accepts literal strings in the .nfo. These are encoded exactly as written, in whatever encoding your text editor uses; if you need a 00, put it immediately after the literal string.&lt;br /&gt;
For the supported encodings, format, and restrictions on what characters you may use, please see [[GRFActionsDetailed#Strings|GRFActionsDetailed]] and StringCodes.&lt;br /&gt;
&lt;br /&gt;
A large number of original TTD strings require a colour code in front of the actual string. You can also use these colour codes in most of your custom strings. Use them wisely! In case a string requires a colour code, the string will have the code displayed in front of the default text as listed in [[TextIDs]].Typically, a colour coded string starts with the escape character (backslash), followed by hex byte and then the actual text string itself. I.e. string 0001 (&amp;quot;\94Off edge of map&amp;quot;) has colour code 0x94 in front of the text string, which will colour it white. You can also put the plain hex byte outside the quoted string without having to escape it. &#039;&#039;94 &amp;quot;Off edge of map&amp;quot;&#039;&#039; would be the same as &#039;&#039;&amp;quot;\94Off edge of map&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following 16 colour codes are available for use:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Code&#039;&#039;&#039;!!&#039;&#039;&#039;Colour&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|88||Blue&lt;br /&gt;
|-&lt;br /&gt;
|89||Light Grey&lt;br /&gt;
|-&lt;br /&gt;
|8A||Yellow&lt;br /&gt;
|-&lt;br /&gt;
|8B||Red&lt;br /&gt;
|-&lt;br /&gt;
|8C||Light Purple&lt;br /&gt;
|-&lt;br /&gt;
|8D||Beige&lt;br /&gt;
|-&lt;br /&gt;
|8E||Light Orange&lt;br /&gt;
|-&lt;br /&gt;
|90||Light Yellow&lt;br /&gt;
|-&lt;br /&gt;
|91||Light Green&lt;br /&gt;
|-&lt;br /&gt;
|92||Light Pink&lt;br /&gt;
|-&lt;br /&gt;
|93||Brown&lt;br /&gt;
|-&lt;br /&gt;
|94||White&lt;br /&gt;
|-&lt;br /&gt;
|95||Light Blue&lt;br /&gt;
|-&lt;br /&gt;
|96||Grey&lt;br /&gt;
|-&lt;br /&gt;
|97||Purple&lt;br /&gt;
|-&lt;br /&gt;
|98||Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=ActionE&amp;diff=2698</id>
		<title>ActionE</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=ActionE&amp;diff=2698"/>
		<updated>2011-10-07T23:11:30Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Deactivate other graphics files or force activation of current file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Normally, graphics files should use [[Action7]] to deactivate themselves, if they find that other incompatible graphics have been loaded.&lt;br /&gt;
&lt;br /&gt;
However, when new sets come out, it is often not feasible to change all existing sets so that they can detect the new set. This action therefore allows the new graphics set to deactivate older sets with which it is incompatible.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 0E &amp;lt;num&amp;gt; &amp;lt;GRFIDs...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||B||Defines action 0E&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num&amp;gt;||B||Number of sets which should be deactivated&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;GRFIDs...&amp;gt;||4*B||GRFIDs of the sets to deactivate&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== num ===&lt;br /&gt;
&lt;br /&gt;
This is the number of sets you want to deactivate.&lt;br /&gt;
&lt;br /&gt;
=== GRFIDs ===&lt;br /&gt;
&lt;br /&gt;
Here you give the list of GRFIDs, in the same format as in [[Action8]], which should be deactivated.&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
Note that it is invalid to attempt the deactivation of already active graphics files. You can only prevent files lower down the newgrf(w).cfg from becoming active later. Therefore, you must check that none of the GRFIDs in this list are active already using the appropriate action 7. If the deactivation of an already active set is attempted, the current set is considered invalid and will be disabled.&lt;br /&gt;
&lt;br /&gt;
If you attempt to deactivate a set that isn&#039;t loaded, nothing happens.&lt;br /&gt;
&lt;br /&gt;
To handle the cases of incompatible sets being loaded and activated earlier, you can either attempt to overwrite all their settings and graphics, or simply deactivate this set in turn.&lt;br /&gt;
&lt;br /&gt;
If the given GRFID is identical to the GRFID of the file currently being processed, the current file is force-activated. This is most useful for making changes to the title screen menu, which would otherwise not be possible. It is strongly recommended not to use this feature in any way other than in combination with an action 7 that checks variable 92 (game mode) so that the activation only happens in the title screen. Otherwise the GRF Status Windows (de)activation is bypassed entirely.&lt;br /&gt;
&lt;br /&gt;
It is best to limit this forced activation to as few actions as possible for maximum compatibility. Forced activation is not supported by OpenTTD.&lt;br /&gt;
&lt;br /&gt;
In principle, there can be four cases and your .grf file must be able to handle all of them properly:&lt;br /&gt;
* The .grf file is active and can not be deactivated.&lt;br /&gt;
: You cannot use action E in this case.&lt;br /&gt;
* The .grf file is inactive but will be activated.&lt;br /&gt;
: This is the only case in which action E is useful, the .grf file coming below the current one in newgrf(w).cfg but being set to be activated. Action E will set it to not be activated when it is processed.&lt;br /&gt;
* The .grf file is inactive and will not be activated.&lt;br /&gt;
: This can happen because it has been processed already (it comes earlier in newgrf(w).cfg) and was deactivated, either by default or manually.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
The following is an example to deactivate GRFID 54570105 if possible, and deactivate the current file instead if not.&lt;br /&gt;
&lt;br /&gt;
 47 * 9 07 88 04 06 54 57 01 05 02&lt;br /&gt;
 48 * 9 07 88 04 08 54 57 01 05 03&lt;br /&gt;
 49 * 6 07 83 01 03 7F 04&lt;br /&gt;
 50 * x 0B 01 1F FF ... (e.g. &amp;quot;This file is deactivated because incompatible graphics are active.&amp;quot;)&lt;br /&gt;
 51 * 6 07 83 01 03 7F 00&lt;br /&gt;
 52 * x 0B 01 1F FF ... (e.g. &amp;quot;Deactivating GRFID 54570105.&amp;quot;)&lt;br /&gt;
 53 * 6 0E 01 54 57 01 05&lt;br /&gt;
&lt;br /&gt;
This carries out the following instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;47: if (GRFID 54570105 is active) goto 50&lt;br /&gt;
&lt;br /&gt;
48: if (GRFID 54570105 is inactive but will be activated) goto 52&lt;br /&gt;
&lt;br /&gt;
49: goto 54&lt;br /&gt;
&lt;br /&gt;
50: showmessage(&amp;quot;This file is deactivated because incompatible graphics are active.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
51: deactivate_current_file&lt;br /&gt;
&lt;br /&gt;
52: showmessage(&amp;quot;Deactivating GRFID 54570105.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
53: deactivate(54570105);&lt;br /&gt;
&lt;br /&gt;
continue_with_current_file;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason for this particular order of pseudo-sprites is that action 7 will not take a branch if the queried GRFID is not present at all. In that case, both sprites 47 and 48 fall through, which means the jump in 49 is carried out and the file resumes processing. The unconditional gotos in 49 and 51 are actually conditional on the climate not being 7F, which it never can be.&lt;br /&gt;
&lt;br /&gt;
Conceptually, without goto-logic, the code could be described by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if (GRFID 54570105 is active) {&lt;br /&gt;
&lt;br /&gt;
 showerror(&amp;quot;This file is deactivated because incompatible graphics are active.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
deactivate_current_file&lt;br /&gt;
&lt;br /&gt;
} else if (GRFID 54570105 is inactive but will be activated) {&lt;br /&gt;
&lt;br /&gt;
showmessage(&amp;quot;Deactivating GRFID 54570105.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
deactivate(54570105);&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Alternative_sprites&amp;diff=2668</id>
		<title>NML:Alternative sprites</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Alternative_sprites&amp;diff=2668"/>
		<updated>2011-10-03T15:17:04Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Name of block is &amp;quot;alternative_sprites&amp;quot;, not &amp;quot;alt_sprites&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;alternative_sprites&amp;lt;/code&amp;gt; block allows you to specify alternative 32bpp sprites that are drop-in replacements for some real sprites in your grf. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
 alternative_sprites(block_name, zoom_level[, filename]) {&lt;br /&gt;
 	[[NML:Realsprites|list of realsprites]]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
block_name is the name of the replace/replace_new/fontglyph/spriteset-block for which you want to provide 32bpp sprites. zoom_level can be one of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ZOOM_LEVEL_NORMAL, ZOOM_LEVEL_Z0, ZOOM_LEVEL_Z1 or ZOOM_LEVEL_Z2&amp;lt;/code&amp;gt;. Please note that &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ZOOM_LEVEL_NORMAL&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ZOOM_LEVEL_Z2&amp;lt;/code&amp;gt; are exactly the same, and that &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ZOOM_LEVEL_Z0&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ZOOM_LEVEL_Z1&amp;lt;/code&amp;gt; are for the [http://wiki.openttd.org/32bpp_Extra_Zoom_Levels extra zoom project] only (3rd party project, not officially supported). Specifying a filename is optional, it&#039;s only useful if you have multiple sprites in the same file. If every sprite is in a separate file you&#039;ll have to specify the filename for each realsprite anyway, so you can leave it out of the alternative_sprites-block.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=2654</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=2654"/>
		<updated>2011-09-13T14:07:39Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &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;
 	&amp;amp;lt;param { ... }&amp;amp;gt;&lt;br /&gt;
 }&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;
 	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>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Towns&amp;diff=2648</id>
		<title>NML:Towns</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Towns&amp;diff=2648"/>
		<updated>2011-09-11T10:58:11Z</updated>

		<summary type="html">&lt;p&gt;Yexo: Created page with &amp;quot;{{NMLNavPropVarCB}}  Towns aren&amp;#039;t a NewGRF feature of their own but town variables can be accessed via the parent scope of stations, houses and industries.   ==Town variables==  …&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Towns aren&#039;t a NewGRF feature of their own but town variables can be accessed via the parent scope of stations, houses and industries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town 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;
| is_city&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this town is marked as a &amp;quot;city&amp;quot;, 0 if it&#039;s not.&lt;br /&gt;
|-&lt;br /&gt;
| cities_enabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the advanced setting for cities is enabled, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| has_church&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if there is a church in the town.&lt;br /&gt;
|-&lt;br /&gt;
| has_stadium&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if there is a stadium in the town.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0..65536&lt;br /&gt;
| Population of the town&lt;br /&gt;
|-&lt;br /&gt;
| num_houses&lt;br /&gt;
| 0..65536&lt;br /&gt;
| Number of houses&lt;br /&gt;
|-&lt;br /&gt;
| percent_transported_passengers&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of all passengers available for transported that were transported.&lt;br /&gt;
|-&lt;br /&gt;
| percent_transported_mail&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of all mail available for transported that was transported.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone_0_radius_square&lt;br /&gt;
| 0..65536&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | See [http://newgrf-specs.tt-wiki.net/wiki/TownZones TownZones page in NFO specs]&lt;br /&gt;
|-&lt;br /&gt;
| town_zone_1_radius_square&lt;br /&gt;
| 0..65536&lt;br /&gt;
|-&lt;br /&gt;
| town_zone_2_radius_square&lt;br /&gt;
| 0..65536&lt;br /&gt;
|-&lt;br /&gt;
| town_zone_3_radius_square&lt;br /&gt;
| 0..65536&lt;br /&gt;
|-&lt;br /&gt;
| town_zone_4_radius_square&lt;br /&gt;
| 0..65536&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Properties_and_variables_and_callbacks&amp;diff=2647</id>
		<title>NML:Properties and variables and callbacks</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Properties_and_variables_and_callbacks&amp;diff=2647"/>
		<updated>2011-09-11T10:30:55Z</updated>

		<summary type="html">&lt;p&gt;Yexo: add link to town variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Select a topic from the table below or use the navigation pane at the right.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[NML:General|General]] ||  || [[NML:General#General variables|variables]] || &lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Vehicles|Vehicles]] || [[NML:Vehicles#Properties common to all vehicle types|common properties]] || [[NML:Vehicles#Vehicle variables|variables]] || [[NML:Vehicles#Vehicle callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Train properties|train properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Road vehicle properties|road vehicle properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Ship properties|ship properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Plane properties|aircraft properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Stations|Stations]] || [[NML:Stations#Station properties|properties]] || [[NML:Stations#Station variables|variables]] || [[NML:Stations#Station callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Canals|Canals]] || [[NML:Canals#Canal properties|properties]] || [[NML:Canals#Canal variables|variables]] || [[NML:Canals#Canal callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Bridges|Bridges]] || [[NML:Bridges#Bridge properties|properties]] || [[NML:Bridges#Bridge variables|variables]] || [[NML:Bridges#Bridge callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Towns|Towns]] || || [[NML:Towns@Town variables|variables]] ||&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Houses|Houses]] || [[NML:Houses#House properties|properties]] || [[NML:Houses#House variables|variables]] || [[NML:Houses#House callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Industries|Industries]]||  || [[NML:Industries#Common variables|common variables]] || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Industries#Industry properties|industry properties]] || [[NML:Industries#Industry variables|industry variables]] || [[NML:Industries#Industry callbacks|industry callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Industries#Industry tile properties|tile properties]] || [[NML:Industries#Industry tile variables|tile variables]] || [[NML:Industries#Industry tile callbacks|tile callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Cargos|Cargos]] || [[NML:Cargos#Cargo properties|properties]] || [[NML:Cargos#Cargo variables|variables]] || [[NML:Cargos#Cargo callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Airports|Airports]] || [[NML:Airports#Airport properties|properties]] || [[NML:Airports#Airport variables|variables]] || [[NML:Airports#Airport callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Airports#Airport tile properties|tile properties]] || [[NML:Airports#Airport tile variables|tile variables]] || [[NML:Airports#Airport tile callbacks|tile callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Objects|Objects]] || [[NML:Objects#Object properties|properties]] || [[NML:Objects#Object variables|variables]] || [[NML:Objects#Object callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Railtypes|Railtypes]] || [[NML:Railtypes#Railtype properties|properties]] || [[NML:Railtypes#Railtype variables|variables]] || [[NML:Railtypes#Railtype callbacks|callbacks]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Realsprites&amp;diff=2627</id>
		<title>NML:Realsprites</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Realsprites&amp;diff=2627"/>
		<updated>2011-09-08T18:11:04Z</updated>

		<summary type="html">&lt;p&gt;Yexo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
Several features will need to reference actual graphics from files you created. You can provide real sprites in many different formats, all detailed below. There is a lot of information you&#039;ll need to provide. Most important are the filename and the location of the sprite in that file. Since most blocks that reference realsprites will allow you to specify a default filename, you don&#039;t often need to give a filename for every separate sprite.&lt;br /&gt;
&lt;br /&gt;
Allowed formats:&lt;br /&gt;
&lt;br /&gt;
 [left_x, upper_y, width, height, offset_x, offset_y]&lt;br /&gt;
 [left_x, upper_y, width, height, offset_x, offset_y, compression]&lt;br /&gt;
 [left_x, upper_y, width, height, offset_x, offset_y, filename]&lt;br /&gt;
 [left_x, upper_y, width, height, offset_x, offset_y, compression, filename]&lt;br /&gt;
 [offset_x, offset_y]&lt;br /&gt;
 [offset_x, offset_y, compression]&lt;br /&gt;
 [offset_x, offset_y, filename]&lt;br /&gt;
 [offset_x, offset_y, compression, filename]&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t specify left_x, upper_y, width and height it&#039;ll default to the complete file. If you don&#039;t specify the filename it&#039;ll take the filename from the block containing this realsprite. It&#039;s a fatal error not to specify a filename for either the block containing a realsprite or the realsprite itself. For possible values of compression, see the table below.&lt;br /&gt;
&lt;br /&gt;
For all parameters you can use expressions as complex as you want as long as they can be resolved at compile time.&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of compression flags. Multiple flags may be combined using the binary-OR (|) operator.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| CROP (default) or NOCROP&lt;br /&gt;
| Whether to crop the sprites when the -c command line option is set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 [0, 0, 64, 31, -31, 0, TILE]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=2593</id>
		<title>NML:Language files</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Language_files&amp;diff=2593"/>
		<updated>2011-08-31T12:17:25Z</updated>

		<summary type="html">&lt;p&gt;Yexo: /* String codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    ;{!:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and number of plural forms is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| American&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, check the [[Action4#language IDs|master language list]] (for GRFv7) in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 16 will break your language file.&lt;/div&gt;</summary>
		<author><name>Yexo</name></author>
	</entry>
</feed>