<?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=Hirundo</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=Hirundo"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Hirundo"/>
	<updated>2026-04-17T01:57:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3306</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3306"/>
		<updated>2012-09-18T15:05:33Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Station variables */ Some additions / corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
There are no properties defined yet&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&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;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&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;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables are also shared with [[NML:Airports|airports]]. They all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&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;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead. 0 if no vehicle as picked up the cargo type yet.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years. 255 if no vehicle has picked up the cargo type yet.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variables without a 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;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| tile_type&lt;br /&gt;
| 0..7&lt;br /&gt;
| The type of tile, as defined in your station layout&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;
| track_type&lt;br /&gt;
| Entry from [[NML:Railtypetable|railtype translation table]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&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;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&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;
|&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;
| pbs_reserved&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_reserved_or_disabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, or if PBS is not enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_enabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if PBS is enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| rail_continuation&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| rail_present&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Rail continuation====&lt;br /&gt;
Variables &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; both contain a bitmask, with 8 possible bits set. Each bit corresponds to one of the adjacent tiles, refer to the table or picture below. The bit in &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; is set if the tile contains any rail track. Bits 0..3 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are only set if there is rail track on the tile and if that track connects to the current tile (note that this tile has no connection to the tiles corresponding to bits 2 and 3, but that doesn&#039;t matter). Bits 4..7 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are set if there is track on the tile and if that track connects to tile 2 or 3, whichever is applicable.&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Set if rail continues in direction of...&lt;br /&gt;
|-&lt;br /&gt;
|0||+Length&lt;br /&gt;
|-&lt;br /&gt;
|1||-Length&lt;br /&gt;
|-&lt;br /&gt;
|2||+Platforms&lt;br /&gt;
|-&lt;br /&gt;
|3||-Platforms&lt;br /&gt;
|-&lt;br /&gt;
|4||+Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|5||-Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|6||+Length, -Platforms&lt;br /&gt;
|-&lt;br /&gt;
|7||-Length, -Platforms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following picture illustrates which bits represent which tile for the two possible station orientations:&lt;br /&gt;
&lt;br /&gt;
[[File:station_var45.png]]&lt;br /&gt;
&lt;br /&gt;
===Variables that require one or more arguments===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;The first parameter is the distance to move along the platform, the second parameter is the distance to move sideways (between platforms). Both parameters are signed numbers with range -8..7, negative numbers go northwards.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
| See [[NML:List of tile slopes|tile slopes]] for an overview of possible values. Note that the slope is &#039;mirrored&#039; in the NW-SE orientation, i.e. the bits for CORNER_W and CORNER_E are swapped.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&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;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&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;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&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;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_station&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_station_id&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255&lt;br /&gt;
| If the given tile is a station tile defined by this NewGRF, the item ID. Else, the content is undefined.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by this NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by a different NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile with original graphics, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is part of the same station, 0 otherwise. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_perpendicular&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile a station tile aligned perpendicular to this tile, 0 if it is aligned parallel. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_platform_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..3&lt;br /&gt;
| Platform type of the given tile. Value is undefined if the tile is not a station tile, else possible values are:&lt;br /&gt;
;0:plain platform&lt;br /&gt;
;1:platform with building&lt;br /&gt;
;2:platform with roof, left side&lt;br /&gt;
;3:platform with roof, right side&lt;br /&gt;
|-&lt;br /&gt;
| platform_length&lt;br /&gt;
| PLATFROM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;&amp;gt;Possible values are: &lt;br /&gt;
;PLATFORM_SAME_STATION:Consider all tiles that are part of the same station&lt;br /&gt;
;PLATFORM_SAME_SECTION:Consider all tiles that are part of the same individually built section&lt;br /&gt;
;PLATFORM_SAME_DIRECTION:Consdier all tiles that are part of the same station and have the same platform direction.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Length of the platform (along the platform direction) in tiles&lt;br /&gt;
|-&lt;br /&gt;
| platform_count&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Number of platforms (counted perpendicular to the platform direction)&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the first (northernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the last (southernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Position along the platform, 0 for the middle tile. When the number of tiles is even, the southernmost of the two middle tiles is assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from top to bottom, so 0 for the northernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from bottom to top, so 0 for the southernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Platform number, counting top to bottom, using 0 for the middle platform. When the number of platforms is even, the southernmost of the two middle platformsis assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
There are no callbacks defined yet&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3305</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3305"/>
		<updated>2012-09-17T18:34:53Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Station variables */ Add 60+X variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
There are no properties defined yet&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&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;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&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;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables are also shared with [[NML:Airports|airports]]. They all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&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;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variables without a 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;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| tile_type&lt;br /&gt;
| 0..7&lt;br /&gt;
| The type of tile, as defined in your station layout&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;
| track_type&lt;br /&gt;
| Entry from [[NML:Railtypetable|railtype translation table]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&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;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&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;
|&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;
| pbs_reserved&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_reserved_or_disabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, or if PBS is not enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_enabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if PBS is enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| rail_continuation&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| rail_present&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Rail continuation====&lt;br /&gt;
Variables &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; both contain a bitmask, with 8 possible bits set. Each bit corresponds to one of the adjacent tiles, refer to the table or picture below. The bit in &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; is set if the tile contains any rail track. Bits 0..3 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are only set if there is rail track on the tile and if that track connects to the current tile (note that this tile has no connection to the tiles corresponding to bits 2 and 3, but that doesn&#039;t matter). Bits 4..7 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are set if there is track on the tile and if that track connects to tile 2 or 3, whichever is applicable.&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Set if rail continues in direction of...&lt;br /&gt;
|-&lt;br /&gt;
|0||+Length&lt;br /&gt;
|-&lt;br /&gt;
|1||-Length&lt;br /&gt;
|-&lt;br /&gt;
|2||+Platforms&lt;br /&gt;
|-&lt;br /&gt;
|3||-Platforms&lt;br /&gt;
|-&lt;br /&gt;
|4||+Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|5||-Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|6||+Length, -Platforms&lt;br /&gt;
|-&lt;br /&gt;
|7||-Length, -Platforms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following picture illustrates which bits represent which tile for the two possible station orientations:&lt;br /&gt;
&lt;br /&gt;
[[File:station_var45.png]]&lt;br /&gt;
&lt;br /&gt;
===Variables that require one or more arguments===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_station&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_station_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| If the given tile is a station tile defined by this NewGRF, the item ID. Else, the content is undefined.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by this NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by a different NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile with original graphics, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is part of the same station, 0 otherwise. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_perpendicular&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile a station tile aligned perpendicular to this tile, 0 if it is aligned parallel. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_platform_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..3&lt;br /&gt;
| Platform type of the given tile. Value is undefined if the tile is not a station tile, else possible values are:&lt;br /&gt;
;0:plain platform&lt;br /&gt;
;1:platform with building&lt;br /&gt;
;2:platform with roof, left side&lt;br /&gt;
;3:platform with roof, right side&lt;br /&gt;
|-&lt;br /&gt;
| platform_length&lt;br /&gt;
| PLATFROM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;&amp;gt;Possible values are: &lt;br /&gt;
;PLATFORM_SAME_STATION:Consider all tiles that are part of the same station&lt;br /&gt;
;PLATFORM_SAME_SECTION:Consider all tiles that are part of the same individually built section&lt;br /&gt;
;PLATFORM_SAME_DIRECTION:Consdier all tiles that are part of the same station and have the same platform direction.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Length of the platform (along the platform direction) in tiles&lt;br /&gt;
|-&lt;br /&gt;
| platform_count&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Number of platforms (counted perpendicular to the platform direction)&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the first (northernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the last (southernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Position along the platform, 0 for the middle tile. When the number of tiles is even, the southernmost of the two middle tiles is assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from top to bottom, so 0 for the northernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from bottom to top, so 0 for the southernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Platform number, counting top to bottom, using 0 for the middle platform. When the number of platforms is even, the southernmost of the two middle platformsis assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
There are no callbacks defined yet&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3304</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3304"/>
		<updated>2012-09-17T16:40:54Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Station variables */ Add 40+x variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
There are no properties defined yet&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&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;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&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;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables are also shared with [[NML:Airports|airports]]. They all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&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;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variables without a 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;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| tile_type&lt;br /&gt;
| 0..7&lt;br /&gt;
| The type of tile, as defined in your station layout&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;
| track_type&lt;br /&gt;
| Entry from [[NML:Railtypetable|railtype translation table]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&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;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&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;
|&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;
| pbs_reserved&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_reserved_or_disabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, or if PBS is not enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_enabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if PBS is enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| rail_continuation&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| rail_present&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Rail continuation====&lt;br /&gt;
Variables &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; both contain a bitmask, with 8 possible bits set. Each bit corresponds to one of the adjacent tiles, refer to the table or picture below. The bit in &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; is set if the tile contains any rail track. Bits 0..3 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are only set if there is rail track on the tile and if that track connects to the current tile (note that this tile has no connection to the tiles corresponding to bits 2 and 3, but that doesn&#039;t matter). Bits 4..7 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are set if there is track on the tile and if that track connects to tile 2 or 3, whichever is applicable.&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Set if rail continues in direction of...&lt;br /&gt;
|-&lt;br /&gt;
|0||+Length&lt;br /&gt;
|-&lt;br /&gt;
|1||-Length&lt;br /&gt;
|-&lt;br /&gt;
|2||+Platforms&lt;br /&gt;
|-&lt;br /&gt;
|3||-Platforms&lt;br /&gt;
|-&lt;br /&gt;
|4||+Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|5||-Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|6||+Length, -Platforms&lt;br /&gt;
|-&lt;br /&gt;
|7||-Length, -Platforms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following picture illustrates which bits represent which tile for the two possible station orientations:&lt;br /&gt;
&lt;br /&gt;
[[File:station_var45.png]]&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
There are no callbacks defined yet&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=3303</id>
		<title>NML:Airports</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=3303"/>
		<updated>2012-09-16T20:40:24Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Airport variables */ Add link to base station vars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Airports and airport tiles can only be defined in OpenTTD {{ottd|1.1|r19459}} or later.&lt;br /&gt;
&lt;br /&gt;
==Airport (tile) IDs==&lt;br /&gt;
Airport and airport tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. For airport tiles, you should start your item definition with the &#039;substitute&#039;-property, which allocates a new airport tile. The value of this property should be the ID of a [[AirportTileDefaultProps|default airport tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing airport tile to be replaced with your item. For airports, there only is an &#039;override&#039;-property, which acts as a combined substitute and override.&lt;br /&gt;
&lt;br /&gt;
==Airport properties==&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;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Name of the airport&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} The id of airport to replace / override, see [[AirportTypes]].&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| list of layouts&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20377}}&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| [start year, last year]&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} List of the availablility years: first and last year it can be built&lt;br /&gt;
|-&lt;br /&gt;
| ttd_airport-type&lt;br /&gt;
| 0 ... 3&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Substitute TTDPatch airport type&lt;br /&gt;
|-&lt;br /&gt;
| catchment_area&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Catchment area of the airport in tiles around its perimeter&lt;br /&gt;
|-&lt;br /&gt;
| noise_level&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Noise generation of this airport&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 this airport&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport tile properties==&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;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to override, see [[AirportTypes]].&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to replace&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} 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;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}}&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} See [[NML:Animation speed|speed settings]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_APT_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} 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;
&lt;br /&gt;
&lt;br /&gt;
==Airport variables==&lt;br /&gt;
&lt;br /&gt;
A number of variables are shared between airports and stations. These are listed on the [[NML:Stations#Base station variables|stations]] page.&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;
| layout&lt;br /&gt;
| 0 .. (number of layouts - 1)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20364}} Layout number of the airport (index in the layouts array)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport 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;
| terrain_type&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| town_radius_group&lt;br /&gt;
|&lt;br /&gt;
|&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;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require a signed x,y offset as parameters. The offset is relative to the current tile. Offset 0,0 means 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_same_airport&lt;br /&gt;
| 1 if the tile is part of the same airport, 0 otherwise&lt;br /&gt;
|&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_airporttile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an airport tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original airport tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an airport tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an airport tile or it belongs to another GRF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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 set (with 1 sprite)&lt;br /&gt;
| Preview graphics to use in the build menu. One sprite per layout may be given, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; to distinguish between layouts.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the buy menu. String may differ per layout, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable for this.&lt;br /&gt;
|-&lt;br /&gt;
| layout_name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the airport layout in the variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that, although the airport isn&#039;t built yet, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable is always available and set to the layout the user has selected in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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 an airport tile&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. 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. 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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_BUILT&lt;br /&gt;
| Airport is built (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_TILELOOP&lt;br /&gt;
| Airport tile is processed in the tileloop (at different times for different tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_NEW_CARGO&lt;br /&gt;
| New cargo arrives at the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_CARGO_TAKEN&lt;br /&gt;
| All cargo of a cargo type is removed from the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_250_TICKS&lt;br /&gt;
| Every 250 ticks (all tiles at the same time)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3302</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3302"/>
		<updated>2012-09-16T20:39:17Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Base station variables */ Make clear that 2nd table is shared also&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
There are no properties defined yet&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&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;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&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;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables are also shared with [[NML:Airports|airports]]. They all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&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;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
There are no callbacks defined yet&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3301</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3301"/>
		<updated>2012-09-16T20:38:07Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add base station variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
There are no properties defined yet&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&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;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&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;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&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;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
There are no callbacks defined yet&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3300</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=3300"/>
		<updated>2012-09-16T19:55:54Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add stub page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations in NML are currently a work-in-progress. Therefore, things may be added, changed or removed without notice. At the moment, it is not yet possible to write your own station NewGRF in NML.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Switch&amp;diff=3294</id>
		<title>NML:Switch</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Switch&amp;diff=3294"/>
		<updated>2012-09-11T22:01:46Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about new possibilities for defaults&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
 switch (&amp;amp;lt;expression&amp;amp;gt;, (SELF|PARENT), &amp;amp;lt;ID&amp;amp;gt;, &amp;amp;lt;expression&amp;amp;gt;) {&lt;br /&gt;
 	(&amp;amp;lt;range&amp;amp;gt;: &amp;amp;lt;return_value&amp;amp;gt;;)*&lt;br /&gt;
 	&amp;amp;lt;return_value&amp;amp;gt;;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The four parameters have the following meaning:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;expression&amp;amp;gt;&amp;lt;/code&amp;gt;: The feature for which this switch is used (see [[NML:Features|Features]]).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;(SELF|PARENT)&amp;lt;/code&amp;gt;Which variables to use. SELF uses the variables of the item itself, while PARENT uses the variables of a related object. This related object differs per feature, refer to the table below.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;ID&amp;amp;gt;&amp;lt;/code&amp;gt;Name of this switch block. This (unique) name can be used to refer to the block from other switch- or graphics-blocks.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;expression&amp;amp;gt;&amp;lt;/code&amp;gt;The expression that will be evaluated to make a decision. This expression may contain variables. Instead of a single expression this may also be an array of expressions. In that case all of the array elements are evaluated in order and the last one is used to make a decision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Feature&lt;br /&gt;
! SELF&lt;br /&gt;
! PARENT&lt;br /&gt;
! permanent&amp;lt;br /&amp;gt;storage&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_TRAINS&lt;br /&gt;
| Engine / wagon / articulated part itself&lt;br /&gt;
| Front engine&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_ROADVEHS&lt;br /&gt;
| Road vehicle part&lt;br /&gt;
| First road vehicle part&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_SHIPS&lt;br /&gt;
| Ship&lt;br /&gt;
| Ship&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_AIRCRAFT&lt;br /&gt;
| Aircraft (a)&lt;br /&gt;
| Aircraft&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_STATIONS&lt;br /&gt;
| Station tile&lt;br /&gt;
| Town&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_CANALS&lt;br /&gt;
| Canal tile&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_BRIDGES&lt;br /&gt;
| Bridge&lt;br /&gt;
| Town&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_HOUSES&lt;br /&gt;
| House tile&lt;br /&gt;
| Town&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_GLOBALVARS&lt;br /&gt;
| N/A&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_INDUSTRYTILES&lt;br /&gt;
| Industry tile&lt;br /&gt;
| Industry to which the tile belongs&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_INDUSTRIES&lt;br /&gt;
| Industry&lt;br /&gt;
| Town&lt;br /&gt;
| yes&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_CARGOS&lt;br /&gt;
| Cargo type&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_SOUNDEFFECTS&lt;br /&gt;
| N/A&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_AIRPORTS&lt;br /&gt;
| Airport&lt;br /&gt;
| N/A&lt;br /&gt;
| yes&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_SIGNALS&lt;br /&gt;
| N/A&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_OBJECTS&lt;br /&gt;
| Object tile&lt;br /&gt;
| Town&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_RAILTYPES&lt;br /&gt;
| Rail tile&lt;br /&gt;
| N/A&lt;br /&gt;
| no&lt;br /&gt;
|-&lt;br /&gt;
| FEAT_AIRPORTTILES&lt;br /&gt;
| Airport tile&lt;br /&gt;
| Airport&lt;br /&gt;
| no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(a) Except for mail capacity callbacks, where it refers to the mail compartment. To refer to the aircraft itself, use PARENT scope there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;range&amp;amp;gt;&amp;lt;/code&amp;gt; can either be a single number or two numbers separated by two dots. In the first case, the range matches if the result of the computation is equal to the supplied value. If a range (&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;a .. b&amp;lt;/code&amp;gt;) is supplied, it matches if the computed result is within that range. If several lines of the switch block match the expression being tested the first applicable result will be returned.&lt;br /&gt;
&lt;br /&gt;
Possible values for &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;return_value&amp;amp;gt;&amp;lt;/code&amp;gt; are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;ID&amp;amp;gt;;&amp;lt;/code&amp;gt; chains to the (random-)switch or spritegroup with the given ID.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;return (&amp;amp;lt;expression&amp;amp;gt;|&amp;amp;lt;string&amp;amp;gt;);&amp;lt;/code&amp;gt; returns the given expression or string as a result of the callback. A returned expression may contain variables (with the same scope as the switch block itself), parameter accesses and everything else that a normal switch-expression may contain.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;return;&amp;lt;/code&amp;gt; returns the computed value directly as a callback result. Note that the maximum value for callback results is 32511 (0x7EFF).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_FAILED;&amp;lt;/code&amp;gt; stops processing and returns an explicit failure code.&lt;br /&gt;
&lt;br /&gt;
Some example code is given below. Note that the code does not have an actual meaning, it is merely meant to demonstrate all the various options available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 switch (FEAT_TRAINS, PARENT, some_vehicle_switch, (position_in_consist + param[1]) % 4) {&lt;br /&gt;
 	0..2: return string(STRING_FOO_BAR); //return a text message&lt;br /&gt;
 	3: return; //return the computed value&lt;br /&gt;
 	5..300: return 42; //42 is always a good answer&lt;br /&gt;
 	400: other_switch; //chain to some other switch block&lt;br /&gt;
 	401: return num_vehs_in_consist + 1; //return a value with a variable access&lt;br /&gt;
 	CB_FAILED; //return a failure result as default&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use temporary variables and with some features also pemanent variables to store and retrieve some values by means of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(value, register)&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;LOAD_TEMP(register)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_PERM(value, register)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;LOAD_PERM(register[, grfid])&amp;lt;/code&amp;gt; respectively. Using temporary storage is useful when you want to use the result of an expensive calculation in various decisions (switches) within the chain (like for example the number of a certain wagon type within a train). Permanent storage might be useful to control the long-term behaviour of an object. Note that it is only available for industries, airports and towns. For towns, you can optionally specify a grfid to load registers belonging to a different grf. Note that accessing (both reading and writing) permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
&lt;br /&gt;
{{nml|0.3}} As of NML 0.3 it is possible to specify the default value using &amp;lt;code&amp;gt;default: &amp;amp;lt;value&amp;amp;gt;;&amp;lt;/code&amp;gt; as one of the &#039;ranges&#039;. Specifying multiple default values (either this way or by the classical method) is of course not possible, but omitting a default value is allowed. In that case, if none of the ranges matches, the callback fails.&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3293</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=3293"/>
		<updated>2012-09-11T19:50:34Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Industry variables */ Fix: add missing NML version tags&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 (tile) ID allocation ==&lt;br /&gt;
Industry and industry tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new industry (tile). The value of this property should be the ID of a [[IndustryDefaultProps|default industry]] or [[IndustryTileDefaultProps|default industry tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF). &lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing industry (tile) to be replaced with your item. You should use this if you are for example defining a coal mine which changes production more dynamically. If your type is not a direct replacement of an existing item, don&#039;t set this property.&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;
| production_rate_1&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 1&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_2&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 2&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&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;
{{nml|0.2}} 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;
{{nml|0.3}}. 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;
| build_prod_change&lt;br /&gt;
| Value in range 4-128&lt;br /&gt;
| Called when an industry is constructed.  Return value is production level (default 16).  Can also be used to initialise permanent storage when an industry is constructed.  Requires OpenTTD &amp;gt; r24186 and nml &amp;gt; 1886.&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 closure 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>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3292</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=3292"/>
		<updated>2012-09-11T19:49:18Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Industry variables */ Add production_rate_1/2&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 (tile) ID allocation ==&lt;br /&gt;
Industry and industry tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new industry (tile). The value of this property should be the ID of a [[IndustryDefaultProps|default industry]] or [[IndustryTileDefaultProps|default industry tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF). &lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing industry (tile) to be replaced with your item. You should use this if you are for example defining a coal mine which changes production more dynamically. If your type is not a direct replacement of an existing item, don&#039;t set this property.&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;
| production_rate_1&lt;br /&gt;
| 0..255&lt;br /&gt;
| Amount of &#039;output cargo type 1&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_2&lt;br /&gt;
| 0..255&lt;br /&gt;
| Amount of &#039;output cargo type 2&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&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;
{{nml|0.2}} 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;
{{nml|0.3}}. 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;
| build_prod_change&lt;br /&gt;
| Value in range 4-128&lt;br /&gt;
| Called when an industry is constructed.  Return value is production level (default 16).  Can also be used to initialise permanent storage when an industry is constructed.  Requires OpenTTD &amp;gt; r24186 and nml &amp;gt; 1886.&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 closure 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>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3290</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3290"/>
		<updated>2012-09-05T12:34:38Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House properties */ Max probability is 15, not 16&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 15 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation. The tile will be processed by the periodic tile processing loop every (X + 1)*256 ticks, with X being the value of this property.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, also used for [[NML:Random_switch|random switch]]-blocks. Initially these are the same for all tiles of a multi-tile house.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house.&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match. See also the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X. Note that for a multi-tile house, generally only the north tile has a sensible class value.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = &amp;lt;nowiki&amp;gt;[CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING]&amp;lt;/nowiki&amp;gt; to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3289</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3289"/>
		<updated>2012-09-05T12:04:48Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House callbacks */ Fix missing nowiki tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation. The tile will be processed by the periodic tile processing loop every (X + 1)*256 ticks, with X being the value of this property.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, also used for [[NML:Random_switch|random switch]]-blocks. Initially these are the same for all tiles of a multi-tile house.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house.&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match. See also the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X. Note that for a multi-tile house, generally only the north tile has a sensible class value.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = &amp;lt;nowiki&amp;gt;[CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING]&amp;lt;/nowiki&amp;gt; to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3288</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3288"/>
		<updated>2012-09-05T11:59:35Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Clarify refresh_multiplier&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation. The tile will be processed by the periodic tile processing loop every (X + 1)*256 ticks, with X being the value of this property.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, also used for [[NML:Random_switch|random switch]]-blocks. Initially these are the same for all tiles of a multi-tile house.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house.&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match. See also the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X. Note that for a multi-tile house, generally only the north tile has a sensible class value.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3287</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3287"/>
		<updated>2012-09-05T11:37:53Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ Add missing variable random_bits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, also used for [[NML:Random_switch|random switch]]-blocks. Initially these are the same for all tiles of a multi-tile house.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house.&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match. See also the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X. Note that for a multi-tile house, generally only the north tile has a sensible class value.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3286</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3286"/>
		<updated>2012-09-03T20:13:56Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ Add notes about multi-tile houses&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house.&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match. See also the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X. Note that for a multi-tile house, generally only the north tile has a sensible class value.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3285</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3285"/>
		<updated>2012-09-03T20:09:14Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Multi-tile houses */ Fix indentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, of the north tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3284</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3284"/>
		<updated>2012-09-03T20:08:52Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add section about house IDs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
 * If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
 * When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, of the north tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Item&amp;diff=3283</id>
		<title>NML:Item</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Item&amp;diff=3283"/>
		<updated>2012-09-03T19:57:12Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* General */ ID allocation by NML&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 item (&amp;amp;lt;expression&amp;amp;gt; [, &amp;amp;lt;ID&amp;amp;gt; [, &amp;amp;lt;expression&amp;amp;gt; [, &amp;amp;lt;expression&amp;amp;gt;]]]) {&lt;br /&gt;
 	(&amp;amp;lt;property-block&amp;amp;gt;|&amp;amp;lt;graphics-block&amp;amp;gt;|&amp;amp;lt;livery_override-block&amp;amp;gt;)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The first argument is the feature of the item, the second (optional) argument is the name used to identify the object throughout the NML file and the third (optional) argument is the numerical id you want to use for this item. The meaning and relevance of this id differs per-feature, refer to the feature-specific pages for more information. The default value is -1, which lets NML pick an id for you. The fourth (optional) argument is the size, which is relavant for [[NML:Houses|houses]] only and explained there.&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;
 item (FEAT_ROADVEHS, hereford_tram) {&lt;br /&gt;
 	property {&lt;br /&gt;
 		name:               string(STR_NAME_HEREFORD_TRAM);&lt;br /&gt;
 		climates_available: ALL_CLIMATES;&lt;br /&gt;
 		introduction_date:  date(1940,1,1);&lt;br /&gt;
 		speed:              60 km/h;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Property block ==&lt;br /&gt;
&lt;br /&gt;
 property {&lt;br /&gt;
 	(&amp;amp;lt;ID&amp;amp;gt;: (&amp;amp;lt;string&amp;amp;gt;|(&amp;amp;lt;expression&amp;amp;gt; [&amp;amp;lt;unit&amp;amp;gt;]));)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This one looks a lot more complicated than it actually is. A property-block contains one or more assignments. Each assignment starts with the name of the property that is changed followed by a colon. After the colon follows the value and you end the line with a semicolon. The type of the value depends on the property, some properties require a string as value and some an expression. For some properties you can optionally specify a unit that is used to convert the value to the unit that is written to the output file. You can only use a unit if the expression is constant. [[NML:Units|List of valid units]]&lt;br /&gt;
&lt;br /&gt;
== Graphics block ==&lt;br /&gt;
&lt;br /&gt;
A graphics block must be placed in an item-block. It allows to define the graphics for a particular item, as well as various callbacks. Callbacks are used to define various things at run time, based on information (variables) of the item itself. This provides a much greater degree of flexibility than setting properties. An example (using fictional callback names):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
     graphics {&lt;br /&gt;
         callback_a: switch_a;&lt;br /&gt;
         callback_b: return 42 + some_var;&lt;br /&gt;
         default: some_spritegroup;&lt;br /&gt;
     }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callbacks that are available differ per feature, refer to the feature-specific pages for more information. The &#039;default&#039;-callback is usually used to resolve the graphics. For each callback a return value may be specified, in the same way as for [[NML:Switch| switch-blocks]]. Note that all callbacks have to be defined in a &#039;&#039;&#039;single&#039;&#039;&#039; graphics-block.&lt;br /&gt;
&lt;br /&gt;
For vehicles and stations, a cargo type (identifier from the [[NML:Cargotable|cargo table]]) may be used as callback name, to provide cargo-specific graphics.&lt;br /&gt;
&lt;br /&gt;
== Livery override ==&lt;br /&gt;
&lt;br /&gt;
[[Image:NML liveryoverride.png|frame|left|Same cars, different engine, different car sprites]]&lt;br /&gt;
&lt;br /&gt;
A livery override block offers the option to change the look and behaviour of a wagon depending on the engine it is attached to. It is basically the same as a graphics-block and its syntax is the same. The difference is that it only applies to a particular combination of an engine and a wagon. E.g. passenger wagons could adapt their livery to match the engine, to make the consist look like a multiple-unit train. The spritegroup needs to be defined before it can be used in a livery override. A livery override block is always part of the &#039;&#039;&#039;engine&#039;&#039;&#039; definition and looks like&lt;br /&gt;
&lt;br /&gt;
 livery_override (vehicleID) {&lt;br /&gt;
 	callback_name: switch_name;&lt;br /&gt;
 	callback_name2: return value;&lt;br /&gt;
 	default: spritegroup_name;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
For an example see the [[NML:Spritegroup|spritegroup]]&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Item&amp;diff=3282</id>
		<title>NML:Item</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Item&amp;diff=3282"/>
		<updated>2012-09-03T19:53:15Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* General */ Add information about item size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 item (&amp;amp;lt;expression&amp;amp;gt; [, &amp;amp;lt;ID&amp;amp;gt; [, &amp;amp;lt;expression&amp;amp;gt; [, &amp;amp;lt;expression&amp;amp;gt;]]]) {&lt;br /&gt;
 	(&amp;amp;lt;property-block&amp;amp;gt;|&amp;amp;lt;graphics-block&amp;amp;gt;|&amp;amp;lt;livery_override-block&amp;amp;gt;)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The first argument is the feature of the item, the second (optional) argument is the name used to identify the object throughout the NML file and the third (optional) argument is the numerical id you want to use for this item. The meaning and relevance of this id differs per-feature, refer to the feature-specific pages for more information. The fourth (optional) argument is the size, which is relavant for [[NML:Houses|houses]] only and explained there.&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;
 item (FEAT_ROADVEHS, hereford_tram) {&lt;br /&gt;
 	property {&lt;br /&gt;
 		name:               string(STR_NAME_HEREFORD_TRAM);&lt;br /&gt;
 		climates_available: ALL_CLIMATES;&lt;br /&gt;
 		introduction_date:  date(1940,1,1);&lt;br /&gt;
 		speed:              60 km/h;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Property block ==&lt;br /&gt;
&lt;br /&gt;
 property {&lt;br /&gt;
 	(&amp;amp;lt;ID&amp;amp;gt;: (&amp;amp;lt;string&amp;amp;gt;|(&amp;amp;lt;expression&amp;amp;gt; [&amp;amp;lt;unit&amp;amp;gt;]));)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This one looks a lot more complicated than it actually is. A property-block contains one or more assignments. Each assignment starts with the name of the property that is changed followed by a colon. After the colon follows the value and you end the line with a semicolon. The type of the value depends on the property, some properties require a string as value and some an expression. For some properties you can optionally specify a unit that is used to convert the value to the unit that is written to the output file. You can only use a unit if the expression is constant. [[NML:Units|List of valid units]]&lt;br /&gt;
&lt;br /&gt;
== Graphics block ==&lt;br /&gt;
&lt;br /&gt;
A graphics block must be placed in an item-block. It allows to define the graphics for a particular item, as well as various callbacks. Callbacks are used to define various things at run time, based on information (variables) of the item itself. This provides a much greater degree of flexibility than setting properties. An example (using fictional callback names):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
     graphics {&lt;br /&gt;
         callback_a: switch_a;&lt;br /&gt;
         callback_b: return 42 + some_var;&lt;br /&gt;
         default: some_spritegroup;&lt;br /&gt;
     }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callbacks that are available differ per feature, refer to the feature-specific pages for more information. The &#039;default&#039;-callback is usually used to resolve the graphics. For each callback a return value may be specified, in the same way as for [[NML:Switch| switch-blocks]]. Note that all callbacks have to be defined in a &#039;&#039;&#039;single&#039;&#039;&#039; graphics-block.&lt;br /&gt;
&lt;br /&gt;
For vehicles and stations, a cargo type (identifier from the [[NML:Cargotable|cargo table]]) may be used as callback name, to provide cargo-specific graphics.&lt;br /&gt;
&lt;br /&gt;
== Livery override ==&lt;br /&gt;
&lt;br /&gt;
[[Image:NML liveryoverride.png|frame|left|Same cars, different engine, different car sprites]]&lt;br /&gt;
&lt;br /&gt;
A livery override block offers the option to change the look and behaviour of a wagon depending on the engine it is attached to. It is basically the same as a graphics-block and its syntax is the same. The difference is that it only applies to a particular combination of an engine and a wagon. E.g. passenger wagons could adapt their livery to match the engine, to make the consist look like a multiple-unit train. The spritegroup needs to be defined before it can be used in a livery override. A livery override block is always part of the &#039;&#039;&#039;engine&#039;&#039;&#039; definition and looks like&lt;br /&gt;
&lt;br /&gt;
 livery_override (vehicleID) {&lt;br /&gt;
 	callback_name: switch_name;&lt;br /&gt;
 	callback_name2: return value;&lt;br /&gt;
 	default: spritegroup_name;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
For an example see the [[NML:Spritegroup|spritegroup]]&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3281</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3281"/>
		<updated>2012-09-03T19:49:44Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ Add new variables, update information on others&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&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..1&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;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, of the north tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3280</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3280"/>
		<updated>2012-09-03T19:44:45Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Update information about callbacks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&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 house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3279</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3279"/>
		<updated>2012-09-02T21:35:09Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ construction_state erroneously mentioned industry tiles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3278</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3278"/>
		<updated>2012-09-02T17:53:10Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add info about building_class property&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3277</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3277"/>
		<updated>2012-09-02T17:51:38Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House properties */ Acceptance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&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 each tile of the house. 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 fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept 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;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3276</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3276"/>
		<updated>2012-09-02T17:46:17Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House callbacks */ Improve documentation of animation callbacks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3275</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3275"/>
		<updated>2012-09-02T17:43:10Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House properties */ Add notes about substitute/override types having same size. Update building_flags documentation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times. Your house and the overridden house must have the same size, see the list of [[NML:List_of_default_house_properties|default house types]].&lt;br /&gt;
|-&lt;br /&gt;
| building_flags.&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain. Note that 2x2 buildings will always only be built on flat land, even if this bit isn&#039;t set.&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:List_of_default_house_properties&amp;diff=3274</id>
		<title>NML:List of default house properties</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:List_of_default_house_properties&amp;diff=3274"/>
		<updated>2012-09-02T17:34:40Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Separate size and flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavAdditionalreferences}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Number&lt;br /&gt;
! Name&lt;br /&gt;
! Climate&lt;br /&gt;
! Town&amp;lt;br /&amp;gt;zones&lt;br /&gt;
! Size&lt;br /&gt;
! Minimum&amp;lt;br /&amp;gt;year&amp;lt;br /&amp;gt;built&lt;br /&gt;
! Last&amp;lt;br /&amp;gt;year&amp;lt;br /&amp;gt;built&lt;br /&gt;
! Population&lt;br /&gt;
! Mail&amp;lt;br /&amp;gt;generation&lt;br /&gt;
! Passenger&amp;lt;br /&amp;gt;acceptance&lt;br /&gt;
! Mail&amp;lt;br /&amp;gt;acceptance&lt;br /&gt;
! Goods&amp;lt;br /&amp;gt;acceptance&lt;br /&gt;
! Remove&amp;lt;br /&amp;gt;ratings&amp;lt;br /&amp;gt;decrease&lt;br /&gt;
! Remove&amp;lt;br /&amp;gt;cost&amp;lt;br /&amp;gt;multiplier&lt;br /&gt;
! Flags&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| tall office block&lt;br /&gt;
| temperate&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1963&lt;br /&gt;
| none&lt;br /&gt;
| 187&lt;br /&gt;
| 70&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 140&lt;br /&gt;
| 150&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| office block&lt;br /&gt;
| temperate&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1957&lt;br /&gt;
| none&lt;br /&gt;
| 85&lt;br /&gt;
| 55&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 130&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| small block of flats&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTSKIRT .. INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1968&lt;br /&gt;
| none&lt;br /&gt;
| 40&lt;br /&gt;
| 20&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 90&lt;br /&gt;
| 100&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| church&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 230&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| large office block&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1975&lt;br /&gt;
| none&lt;br /&gt;
| 220&lt;br /&gt;
| 85&lt;br /&gt;
| 10&lt;br /&gt;
| 4&lt;br /&gt;
| 6&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
| HOUSE_FLAG_ANIMATE&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| large office block&lt;br /&gt;
| snow&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1975&lt;br /&gt;
| none&lt;br /&gt;
| 220&lt;br /&gt;
| 85&lt;br /&gt;
| 10&lt;br /&gt;
| 4&lt;br /&gt;
| 6&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
| HOUSE_FLAG_ANIMATE&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| town houses&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 30&lt;br /&gt;
| 12&lt;br /&gt;
| 4&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| hotel (N part)&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x2&lt;br /&gt;
| 1959&lt;br /&gt;
| none&lt;br /&gt;
| 140&lt;br /&gt;
| 22&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 150&lt;br /&gt;
| 180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| hotel (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1959&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 22&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 150&lt;br /&gt;
| 180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| statue&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1945&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 40&lt;br /&gt;
| 65&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| fountain&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1945&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 40&lt;br /&gt;
| 65&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| park (with a pond)&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 75&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| park (with an alley)&lt;br /&gt;
| temperate&lt;br /&gt;
| INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1935&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 75&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| office block&lt;br /&gt;
| temperate&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1951&lt;br /&gt;
| none&lt;br /&gt;
| 150&lt;br /&gt;
| 65&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 4&lt;br /&gt;
| 110&lt;br /&gt;
| 130&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| shops and offices 1&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 95&lt;br /&gt;
| 48&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 100&lt;br /&gt;
| 110&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| shops and offices 2&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 95&lt;br /&gt;
| 48&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 100&lt;br /&gt;
| 105&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| shops and offices 3&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 95&lt;br /&gt;
| 48&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 100&lt;br /&gt;
| 107&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| modern office building&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1977&lt;br /&gt;
| none&lt;br /&gt;
| 130&lt;br /&gt;
| 50&lt;br /&gt;
| 10&lt;br /&gt;
| 3&lt;br /&gt;
| 6&lt;br /&gt;
| 150&lt;br /&gt;
| 200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| warehouse&lt;br /&gt;
| temperate&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1983&lt;br /&gt;
| none&lt;br /&gt;
| 6&lt;br /&gt;
| 10&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 8&lt;br /&gt;
| 110&lt;br /&gt;
| 145&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| office block (with spiral stairway)&lt;br /&gt;
| temperate&lt;br /&gt;
| CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1985&lt;br /&gt;
| none&lt;br /&gt;
| 110&lt;br /&gt;
| 55&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 6&lt;br /&gt;
| 110&lt;br /&gt;
| 155&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| stadium (N part)&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_2x2&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 65&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| stadium (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| stadium (W part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| stadium (S part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| old houses&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE, OUTSKIRT&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1951&lt;br /&gt;
| 15&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 75&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| cottages&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1952&lt;br /&gt;
| 12&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 75&lt;br /&gt;
| 75&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| houses&lt;br /&gt;
| temperate&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1931&lt;br /&gt;
| none&lt;br /&gt;
| 13&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 75&lt;br /&gt;
| 71&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| flats&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1935&lt;br /&gt;
| none&lt;br /&gt;
| 100&lt;br /&gt;
| 35&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 100&lt;br /&gt;
| 135&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| tall office block&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1963&lt;br /&gt;
| none&lt;br /&gt;
| 170&lt;br /&gt;
| 50&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 3&lt;br /&gt;
| 170&lt;br /&gt;
| 145&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| shops and offices&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1955&lt;br /&gt;
| 100&lt;br /&gt;
| 40&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 135&lt;br /&gt;
| 132&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| shops and offices&lt;br /&gt;
| temperate, subtropical&lt;br /&gt;
| OUTER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1973&lt;br /&gt;
| none&lt;br /&gt;
| 180&lt;br /&gt;
| 64&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 3&lt;br /&gt;
| 180&lt;br /&gt;
| 155&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| theatre&lt;br /&gt;
| temperate&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 35&lt;br /&gt;
| 23&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 230&lt;br /&gt;
| 220&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| stadium (modern style, N part)&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_2x2&lt;br /&gt;
| 1958&lt;br /&gt;
| none&lt;br /&gt;
| 65&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| stadium (modern style, E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1958&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| stadium (modern style, W part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1958&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| stadium (modern style, S part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1958&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 4&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| offices (&#039;vertical tube&#039; style)&lt;br /&gt;
| temperate, sub-arctic, subtropical&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 2000&lt;br /&gt;
| none&lt;br /&gt;
| 140&lt;br /&gt;
| 65&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| 250&lt;br /&gt;
| 170&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| houses&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE, OUTSKIRT&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 15&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 75&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| houses&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE, OUTSKIRT&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 15&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 75&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| cinema&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1945&lt;br /&gt;
| none&lt;br /&gt;
| 35&lt;br /&gt;
| 23&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 230&lt;br /&gt;
| 210&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 40&lt;br /&gt;
| shopping mall (N part)&lt;br /&gt;
| temperate&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_2x2&lt;br /&gt;
| 1983&lt;br /&gt;
| none&lt;br /&gt;
| 180&lt;br /&gt;
| 5&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 41&lt;br /&gt;
| shopping mall (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1983&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| shopping mall (W part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1983&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 43&lt;br /&gt;
| shopping mall (S part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1983&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 5&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 300&lt;br /&gt;
| 250&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 44&lt;br /&gt;
| flats&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 80&lt;br /&gt;
| 20&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| -2&lt;br /&gt;
| 90&lt;br /&gt;
| 100&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 45&lt;br /&gt;
| flats&lt;br /&gt;
| snow&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 80&lt;br /&gt;
| 20&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| -2&lt;br /&gt;
| 90&lt;br /&gt;
| 100&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 46&lt;br /&gt;
| houses&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 16&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 70&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 47&lt;br /&gt;
| houses&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 16&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 70&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| houses&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE ... OUTER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1963&lt;br /&gt;
| 14&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 70&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 49&lt;br /&gt;
| houses&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE ... OUTER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1963&lt;br /&gt;
| 14&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 70&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 50&lt;br /&gt;
| tall office block&lt;br /&gt;
| sub-arctic, subtropical&lt;br /&gt;
| INNER_OUTSKIRT, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1966&lt;br /&gt;
| none&lt;br /&gt;
| 135&lt;br /&gt;
| 60&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 120&lt;br /&gt;
| 150&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 51&lt;br /&gt;
| tall office block&lt;br /&gt;
| snow&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1966&lt;br /&gt;
| none&lt;br /&gt;
| 135&lt;br /&gt;
| 60&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 120&lt;br /&gt;
| 150&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| tall office block&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1970&lt;br /&gt;
| none&lt;br /&gt;
| 170&lt;br /&gt;
| 70&lt;br /&gt;
| 9&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 130&lt;br /&gt;
| 170&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 53&lt;br /&gt;
| tall office block&lt;br /&gt;
| snow&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1970&lt;br /&gt;
| none&lt;br /&gt;
| 170&lt;br /&gt;
| 70&lt;br /&gt;
| 9&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 130&lt;br /&gt;
| 170&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| tall office block&lt;br /&gt;
| sub-arctic, subtropical&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1974&lt;br /&gt;
| none&lt;br /&gt;
| 210&lt;br /&gt;
| 80&lt;br /&gt;
| 10&lt;br /&gt;
| 3&lt;br /&gt;
| 5&lt;br /&gt;
| 140&lt;br /&gt;
| 200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 55&lt;br /&gt;
| tall office block&lt;br /&gt;
| snow&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1974&lt;br /&gt;
| none&lt;br /&gt;
| 210&lt;br /&gt;
| 80&lt;br /&gt;
| 10&lt;br /&gt;
| 3&lt;br /&gt;
| 5&lt;br /&gt;
| 140&lt;br /&gt;
| 200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| houses&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 10&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 60&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| houses&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 10&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 60&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| shops and offices&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 25&lt;br /&gt;
| 20&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 80&lt;br /&gt;
| 100&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 59&lt;br /&gt;
| shops and offices&lt;br /&gt;
| snow&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 25&lt;br /&gt;
| 20&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 80&lt;br /&gt;
| 100&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| church&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 230&lt;br /&gt;
| 85&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| church&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 230&lt;br /&gt;
| 85&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| houses&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| EDGE ... OUTER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 17&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 63&lt;br /&gt;
| houses&lt;br /&gt;
| snow&lt;br /&gt;
| EDGE ... OUTER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 17&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| shops and offices&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 90&lt;br /&gt;
| 45&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 110&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 65&lt;br /&gt;
| shops and offices&lt;br /&gt;
| snow&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| 1960&lt;br /&gt;
| 90&lt;br /&gt;
| 45&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 110&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 66&lt;br /&gt;
| hotel (N part)&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x2&lt;br /&gt;
| 1972&lt;br /&gt;
| none&lt;br /&gt;
| 140&lt;br /&gt;
| 25&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| -3&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 67&lt;br /&gt;
| hotel (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1972&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 25&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 68&lt;br /&gt;
| hotel (N part)&lt;br /&gt;
| snow&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x2&lt;br /&gt;
| 1972&lt;br /&gt;
| none&lt;br /&gt;
| 140&lt;br /&gt;
| 25&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| -3&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 69&lt;br /&gt;
| hotel (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1972&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 25&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 160&lt;br /&gt;
| 160&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 70&lt;br /&gt;
| shops and offices&lt;br /&gt;
| sub-arctic, subtropical&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1963&lt;br /&gt;
| none&lt;br /&gt;
| 105&lt;br /&gt;
| 50&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 105&lt;br /&gt;
| 130&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 71&lt;br /&gt;
| shops and offices&lt;br /&gt;
| snow&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1963&lt;br /&gt;
| none&lt;br /&gt;
| 105&lt;br /&gt;
| 50&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 105&lt;br /&gt;
| 130&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 72&lt;br /&gt;
| tall office block&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1978&lt;br /&gt;
| none&lt;br /&gt;
| 190&lt;br /&gt;
| 75&lt;br /&gt;
| 9&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 135&lt;br /&gt;
| 190&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 73&lt;br /&gt;
| tall office block&lt;br /&gt;
| snow&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1978&lt;br /&gt;
| none&lt;br /&gt;
| 190&lt;br /&gt;
| 75&lt;br /&gt;
| 9&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 135&lt;br /&gt;
| 190&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| tall office block (N part)&lt;br /&gt;
| sub-arctic&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_2x1&lt;br /&gt;
| 1967&lt;br /&gt;
| none&lt;br /&gt;
| 250&lt;br /&gt;
| 60&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 200&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 75&lt;br /&gt;
| tall office block (W part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1967&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 60&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 200&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| tall office block (N part)&lt;br /&gt;
| snow&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_2x1&lt;br /&gt;
| 1967&lt;br /&gt;
| none&lt;br /&gt;
| 250&lt;br /&gt;
| 60&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 200&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 77&lt;br /&gt;
| tall office block (W part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1967&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 60&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 200&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 78&lt;br /&gt;
| houses (with a tree in a corner)&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 16&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 79&lt;br /&gt;
| houses&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 16&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 80&lt;br /&gt;
| houses&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 16&lt;br /&gt;
| 5&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 81&lt;br /&gt;
| houses (suburb-type)&lt;br /&gt;
| subtropical&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 7&lt;br /&gt;
| 4&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -1&lt;br /&gt;
| 30&lt;br /&gt;
| 30&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 82&lt;br /&gt;
| flats&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 45&lt;br /&gt;
| 15&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 95&lt;br /&gt;
| 130&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 83&lt;br /&gt;
| church&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTSKIRT ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 200&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 84&lt;br /&gt;
| houses (with two trees in front)&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTSKIRT ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 18&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| -2&lt;br /&gt;
| 80&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 85&lt;br /&gt;
| flats&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1973&lt;br /&gt;
| none&lt;br /&gt;
| 90&lt;br /&gt;
| 24&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 95&lt;br /&gt;
| 110&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 86&lt;br /&gt;
| flats&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1962&lt;br /&gt;
| none&lt;br /&gt;
| 120&lt;br /&gt;
| 25&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 95&lt;br /&gt;
| 120&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 87&lt;br /&gt;
| tall office block (N part)&lt;br /&gt;
| subtropical&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_2x1&lt;br /&gt;
| 1984&lt;br /&gt;
| none&lt;br /&gt;
| 250&lt;br /&gt;
| 80&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 140&lt;br /&gt;
| 190&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 88&lt;br /&gt;
| tall office block (W part)&lt;br /&gt;
| subtropical&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1984&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 80&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 140&lt;br /&gt;
| 190&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 89&lt;br /&gt;
| flats&lt;br /&gt;
| subtropical&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 80&lt;br /&gt;
| 23&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 95&lt;br /&gt;
| 110&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 90&lt;br /&gt;
| tall office block&lt;br /&gt;
| subtropical&lt;br /&gt;
| INNER_SUBURB, CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1993&lt;br /&gt;
| none&lt;br /&gt;
| 180&lt;br /&gt;
| 90&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
| 150&lt;br /&gt;
| 180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 91&lt;br /&gt;
| church&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 200&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 92&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 18&lt;br /&gt;
| 5&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 90&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 93&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE, OUTSKIRT&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 50&lt;br /&gt;
| 70&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 94&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 15&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 75&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 95&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 17&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 75&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 96&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 19&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 75&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 97&lt;br /&gt;
| toyland houses&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... INNER_SUBURB&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 21&lt;br /&gt;
| 6&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 75&lt;br /&gt;
| 80&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 98&lt;br /&gt;
| tall office block&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 75&lt;br /&gt;
| 20&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| 2&lt;br /&gt;
| 130&lt;br /&gt;
| 160&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 99&lt;br /&gt;
| shoe house (N part)&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x2&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 35&lt;br /&gt;
| 9&lt;br /&gt;
| 4&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 80&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 100&lt;br /&gt;
| shoe house (E part)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| N/A&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| 4&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 80&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 101&lt;br /&gt;
| tall office block&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 85&lt;br /&gt;
| 18&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| 2&lt;br /&gt;
| 130&lt;br /&gt;
| 150&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 102&lt;br /&gt;
| igloo&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 11&lt;br /&gt;
| 3&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 45&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 103&lt;br /&gt;
| tepees&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 10&lt;br /&gt;
| 3&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 45&lt;br /&gt;
| 60&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 104&lt;br /&gt;
| shops and offices&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 67&lt;br /&gt;
| 22&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| -4&lt;br /&gt;
| 130&lt;br /&gt;
| 140&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 105&lt;br /&gt;
| shops and offices&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 86&lt;br /&gt;
| 23&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| -4&lt;br /&gt;
| 130&lt;br /&gt;
| 145&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 106&lt;br /&gt;
| tall office block&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 95&lt;br /&gt;
| 28&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| 2&lt;br /&gt;
| 130&lt;br /&gt;
| 165&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 107&lt;br /&gt;
| statue&lt;br /&gt;
| toyland&lt;br /&gt;
| OUTER_SUBURB ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 30&lt;br /&gt;
| 10&lt;br /&gt;
| 4&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 70&lt;br /&gt;
| 90&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 108&lt;br /&gt;
| teapot-house&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 25&lt;br /&gt;
| 8&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
| 65&lt;br /&gt;
| 75&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 109&lt;br /&gt;
| piggy-bank&lt;br /&gt;
| toyland&lt;br /&gt;
| EDGE ... CENTRE&lt;br /&gt;
| HOUSE_SIZE_1x1&lt;br /&gt;
| 1930&lt;br /&gt;
| none&lt;br /&gt;
| 18&lt;br /&gt;
| 7&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| -4&lt;br /&gt;
| 95&lt;br /&gt;
| 85&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3273</id>
		<title>VariationalAction2/Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3273"/>
		<updated>2012-09-02T10:20:52Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Other building counts (60, 61) */ Property-&amp;gt;variable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!Version*!!Description&lt;br /&gt;
|-&lt;br /&gt;
|40||B||{{ottdp|0.6|2.5}}||Construction stage and pseudo-random values&lt;br /&gt;
|-&lt;br /&gt;
|41||B||{{ottdp|0.6|2.5}}||Age of the building in years (or, strictly speaking, the difference between the current year and the year the building was built). Returns 255 for buildings older than 255 years.&lt;br /&gt;
|-&lt;br /&gt;
|42||B||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Town zone where the building is situated.&lt;br /&gt;
|-&lt;br /&gt;
|43||B||{{ottdp|0.6|2.5}}||Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Building counts&lt;br /&gt;
|-&lt;br /&gt;
|45||B||{{ottdp|0.6|2.5|ttdprev=alpha 38}}||Town expansion bits&lt;br /&gt;
|-&lt;br /&gt;
|46||B||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Current animation frame&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.7|2.6|ottdrev=r14294|ttdprev=r2020}}||XY Coordinate of the building&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=alpha 56}}||Other building counts&lt;br /&gt;
|-&lt;br /&gt;
|61||D||{{ottdp|0.6|2.5|ttdprev=alpha 56}}||Other building counts&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Land info for nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|63||B||{{ottdp|0.7|2.6|ttdprev=r1665}}||Current animation frame of nearby house tiles&lt;br /&gt;
|-&lt;br /&gt;
|64||B||{{ottdp|1.2|2.6|ottdrev=r23070|ttdprev=r1672}}||Cargo acceptance history of nearby stations&lt;br /&gt;
|-&lt;br /&gt;
|65||B||{{ottdp|0.7|2.6|ottdrev=r13603|ttdprev=r2242}}||Distance of nearest house matching a given criterion&lt;br /&gt;
|-&lt;br /&gt;
|66||D||{{ottdp|1.0|2.6|ttdprev=r2246}}||Class and ID of nearby house tile&lt;br /&gt;
|-&lt;br /&gt;
|67||D||{{ottdp|1.0|2.6|ttdprev=r2246}}||GRFID of nearby house tile&lt;br /&gt;
|-&lt;br /&gt;
|80+x||||||None defined, and none ever will because town buildings don&#039;t have an internal structure. Trying to access these variables crashes TTD.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Specified version is earliest known to support the variable in its current form. Some variables may have been available earlier.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Construction stage and pseudo-random values (40) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bits!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0..1||Construction state: 0..2: various states of construction, 3: construction finished&lt;br /&gt;
|-&lt;br /&gt;
|2..3||A pseudo-random value. It isn&#039;t actually random, but is derived from the position of the building. Old buildings use this value to randomize their colors. TTDPatch has a better way to randomize things, but you can still use that value to mimic unpatched TTD behaviour. Note that adjacent tiles aren&#039;t guaranteed to have the same pseudo-random bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Town zone (42) ===&lt;br /&gt;
&lt;br /&gt;
Town zone where the building is situated. The value is between 0 and 4, where 0 is the outermost zone of the town. Smaller towns have fewer zones. Roads are plain in zone 0 and 1, paved in zone 2, have trees in zone 3 and streetlights in zone 4&lt;br /&gt;
&lt;br /&gt;
=== Building counts (44) ===&lt;br /&gt;
&lt;br /&gt;
Returns dword LLllCCcc, where cc means how many buildings of the current type can be found in the current town, while CC is the same for the whole map. ll and LL are similar to cc and CC, but contain the number of tiles that have the same class as the current one. For tiles that have no class, ll and LL are always zero. Overridden old types are considered to be the new type they were overridden with. During [[Callbacks#House construction check (17)|callback 17]], the current building isn&#039;t on the map yet, and therefore isn&#039;t counted. In other cases, the building count is at least one, since the current building is counted as well.&lt;br /&gt;
&lt;br /&gt;
=== Town expansion bits (45) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Set if TTD is currently creating a random town, clear otherwise. PLEASE NOTE: while TTD is generating a random town, town variables 82 (town population) and B6 (number of buildings) are incorrect. The population counter contains the population of buildings generated _yet_, which means the final value may be larger than you get. The building count variable, on the other hand, is surely higher than the final value will be. If you want to check these variables during [[Callbacks#House construction check (17)|callback 17]], you may need to check variable 45 as well and make adjustments if this bit is set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other bits are currently reserved for future use.&lt;br /&gt;
&lt;br /&gt;
=== Current animation frame (46) ===&lt;br /&gt;
&lt;br /&gt;
The current animation frame being displayed. If you don&#039;t use animation callbacks, it&#039;s between zero and the value set in property 1A. Animation callbacks can set this to anything between 0 and 127.&lt;br /&gt;
&lt;br /&gt;
Enabling animation on a house tile by setting properties 9, 1A and probably 1B ensures that variable 46 will indeed change with time, and the building is redrawn every time variable 46 changes. This means that you can use a VarAction2 to choose the current frame according to variable 46. Please note that this kind of animation needs more CPU time and more sprites, so you should prefer palette animation if possible.&lt;br /&gt;
&lt;br /&gt;
=== XY Coordinate of the building (47) ===&lt;br /&gt;
&lt;br /&gt;
The coordinate of the tile this part of the building is located. &amp;amp;nbsp;If the building is not yet constructed, like during [[Callbacks#House construction check (17)|callback 17]], the returned value will be the proposed location. &amp;amp;nbsp;The format of the var is YYYYXXXX.&lt;br /&gt;
&lt;br /&gt;
=== Other building counts (60, 61) ===&lt;br /&gt;
&lt;br /&gt;
For variable 60, the parameter is an old house type number. For variable 61, it is a new house type number defined in the current GRF file.&lt;br /&gt;
&lt;br /&gt;
These variables work like variable 44, but they count the given house type instead of the current one.&lt;br /&gt;
&lt;br /&gt;
Please note that, unlike random graphics, changes of deterministic building graphics don&#039;t automatically redraw the building (except when either the construction state or variable 46 changes), resulting in temporary graphics glitches when a visible building changes its graphics. These glitches can be fixed by scrolling the building out of view, then back again.&lt;br /&gt;
&lt;br /&gt;
=== Land info for nearby tiles (62) ===&lt;br /&gt;
&lt;br /&gt;
This variable works exactly like [[VarAction2IndustryTiles#Land info of nearby tiles 60|var. 60 for industry tiles]], except that bit 0 of the &#039;&#039;&#039;bb&#039;&#039;&#039; part is undefined.&lt;br /&gt;
&lt;br /&gt;
=== Current animation frame of nearby house tiles (63) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. Although you can query a 16x16 area with these parameters, it&#039;s currently useless to use offsets other than -1, 0 and +1; if you query a tile that doesn&#039;t belong to the same building as the current tile, the result is meaningless. It may even be junk if the queried tile isn&#039;t a house tile at all.&lt;br /&gt;
&lt;br /&gt;
=== Cargo acceptance history of nearby stations (64) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is a cargo identifier. {{grfFrom|7}} If your GRF is version 7 or later and has a cargo translation table, this is an index to that table; otherwise, it&#039;s a cargo slot number. Additionally, GRF register 100h should contain an offset relative to the current tile (use 0 for the current tile). The lowest byte contains the signed X offset and the next higher byte the signed Y offset.&lt;br /&gt;
&lt;br /&gt;
The returned value looks like this:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit number!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||This cargo was accepted in a nearby station some time in the past&lt;br /&gt;
|-&lt;br /&gt;
|1||This cargo was accepted in a nearby station last month&lt;br /&gt;
|-&lt;br /&gt;
|2||This cargo was accepted in a nearby station this month&lt;br /&gt;
|-&lt;br /&gt;
|3||This cargo was accepted in a nearby station since the last periodic processing (which happens every 250 ticks)&lt;br /&gt;
|-&lt;br /&gt;
|4||This cargo is one of the types that triggered [[Callbacks#Watched_cargo_accepted_.28148.29|callback 148]] (only during callback 148)&lt;br /&gt;
|-&lt;br /&gt;
|other bits||undefined; reserved for future use&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A station is considered nearby if the selected tile is inside its acceptance area. That&#039;s why you can give an offset - other tiles of your multi-tile building may have different stations &amp;quot;nearby&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} The information required for this variable is stored in the station2 structure, and therefore works only if the station2 structure is present. The station2 structure is present if any of the following is true:&lt;br /&gt;
* Generalfixes is on, and miscmods.noextendstationrange is off&lt;br /&gt;
* Any of fifoloading, newcargos or irregularstations is on&lt;br /&gt;
&lt;br /&gt;
If the station2 structure isn&#039;t present, the returned value is always zero.&lt;br /&gt;
&lt;br /&gt;
=== Distance of nearest house matching a given criterion (65) ===&lt;br /&gt;
&lt;br /&gt;
This will perform a circular search around the current tile, trying to find another house tile that will match the same type, class or GRFID. (Note: other tiles of the originating house will not match.) &amp;amp;nbsp;Search result will be the [http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] between both tiles or 0, if no house tile matching the given criteria has been found.&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
Bits 0..5 indicate the radius of the search going to be performed (given in Manhattan metric). Maximum search radius is 63 while the minimum is 1. A radius of 0 is considered reserved - do not use.&lt;br /&gt;
&lt;br /&gt;
Bits 6..7 indicate the type of search to be carried out:&lt;br /&gt;
&lt;br /&gt;
0 : Search by house type as defined in the grf file&lt;br /&gt;
&lt;br /&gt;
1 : Search by building class&lt;br /&gt;
&lt;br /&gt;
2 : Search by GRFID&lt;br /&gt;
&lt;br /&gt;
Just like other search variables, be aware that this is a CPU intensive one&lt;br /&gt;
&lt;br /&gt;
=== Class and ID of nearby house tile (66) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. The returned value is structured like this:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!High word!!Information about house class&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;FFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;0000h&#039;&#039;&#039; if the selected house doesn&#039;t have a class specified (including old houses, which cannot have a class)&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;01XXh&#039;&#039;&#039; if the selected house has been defined in the current GRF with class XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;02XXh&#039;&#039;&#039; if the selected house has been defined in a different GRF with class XX&lt;br /&gt;
|-&lt;br /&gt;
!Low word!!Information about house ID&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;FFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;00XXh&#039;&#039;&#039; if the selected house is old house type XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;01XXh&#039;&#039;&#039; if the selected house has been defined in the current GRF with ID XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;02XXh&#039;&#039;&#039; if the selected house has been defined in a different GRF with ID XX&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case the selected house comes from another GRF, you need to use variable 67 (see below) to find out the corresponding GRFID and identify the exact type of the house. Please note that variable 67 is cheaper to calculate than this one, so if you are looking for a specific GRFID/houseID combination, you should try matching the GRFID first, and get variable 66 only if the GRFID matches.&lt;br /&gt;
&lt;br /&gt;
=== GRFID of nearby house tile (67) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. The returned value is one of the following:&lt;br /&gt;
* &#039;&#039;&#039;FFFFFFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
* &#039;&#039;&#039;00000000h&#039;&#039;&#039; if the selected house is an old house type&lt;br /&gt;
* otherwise, the GRFID of the GRF which defined the type of the selected house&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.3&amp;diff=3271</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=3271"/>
		<updated>2012-08-14T19:16:33Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about removal of single_unit_text and multiple_units_text&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;
== Changed variables ==&lt;br /&gt;
&lt;br /&gt;
=== snowline_height ===&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;
=== nearby_tile_height ===&lt;br /&gt;
The &amp;quot;nearby_tile_height&amp;quot; variable returns the height in tiles instead of pixels (=tiles*8).&lt;br /&gt;
&lt;br /&gt;
=== date_of_last_service ===&lt;br /&gt;
This variable is no longer limited to the range of 1920 ... 2050. It returns now the year 0-based date.&lt;br /&gt;
&lt;br /&gt;
== Base costs ==&lt;br /&gt;
Base costs are treated in NewGRF v8 (NML 0.3.x) differently than in NewGRF v7 (NML 0.2.x and earlier). Base costs do &#039;&#039;&#039;NOT&#039;&#039;&#039; influence eachother anymore. You&#039;ll need to set all base costs directly and cannot rely anymore that any are set indirectly. See the [[NML:Base_cost_table| base costs table]] which will be influenced.&lt;br /&gt;
&lt;br /&gt;
== New properties ==&lt;br /&gt;
=== Railtypes: alternative_railtype_list ===&lt;br /&gt;
This property allows to define a list of rail types which this rail type will also define - unless the rail type is defined separately.&lt;br /&gt;
&lt;br /&gt;
=== Trains / Road vehicles: Length ===&lt;br /&gt;
Trains and road vehicles now have a property &#039;length&#039;, this replaces the old property &#039;shorten_vehicle&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Cargos: Capacity multiplier ===&lt;br /&gt;
This new property allows answering the question: How much units of cargo X are equivalent to 1 ton of coal, resp. 1000 litres of water?&lt;br /&gt;
&lt;br /&gt;
=== Houses: watched_cargo_types ===&lt;br /&gt;
With the implementation of this property, the watched_cargo_accepted callback becomes usable.&lt;br /&gt;
&lt;br /&gt;
== Vehicle refitting ==&lt;br /&gt;
The &#039;xor&#039;-property &#039;refittable_cargo_types&#039; is no longer available; use &#039;cargo_allow_refit&#039; resp. &#039;cargo_disallow_refit&#039; instead. For trains, road vehicles and ships you can now specify a default cargo type.&lt;br /&gt;
&lt;br /&gt;
== Alternative sprites ==&lt;br /&gt;
The way OpenTTD supports 32bpp has been changed and enhanced. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;alternative_sprites&amp;lt;/code&amp;gt; now takes more and different zoom level arguments and a type argument has been added as 8bpp sprites are now also permissible. See the description of the [[Alternative_Sprites| &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;alternative_sprites&amp;lt;/code&amp;gt;]] for details.&lt;br /&gt;
&lt;br /&gt;
== Sounds ==&lt;br /&gt;
It is now possible to specify a relative volume for sound effects. Additionally, the 64kB size limit has been removed.&lt;br /&gt;
&lt;br /&gt;
== Cargo strings ==&lt;br /&gt;
The cargo properties &#039;single_unit_text&#039; and &#039;multiple_units_text&#039; have been removed, as they didn&#039;t work properly in OpenTTD anyways. Use &#039;units_of_cargo&#039; and &#039;items_of_cargo&#039; instead.&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Cargos&amp;diff=3270</id>
		<title>NML:Cargos</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Cargos&amp;diff=3270"/>
		<updated>2012-08-14T19:14:03Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Cargo properties */ Improve documentation of string properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==Cargo IDs==&lt;br /&gt;
For cargos, the item ID corresponds to the cargo type slot of the cargo. TTD default cargos occupy slots 0-11, so if you want to define a new cargo be sure to set this ID to 12 or higher. It is recommended to set the &#039;number&#039;-property to the same value as the item ID.&lt;br /&gt;
&lt;br /&gt;
==Cargo properties==&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;
| number&lt;br /&gt;
| 0..31&lt;br /&gt;
| Number of the cargo for bitmasks. This mostly affects old NewGRFs that don&#039;t have a cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| type_name&lt;br /&gt;
| string&lt;br /&gt;
| String to use as cargo type name. Example: &amp;quot;Passengers&amp;quot;. The list of [[NML:Default_TTD_strings|default TTD strings]] contains the strings used by the default cargos (TTD_STR_CARGO_PLURAL_XXX), which may be re-used.&lt;br /&gt;
|-&lt;br /&gt;
| unit_name&lt;br /&gt;
| string&lt;br /&gt;
| String to use for the name of one unit from the cargo type. Currently used for subsidies only (First Passenger service to..). Example string: &amp;quot;Passenger&amp;quot;. The list of [[NML:Default_TTD_strings|default TTD strings]] contains the strings used by the default cargos (TTD_STR_CARGO_SINGULAR_XXX), which may be re-used.&lt;br /&gt;
|-&lt;br /&gt;
| units_of_cargo&lt;br /&gt;
| string&lt;br /&gt;
| String used to show the &amp;quot;short cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 tonnes&amp;quot; or &amp;quot;20.000 litres&amp;quot;. Example: &amp;quot;{COMMA} item{P &amp;quot;&amp;quot; s}&amp;quot;. The list of [[NML:Default_TTD_strings|default TTD strings]] contains the strings used by the default cargos (TTD_STR_PASSENGERS and further), which may be re-used.&lt;br /&gt;
|-&lt;br /&gt;
| items_of_cargo&lt;br /&gt;
| string&lt;br /&gt;
| String used to show the &amp;quot;long cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 tonnes of coal&amp;quot; or &amp;quot;20.000 litres of water&amp;quot;. Example: &amp;quot;{COMMA} item{P &amp;quot;&amp;quot; s} of livestock&amp;quot;. The list of [[NML:Default_TTD_strings|default TTD strings]] contains the strings used by the default cargos (TTD_STR_QUANTITY_XXX), which may be re-used.&lt;br /&gt;
|-&lt;br /&gt;
| type_abbreviation&lt;br /&gt;
| string&lt;br /&gt;
| String used for the two-letter cargo type abbreviation. Must start with a {TINYFONT} string-code. Example: &amp;quot;{TINYFONT}XX&amp;quot;. Make sure to avoid multiple cargos having the same abbreviation. The list of [[NML:Default_TTD_strings|default TTD strings]] contains the strings used by the default cargos (TTD_STR_ABBREV_XXX), which may be re-used.&lt;br /&gt;
|-&lt;br /&gt;
| sprite&lt;br /&gt;
| sprite&lt;br /&gt;
| TTD sprite number for the icon of the cargo. Alternatively, set to NEW_CARGO_SPRITE and use a graphics block to define a custom sprite.&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| float 0..255&lt;br /&gt;
| Weight of one unit of the cargo (in tons)&lt;br /&gt;
|-&lt;br /&gt;
| penalty_lowerbound&lt;br /&gt;
| 0..255&lt;br /&gt;
| Delivery time until penalty is applied&lt;br /&gt;
|-&lt;br /&gt;
| single_penalty_length&lt;br /&gt;
| 0..255&lt;br /&gt;
| Length of the interval where a single penalty is applied&lt;br /&gt;
|-&lt;br /&gt;
| price_factor&lt;br /&gt;
| float&lt;br /&gt;
| Payment for delivering 10 units of cargo across a distance of 20 squares (in British Pounds).&lt;br /&gt;
|-&lt;br /&gt;
| station_list_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour for the station list window (index from the [[NML:Graphic files|DOS palette]])&lt;br /&gt;
|-&lt;br /&gt;
| cargo_payment_list_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour for the cargo payment list window (index from the [[NML:Graphic files|DOS palette]])&lt;br /&gt;
|-&lt;br /&gt;
| is_freight&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Freight status (for the freighttrains switch); 0=not freight, 1=is freight&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Cargo classes|cargo classes]])&lt;br /&gt;
| Cargo classes&lt;br /&gt;
|-&lt;br /&gt;
| cargo_label&lt;br /&gt;
| 4 letters&lt;br /&gt;
| Cargo label, as used in the cargo table&lt;br /&gt;
|-&lt;br /&gt;
| town_growth_effect&lt;br /&gt;
| TOWNGROWTH_XXX&lt;br /&gt;
|&lt;br /&gt;
Effect for town growth, see [[#Cargo effects on town growth|Cargo effects on town growth]]&lt;br /&gt;
|-&lt;br /&gt;
| town_growth_multiplier&lt;br /&gt;
| float 0..255&lt;br /&gt;
| Multiplier for town growth. To be used in conjuction with town_growth_effect, when that is not TOWNGROWTH_NONE. For example, a value of 4 makes your cargo have the same effect on town growth as 4 units of food/goods/etc.&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;
| capacity_multiplier&lt;br /&gt;
| float 0 .. 255&lt;br /&gt;
| {{ottd|1.2|r22860}} This defines the capacity of vehicles carrying this cargo type, if the vehicle sets no specific capacity to this specific cargo type. Set this property to the amount of cargo a vehicle shall carry, which can carry 1 ton of coal or 1000 thousand litres of water (whatever comparison is more suitable for your cargotype). Depending on whether your cargo type is light or heavy you should set this property either comparing the weight or the volume. Default values are 4 for passengers, 2 for mail, goods and sweets and 1 for all other cargos.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cargo payment is computed from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;price_factor&amp;lt;/code&amp;gt;, amount of cargo transported, distance, and a time delivery factor. Unit of the delivery time is 185 ticks, roughly 2.5 days. The factor is constant (with value 255) if delivery time is less than &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;penalty_lowerbound&amp;lt;/code&amp;gt;. It goes down with rate 1 between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;penalty_lowerbound + single_penalty_length&amp;lt;/code&amp;gt;, and goes down with rate 2 if the delivery time is even longer. Time delivery factor is never less than 31.&lt;br /&gt;
&lt;br /&gt;
===Cargo classes===&lt;br /&gt;
&lt;br /&gt;
Available cargo classes are listed in the following table. Cargos may be in more than one class. Cargo classes are always used as a bitmask, use the built-in function &amp;lt;code&amp;gt;bitmask()&amp;lt;/code&amp;gt;. For example, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_EXPRESS, CC_REFRIGERATED)&amp;lt;/code&amp;gt; is used for food.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! type of cargo&lt;br /&gt;
|-&lt;br /&gt;
| CC_PASSENGERS&lt;br /&gt;
| passengers, also tourists (ECS)&lt;br /&gt;
|-&lt;br /&gt;
| CC_MAIL&lt;br /&gt;
| mail&lt;br /&gt;
|-&lt;br /&gt;
| CC_EXPRESS&lt;br /&gt;
| express goods, also tourists (ECS)&lt;br /&gt;
|-&lt;br /&gt;
| CC_ARMOURED&lt;br /&gt;
| valuables, diamonds, gold and alike&lt;br /&gt;
|-&lt;br /&gt;
| CC_BULK&lt;br /&gt;
| coal, ore, grain,...&lt;br /&gt;
|-&lt;br /&gt;
| CC_PIECE_GOODS&lt;br /&gt;
| containers, crates, livestock&lt;br /&gt;
|-&lt;br /&gt;
| CC_LIQUID&lt;br /&gt;
| oil, milk, water, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_REFRIGERATED&lt;br /&gt;
| food, milk, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_HAZARDOUS&lt;br /&gt;
| chemicals?, uranium, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_COVERED&lt;br /&gt;
| grain, cement, fruit, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_OVERSIZED&lt;br /&gt;
| vehicles, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_POWDERIZED&lt;br /&gt;
| cement, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_NON_POURABLE&amp;lt;br&amp;gt;CC_NEO_BULK&lt;br /&gt;
| sugar cane, wool or straw bales, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_SPECIAL&lt;br /&gt;
| Special cargo, used for refit tricks. (e.g. regearing in NARS)&lt;br /&gt;
|-&lt;br /&gt;
| NO_CARGO_CLASS&lt;br /&gt;
| Special value that you can used to instead of 0.&lt;br /&gt;
|-&lt;br /&gt;
| ALL_NORMAL_CARGO_CLASSES&lt;br /&gt;
| Bitmask of all cargo classes except CC_SPECIAL. This is the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_PASSENGERS, CC_MAIL, ..., CC_OVERSIZED)&amp;lt;/code&amp;gt;. Note: This is already a bitmask, don&#039;t use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(..)&amp;lt;/code&amp;gt; function with this.&lt;br /&gt;
|-&lt;br /&gt;
| ALL_CARGO_CLASSES&lt;br /&gt;
| Bitmask of all cargo classes. Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ALL_NORMAL_CARGO_CLASSES | bitmask(CC_SPECIAL)&amp;lt;/code&amp;gt; Note: This is already a bitmask, don&#039;t use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(..)&amp;lt;/code&amp;gt; function with this.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cargo effects on town growth===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! effect&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_PASSENGERS&lt;br /&gt;
| Affect towns as passengers do&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_MAIL&lt;br /&gt;
| Affect towns as mail does&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_GOODS&lt;br /&gt;
| Affect towns as goods/candy does&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_WATER&lt;br /&gt;
| Affect towns as water does (second required cargo for towngrowth in the desert)&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_FOOD&lt;br /&gt;
| Affect towns as food/fizzy drinks do (first required cargo for towngrowth in desert/above snowline)&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_NONE&lt;br /&gt;
| Don&#039;t affect town growth (default)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Cargo variables==&lt;br /&gt;
&lt;br /&gt;
Cargos have no variables (yet).&lt;br /&gt;
&lt;br /&gt;
==Cargo 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 set (with 1 sprite)&lt;br /&gt;
| Graphics for the cargo icon (only if property &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite&amp;lt;/code&amp;gt; is set to NEW_CARGO_SPRITE)&lt;br /&gt;
|-&lt;br /&gt;
| station_rating&lt;br /&gt;
| -16384 .. 16383&lt;br /&gt;
| See detailed explanation below&lt;br /&gt;
|-&lt;br /&gt;
| profit&lt;br /&gt;
| -12748 .. 12748&lt;br /&gt;
| Called whenever cargo is delivered. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0xttaadddd&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tt&amp;lt;/code&amp;gt; being the time spent en-route (1 unit = 2.5 days), &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;aa&amp;lt;/code&amp;gt; the amount of cargo delivered and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;dddd&amp;lt;/code&amp;gt; the manhattan distance it was transported. The returned value is multiplied by the amount and the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;price_factor&amp;lt;/code&amp;gt; and then divided by 256 to determine the income the player receives. Returning negative values is possible, it makes players pay for the delivery.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Station rating callback===&lt;br /&gt;
&lt;br /&gt;
The station rating callback is quite complicated and deserves some detailed explanation. The default station rating calculation works as follows:&lt;br /&gt;
&lt;br /&gt;
Internally, station rating is byte with values 0 .. 255, representing respectively 0% and 100%. Every 2.5 days, the transportation &#039;performance&#039; is calculated using some factors outlined below. The station rating is then set to this performance value, with the caveat that the rating change cannot exceed 2 points. Therefore, rating changes are always slow, this callback cannot change this. The initial rating is 175 points (69%). The following factors are parts of the performance, their effects are summed.&lt;br /&gt;
&lt;br /&gt;
====Time since the cargo was last picked up====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Time units (days)&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;gt;21 (&amp;amp;gt;52.5 days)&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| 13 .. 21 (32.5 days .. 52.5 days)&lt;br /&gt;
| 25 (10%)&lt;br /&gt;
|-&lt;br /&gt;
| 7 .. 12 (17.5 days .. 32.5 days)&lt;br /&gt;
| 50 (20%)&lt;br /&gt;
|-&lt;br /&gt;
| 4 .. 6 (10 days .. 17.5 days)&lt;br /&gt;
| 95 (37%)&lt;br /&gt;
|-&lt;br /&gt;
| 0..3 (0 days..10 days)&lt;br /&gt;
| 130 (51%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The time unit used equals 185 engine ticks, or 2.5 TTD days. For ships, the time units are divided by 4 before calculating this component, so ships have four times more time before the ratings start dropping.&lt;br /&gt;
&lt;br /&gt;
====Amount of cargo waiting====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Amount of cargo&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;gt;1500&lt;br /&gt;
| -90 (-35%)&lt;br /&gt;
|-&lt;br /&gt;
| 1001..1500&lt;br /&gt;
| -35 (-14%)&lt;br /&gt;
|-&lt;br /&gt;
| 601..1000&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| 301..600&lt;br /&gt;
| 10 (4%)&lt;br /&gt;
|-&lt;br /&gt;
| 101..300&lt;br /&gt;
| 30 (12%)&lt;br /&gt;
|-&lt;br /&gt;
| 0..100&lt;br /&gt;
| 40 (16%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Max. speed of the last vehicle picking up the cargo====&lt;br /&gt;
&lt;br /&gt;
This calculation is somewhat complicated. The maximum speed of the vehicle is expressed in &amp;quot;speed units&amp;quot;. For trains and road vehicles, the speed unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead. If the vehicle is slower than 85 units, no points are awarded; otherwise, you get (speed_units-85)/4 points. Therefore, the maximum you can get is 42 points, or 16%.&lt;br /&gt;
&lt;br /&gt;
====Age of the last carrier picking up the cargo====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Age of vehicle (years)&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 10 (4%)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 20 (8%)&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 33 (13%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In TTDPatch this changes when the &#039;newagerating&#039; switch is enabled&lt;br /&gt;
&lt;br /&gt;
====Bonus for AI companies (TTDPatch only)====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! AI intelligence setting&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| Low&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| Medium&lt;br /&gt;
| 31 (12%)&lt;br /&gt;
|-&lt;br /&gt;
| High&lt;br /&gt;
| 63 (25%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Bonus for statue in nearest town====&lt;br /&gt;
&lt;br /&gt;
If your company has erected a statue in the nearest town, you get 26 points (10%) bonus to all cargo ratings.&lt;br /&gt;
&lt;br /&gt;
====Callback parameters====&lt;br /&gt;
&lt;br /&gt;
During the callback, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains one of the following values in the lowest byte:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!value!!meaning&lt;br /&gt;
|-&lt;br /&gt;
|0x10||the last vehicle entering the station was a train&lt;br /&gt;
|-&lt;br /&gt;
|0x11||the last vehicle entering the station was a road vehicle&lt;br /&gt;
|-&lt;br /&gt;
|0x12||the last vehicle entering the station was a ship&lt;br /&gt;
|-&lt;br /&gt;
|0x13||the last vehicle entering the station was an aircraft&lt;br /&gt;
|-&lt;br /&gt;
|0||no vehicle entered the station yet, or (TTDPatch) the last one entering was sold&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Please note that there&#039;s only one &amp;quot;last vehicle type&amp;quot; field per station, so the vehicle this refers to may not have picked up any of your cargo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; has the value &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0xssaaaatt&amp;lt;/code&amp;gt;, where&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tt&amp;lt;/code&amp;gt; is the time since the cargo was last picked up, in the time units described above (1 unit = 2.5 days independent of vehicle type)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;aaaa&amp;lt;/code&amp;gt; is the amount of cargo waiting&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ss&amp;lt;/code&amp;gt; is the speed of the last vehicle picking the cargo up, in the speed units described above (if no vehicle entered the station yet, the value is 0xFF)&lt;br /&gt;
&lt;br /&gt;
====Effect of callback====&lt;br /&gt;
&lt;br /&gt;
The return value of the callback replaces the first three components (time since pickup, amount of cargo, max speed) of the calculation. The bonus for statues, TTDPatch AIs and new vehicles is always in effect, you cannot (yet) change this.&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3269</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=3269"/>
		<updated>2012-08-02T20:34:37Z</updated>

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

		<summary type="html">&lt;p&gt;Hirundo: /* General */ Remove note about cargo slots, mention feature-specific pages instead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 item (&amp;amp;lt;expression&amp;amp;gt; [, &amp;amp;lt;ID&amp;amp;gt; [, &amp;amp;lt;expression&amp;amp;gt;]]) {&lt;br /&gt;
 	(&amp;amp;lt;property-block&amp;amp;gt;|&amp;amp;lt;graphics-block&amp;amp;gt;|&amp;amp;lt;livery_override-block&amp;amp;gt;)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The first argument is the feature of the item, the second (optional) argument is the name used to identify the object throughout the NML file and the third (optional) argument is the numerical id you want to use for this item. The meaning and relevance of this id differs per-feature, refer to the feature-specific pages for more information.&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;
 item (FEAT_ROADVEHS, hereford_tram) {&lt;br /&gt;
 	property {&lt;br /&gt;
 		name:               string(STR_NAME_HEREFORD_TRAM);&lt;br /&gt;
 		climates_available: ALL_CLIMATES;&lt;br /&gt;
 		introduction_date:  date(1940,1,1);&lt;br /&gt;
 		speed:              60 km/h;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Property block ==&lt;br /&gt;
&lt;br /&gt;
 property {&lt;br /&gt;
 	(&amp;amp;lt;ID&amp;amp;gt;: (&amp;amp;lt;string&amp;amp;gt;|(&amp;amp;lt;expression&amp;amp;gt; [&amp;amp;lt;unit&amp;amp;gt;]));)+&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This one looks a lot more complicated than it actually is. A property-block contains one or more assignments. Each assignment starts with the name of the property that is changed followed by a colon. After the colon follows the value and you end the line with a semicolon. The type of the value depends on the property, some properties require a string as value and some an expression. For some properties you can optionally specify a unit that is used to convert the value to the unit that is written to the output file. You can only use a unit if the expression is constant. [[NML:Units|List of valid units]]&lt;br /&gt;
&lt;br /&gt;
== Graphics block ==&lt;br /&gt;
&lt;br /&gt;
A graphics block must be placed in an item-block. It allows to define the graphics for a particular item, as well as various callbacks. Callbacks are used to define various things at run time, based on information (variables) of the item itself. This provides a much greater degree of flexibility than setting properties. An example (using fictional callback names):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
     graphics {&lt;br /&gt;
         callback_a: switch_a;&lt;br /&gt;
         callback_b: return 42 + some_var;&lt;br /&gt;
         default: some_spritegroup;&lt;br /&gt;
     }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callbacks that are available differ per feature, refer to the feature-specific pages for more information. The &#039;default&#039;-callback is usually used to resolve the graphics. For each callback a return value may be specified, in the same way as for [[NML:Switch| switch-blocks]]. Note that all callbacks have to be defined in a &#039;&#039;&#039;single&#039;&#039;&#039; graphics-block.&lt;br /&gt;
&lt;br /&gt;
For vehicles and stations, a cargo type (identifier from the [[NML:Cargotable|cargo table]]) may be used as callback name, to provide cargo-specific graphics.&lt;br /&gt;
&lt;br /&gt;
== Livery override ==&lt;br /&gt;
&lt;br /&gt;
[[Image:NML liveryoverride.png|frame|left|Same cars, different engine, different car sprites]]&lt;br /&gt;
&lt;br /&gt;
A livery override block offers the option to change the look and behaviour of a wagon depending on the engine it is attached to. It is basically the same as a graphics-block and its syntax is the same. The difference is that it only applies to a particular combination of an engine and a wagon. E.g. passenger wagons could adapt their livery to match the engine, to make the consist look like a multiple-unit train. The spritegroup needs to be defined before it can be used in a livery override. A livery override block is always part of the &#039;&#039;&#039;engine&#039;&#039;&#039; definition and looks like&lt;br /&gt;
&lt;br /&gt;
 livery_override (vehicleID) {&lt;br /&gt;
 	callback_name: switch_name;&lt;br /&gt;
 	callback_name2: return value;&lt;br /&gt;
 	default: spritegroup_name;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
For an example see the [[NML:Spritegroup|spritegroup]]&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Railtypes&amp;diff=3267</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=3267"/>
		<updated>2012-08-02T20:24:38Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about item IDs&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;
&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>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=3266</id>
		<title>NML:Airports</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=3266"/>
		<updated>2012-08-02T20:16:49Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about substitute/override&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Airports and airport tiles can only be defined in OpenTTD {{ottd|1.1|r19459}} or later.&lt;br /&gt;
&lt;br /&gt;
==Airport (tile) IDs==&lt;br /&gt;
Airport and airport tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. For airport tiles, you should start your item definition with the &#039;substitute&#039;-property, which allocates a new airport tile. The value of this property should be the ID of a [[AirportTileDefaultProps|default airport tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing airport tile to be replaced with your item. For airports, there only is an &#039;override&#039;-property, which acts as a combined substitute and override.&lt;br /&gt;
&lt;br /&gt;
==Airport properties==&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;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Name of the airport&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} The id of airport to replace / override, see [[AirportTypes]].&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| list of layouts&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20377}}&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| [start year, last year]&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} List of the availablility years: first and last year it can be built&lt;br /&gt;
|-&lt;br /&gt;
| ttd_airport-type&lt;br /&gt;
| 0 ... 3&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Substitute TTDPatch airport type&lt;br /&gt;
|-&lt;br /&gt;
| catchment_area&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Catchment area of the airport in tiles around its perimeter&lt;br /&gt;
|-&lt;br /&gt;
| noise_level&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Noise generation of this airport&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 this airport&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport tile properties==&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;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to override, see [[AirportTypes]].&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to replace&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} 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;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}}&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} See [[NML:Animation speed|speed settings]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_APT_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} 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;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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;
| layout&lt;br /&gt;
| 0 .. (number of layouts - 1)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20364}} Layout number of the airport (index in the layouts array)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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;
| terrain_type&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| town_radius_group&lt;br /&gt;
|&lt;br /&gt;
|&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;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require a signed x,y offset as parameters. The offset is relative to the current tile. Offset 0,0 means 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_same_airport&lt;br /&gt;
| 1 if the tile is part of the same airport, 0 otherwise&lt;br /&gt;
|&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_airporttile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an airport tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original airport tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an airport tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an airport tile or it belongs to another GRF.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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 set (with 1 sprite)&lt;br /&gt;
| Preview graphics to use in the build menu. One sprite per layout may be given, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; to distinguish between layouts.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the buy menu. String may differ per layout, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable for this.&lt;br /&gt;
|-&lt;br /&gt;
| layout_name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the airport layout in the variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that, although the airport isn&#039;t built yet, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable is always available and set to the layout the user has selected in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport 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 an airport tile&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. 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. 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;
| 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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_BUILT&lt;br /&gt;
| Airport is built (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_TILELOOP&lt;br /&gt;
| Airport tile is processed in the tileloop (at different times for different tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_NEW_CARGO&lt;br /&gt;
| New cargo arrives at the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_CARGO_TAKEN&lt;br /&gt;
| All cargo of a cargo type is removed from the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_250_TICKS&lt;br /&gt;
| Every 250 ticks (all tiles at the same time)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Objects&amp;diff=3265</id>
		<title>NML:Objects</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Objects&amp;diff=3265"/>
		<updated>2012-08-02T20:11:35Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about object IDs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==Object IDs==&lt;br /&gt;
Object IDs are NewGRF-local and can therefore freely be chosen in the 0..255 range. An object is allocated by setting the &#039;class&#039;-property, which should therefore be set first. Overriding the default objects (e.g. transmitter, lighthouse) is not (yet) possible.&lt;br /&gt;
&lt;br /&gt;
==Object 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;
| class&lt;br /&gt;
| String literal of length 4&lt;br /&gt;
|&lt;br /&gt;
Unlike station classes, there is currently no default yet. You have to set the class ID before any other property or graphics. Characters allowed in the IDs are A-Z, 0-9. While you are technically free to chose your own class, it&#039;s highly recommended you stick to one of the [[#Default object classes|default classes]].&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one object in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| climates_available&lt;br /&gt;
| bitmask(CLIMATE_XXX, CLIMATE_YYY, ...)&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 NO_CLIMATE or ALL_CLIMATES&lt;br /&gt;
|-&lt;br /&gt;
| size&lt;br /&gt;
| [x, y]&lt;br /&gt;
| Size in x and y direction. Both x and y must be compiletime constants&lt;br /&gt;
|-&lt;br /&gt;
| build_cost_multiplier&lt;br /&gt;
|&lt;br /&gt;
| multiplicator to the base purchase cost&lt;br /&gt;
|-&lt;br /&gt;
| remove_cost_multiplier&lt;br /&gt;
|&lt;br /&gt;
| multiplicator to the base removal cost&lt;br /&gt;
|-&lt;br /&gt;
| introduction_date&lt;br /&gt;
| date&lt;br /&gt;
| The date this object becomes available to build.&lt;br /&gt;
|-&lt;br /&gt;
| end_of_life_date&lt;br /&gt;
| date&lt;br /&gt;
| The last date this object is buildable. Must be at least 365 days after introduction_date&lt;br /&gt;
|-&lt;br /&gt;
| object_flags&lt;br /&gt;
| bitmask(OBJ_FLAG_XXX, OBJ_FLAG_YYY)&lt;br /&gt;
|&lt;br /&gt;
See [[#List of object flags|list of object flags]]&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;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(OBJ_CBF_XXX, OBJ_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;
| height&lt;br /&gt;
| 0..255&lt;br /&gt;
| Height of the object / 8. For example if your object is 16 pixels height you should set height to 2. In OpenTTD this property is used to determine the height of the build object window; the height for the object preview is set to 32 + &amp;quot;value of property&amp;quot; * 8. The property is also used to determine how high a bridge must be if it is allowed by the bit in object_flags.&lt;br /&gt;
|-&lt;br /&gt;
| num_views&lt;br /&gt;
| 1, 2 or 4&lt;br /&gt;
| Objects may have &amp;quot;views&amp;quot;, i.e. different graphical representations, e.g. used to show rotated views of an object. Number of views may be 1, 2, or 4. Default value is 1. For non-square objects, x and y sizes are swapped for odd views. Use variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;view&amp;lt;/code&amp;gt; to determine the view of a built object.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Default object classes===&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[ObjectLabels|list of object labels]] in the NewGRF Specs. The default class names listed there are recommended, you still need to set the class name for at least one object in every class or you risk to end up with objects in a class without a name. If multiple NewGRFs define objects for the same class the name defined in the last NewGRF will be used.&lt;br /&gt;
&lt;br /&gt;
===List of object flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ONLY_SE&lt;br /&gt;
| Only available in the scenario editor (incompatible with OBJ_FLAG_ONLY_INGAME)&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_IRREMOVABLE&lt;br /&gt;
| Object cannot be removed with the normal dynamite tool. In OpenTTD you can only remove the object with the magic bulldozer cheat, in TTDPatch you can remove it by holding ctrl while using the bulldozer tool. The cost of removing this object is multiplied by 25.&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ANYTHING_REMOVE&lt;br /&gt;
| Anything can remove this object (owned land behavior)&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ON_WATER&lt;br /&gt;
| Allow construction of the object on water&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_REMOVE_IS_INCOME&lt;br /&gt;
| Removal cost is actually income (owned land behaviour)&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_NO_FOUNDATIONS&lt;br /&gt;
| Do not display foundations if on a slope&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ANIMATED&lt;br /&gt;
| Setting this flag will allow the object&#039;s animation counter to be increased, must be set if you plan to make use of animations.&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ONLY_INGAME&lt;br /&gt;
| Only available during game play (incompatible with OBJ_FLAG_ONLY_SE)&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_2CC&lt;br /&gt;
| Allows 2cc mapping for objects instead of the default 1cc&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_NOT_ON_LAND&lt;br /&gt;
| Disallows construction on land (implies OBJ_FLAG_ON_WATER)&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_DRAW_WATER&lt;br /&gt;
| Draws the water under the object. Only applies when built on top of a water tile, also replaces the ground tile of the object completely. Does not work when object built on sloped water tiles.&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_ALLOW_BRIDGE&lt;br /&gt;
| Allow bridge over the object taking the building height into account.&lt;br /&gt;
|-&lt;br /&gt;
| OBJ_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Random bits in the &amp;quot;next animation frame&amp;quot; callback&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Object 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;
| 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;
| terrain_type&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 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;
| build_date&lt;br /&gt;
|&lt;br /&gt;
| The date this object was build.&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;
| company_colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Colour used for the company colour mask. 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;
| owner&lt;br /&gt;
| 0..0x10&lt;br /&gt;
| CompanyID of the owner of the object or 0x10 if it was build in the scenario editor&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
|&lt;br /&gt;
| Manhattan distance to the nearest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
|&lt;br /&gt;
| Euclidean distance to the nearest town&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. The town zone from the closest town (measured in manhattan distance) is used.&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| 0 .. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;num_views&amp;lt;/code&amp;gt; - 1&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r21455}} The view of the particular object. See also the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;num_views&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Variables that require one or more parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_object_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| ID of the object on a nearby tile, if defined by the same grf. OBJECT_TYPE_OTHER_GRF if the object is defined by a different grf (or none at all). OBJECT_TYPE_NO_OBJECT if the tile does not contain an object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| Random bits of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_object&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile part of the same object?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a water tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See terrain_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| x, y offset (-8..7)&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;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 120&lt;br /&gt;
| The minimum height of the given tile. 8 units correspond to one height level&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x, y offset (-8..7)&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;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See animation_frame&lt;br /&gt;
|-&lt;br /&gt;
| object_count&lt;br /&gt;
| object id [, grfid]&lt;br /&gt;
| 0..0xFFFF&lt;br /&gt;
|&lt;br /&gt;
Number of objects with the given object id currently on the map. Grfid is the grfid of the newgrf you want to check the object count of (default is current grf). 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.&lt;br /&gt;
|-&lt;br /&gt;
| object_distance&lt;br /&gt;
| object id [, grfid]&lt;br /&gt;
| 0..0xFFFF&lt;br /&gt;
|&lt;br /&gt;
Manhattan distance to the closest object of the given type. Grfid is the grfid of the newgrf you want to check the minimum object distance of (default is current grf). 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. If the given object type is not yet built, this will return 0xFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Object 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;
| Normal graphics for an object placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase*&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&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 the object flag OBJ_FLAG_RANDOM_ANIMATION is set. Returning a sound effect in the high byte will cause that sound effect to be played (e.g. &amp;lt;code&amp;gt;return (sound(&amp;quot;mysound.wav&amp;quot;) &amp;amp;lt;&amp;amp;lt; 8) &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CB_RESULT_NEXT_FRAME;&amp;lt;/code&amp;gt;).&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 object 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 the object flag OBJ_FLAG_RANDOM_ANIMATION is set. &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. Returning a sound effect in the high byte will cause that sound effect to be played.&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;
| colour&lt;br /&gt;
| colour2*16 + colour1&lt;br /&gt;
|&lt;br /&gt;
Called once, just after construction. Variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the colour scheme of the constructing company in the same format as the return value, or random colours if not available (scenario editor). If OBJ_FLAG_2CC is not set, colour2 is zero. This callback can be used to alter the colour scheme of an object. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible colour values.&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;
| tile_check*&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[NML:Industries#Location check results|location_check]] industry callback&lt;br /&gt;
| Parameters: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the slope in bits 0..4 (see below), all other bits are reserved and should be and-masked out. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the location of the tile within the object as 16*y + x. If this callback is not implemented or fails, the default behaviour is to allow building the object if it can be placed on a flat surface. This means that steep slopes are not allowed and that the highest corner of each tile of a multi-tile object should have the same height. Additionally, all tiles must be flat if &amp;quot;build on slopes&amp;quot; is disabled.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text*&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the purchase menu&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;* These callbacks are called when the object is not yet built, so object- specific variables cannot be accessed. Trying to do so will result in undefined behaviour.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_OBJ_BUILT&lt;br /&gt;
| Object is built (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_OBJ_TILELOOP&lt;br /&gt;
| Object tile is processed in the tileloop (at different times for different tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_OBJ_256_TICKS&lt;br /&gt;
| Every 256 ticks (all tiles at the same time)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Cargos&amp;diff=3264</id>
		<title>NML:Cargos</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Cargos&amp;diff=3264"/>
		<updated>2012-08-02T20:07:49Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about cargo IDs corresponding to cargo slots&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==Cargo IDs==&lt;br /&gt;
For cargos, the item ID corresponds to the cargo type slot of the cargo. TTD default cargos occupy slots 0-11, so if you want to define a new cargo be sure to set this ID to 12 or higher. It is recommended to set the &#039;number&#039;-property to the same value as the item ID.&lt;br /&gt;
&lt;br /&gt;
==Cargo properties==&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;
| number&lt;br /&gt;
| 0..31&lt;br /&gt;
| Number of the cargo for bitmasks. This mostly affects old NewGRFs that don&#039;t have a cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| type_name&lt;br /&gt;
| string&lt;br /&gt;
| TextID for the cargo type name. Example string: &amp;quot;Passengers&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| unit_name&lt;br /&gt;
| string&lt;br /&gt;
| TextID for the name of one unit from the cargo type. Currently used for subsidies only (First Passenger service to..). Example string: &amp;quot;Passenger&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| single_unit_text&lt;br /&gt;
| string&lt;br /&gt;
| TextID to be displayed for 1 unit of cargo. Example string: &amp;quot;{WORD_S} ton of Stuff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| multiple_units_text&lt;br /&gt;
| string&lt;br /&gt;
| TextID to be displayed for multiple units of cargo. Example string: &amp;quot;{WORD_S} tonnes of Stuff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| type_abbreviation&lt;br /&gt;
| string&lt;br /&gt;
| TextID for cargo type abbreviation. Example string: &amp;quot;{TINYFONT}XX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sprite&lt;br /&gt;
| sprite&lt;br /&gt;
| TTD sprite number for the icon of the cargo. Alternatively, set to NEW_CARGO_SPRITE and use a graphics block to define a custom sprite.&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| float 0..255&lt;br /&gt;
| Weight of one unit of the cargo (in tons)&lt;br /&gt;
|-&lt;br /&gt;
| penalty_lowerbound&lt;br /&gt;
| 0..255&lt;br /&gt;
| Delivery time until penalty is applied&lt;br /&gt;
|-&lt;br /&gt;
| single_penalty_length&lt;br /&gt;
| 0..255&lt;br /&gt;
| Length of the interval where a single penalty is applied&lt;br /&gt;
|-&lt;br /&gt;
| price_factor&lt;br /&gt;
| float&lt;br /&gt;
| Payment for delivering 10 units of cargo across a distance of 20 squares (in British Pounds).&lt;br /&gt;
|-&lt;br /&gt;
| station_list_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour for the station list window (index from the [[NML:Graphic files|DOS palette]])&lt;br /&gt;
|-&lt;br /&gt;
| cargo_payment_list_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour for the cargo payment list window (index from the [[NML:Graphic files|DOS palette]])&lt;br /&gt;
|-&lt;br /&gt;
| is_freight&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Freight status (for the freighttrains switch); 0=not freight, 1=is freight&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Cargo classes|cargo classes]])&lt;br /&gt;
| Cargo classes&lt;br /&gt;
|-&lt;br /&gt;
| cargo_label&lt;br /&gt;
| 4 letters&lt;br /&gt;
| Cargo label, as used in the cargo table&lt;br /&gt;
|-&lt;br /&gt;
| town_growth_effect&lt;br /&gt;
| TOWNGROWTH_XXX&lt;br /&gt;
|&lt;br /&gt;
Effect for town growth, see [[#Cargo effects on town growth|Cargo effects on town growth]]&lt;br /&gt;
|-&lt;br /&gt;
| town_growth_multiplier&lt;br /&gt;
| float 0..255&lt;br /&gt;
| Multiplier for town growth. To be used in conjuction with town_growth_effect, when that is not TOWNGROWTH_NONE. For example, a value of 4 makes your cargo have the same effect on town growth as 4 units of food/goods/etc.&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;
| capacity_multiplier&lt;br /&gt;
| float 0 .. 255&lt;br /&gt;
| {{ottd|1.2|r22860}} This defines the capacity of vehicles carrying this cargo type, if the vehicle sets no specific capacity to this specific cargo type. Set this property to the amount of cargo a vehicle shall carry, which can carry 1 ton of coal or 1000 thousand litres of water (whatever comparison is more suitable for your cargotype). Depending on whether your cargo type is light or heavy you should set this property either comparing the weight or the volume. Default values are 4 for passengers, 2 for mail, goods and sweets and 1 for all other cargos.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cargo payment is computed from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;price_factor&amp;lt;/code&amp;gt;, amount of cargo transported, distance, and a time delivery factor. Unit of the delivery time is 185 ticks, roughly 2.5 days. The factor is constant (with value 255) if delivery time is less than &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;penalty_lowerbound&amp;lt;/code&amp;gt;. It goes down with rate 1 between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;penalty_lowerbound + single_penalty_length&amp;lt;/code&amp;gt;, and goes down with rate 2 if the delivery time is even longer. Time delivery factor is never less than 31.&lt;br /&gt;
&lt;br /&gt;
===Cargo classes===&lt;br /&gt;
&lt;br /&gt;
Available cargo classes are listed in the following table. Cargos may be in more than one class. Cargo classes are always used as a bitmask, use the built-in function &amp;lt;code&amp;gt;bitmask()&amp;lt;/code&amp;gt;. For example, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_EXPRESS, CC_REFRIGERATED)&amp;lt;/code&amp;gt; is used for food.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! type of cargo&lt;br /&gt;
|-&lt;br /&gt;
| CC_PASSENGERS&lt;br /&gt;
| passengers, also tourists (ECS)&lt;br /&gt;
|-&lt;br /&gt;
| CC_MAIL&lt;br /&gt;
| mail&lt;br /&gt;
|-&lt;br /&gt;
| CC_EXPRESS&lt;br /&gt;
| express goods, also tourists (ECS)&lt;br /&gt;
|-&lt;br /&gt;
| CC_ARMOURED&lt;br /&gt;
| valuables, diamonds, gold and alike&lt;br /&gt;
|-&lt;br /&gt;
| CC_BULK&lt;br /&gt;
| coal, ore, grain,...&lt;br /&gt;
|-&lt;br /&gt;
| CC_PIECE_GOODS&lt;br /&gt;
| containers, crates, livestock&lt;br /&gt;
|-&lt;br /&gt;
| CC_LIQUID&lt;br /&gt;
| oil, milk, water, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_REFRIGERATED&lt;br /&gt;
| food, milk, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_HAZARDOUS&lt;br /&gt;
| chemicals?, uranium, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_COVERED&lt;br /&gt;
| grain, cement, fruit, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_OVERSIZED&lt;br /&gt;
| vehicles, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_POWDERIZED&lt;br /&gt;
| cement, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_NON_POURABLE&amp;lt;br&amp;gt;CC_NEO_BULK&lt;br /&gt;
| sugar cane, wool or straw bales, ...&lt;br /&gt;
|-&lt;br /&gt;
| CC_SPECIAL&lt;br /&gt;
| Special cargo, used for refit tricks. (e.g. regearing in NARS)&lt;br /&gt;
|-&lt;br /&gt;
| NO_CARGO_CLASS&lt;br /&gt;
| Special value that you can used to instead of 0.&lt;br /&gt;
|-&lt;br /&gt;
| ALL_NORMAL_CARGO_CLASSES&lt;br /&gt;
| Bitmask of all cargo classes except CC_SPECIAL. This is the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(CC_PASSENGERS, CC_MAIL, ..., CC_OVERSIZED)&amp;lt;/code&amp;gt;. Note: This is already a bitmask, don&#039;t use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(..)&amp;lt;/code&amp;gt; function with this.&lt;br /&gt;
|-&lt;br /&gt;
| ALL_CARGO_CLASSES&lt;br /&gt;
| Bitmask of all cargo classes. Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ALL_NORMAL_CARGO_CLASSES | bitmask(CC_SPECIAL)&amp;lt;/code&amp;gt; Note: This is already a bitmask, don&#039;t use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;bitmask(..)&amp;lt;/code&amp;gt; function with this.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cargo effects on town growth===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! effect&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_PASSENGERS&lt;br /&gt;
| Affect towns as passengers do&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_MAIL&lt;br /&gt;
| Affect towns as mail does&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_GOODS&lt;br /&gt;
| Affect towns as goods/candy does&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_WATER&lt;br /&gt;
| Affect towns as water does (second required cargo for towngrowth in the desert)&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_FOOD&lt;br /&gt;
| Affect towns as food/fizzy drinks do (first required cargo for towngrowth in desert/above snowline)&lt;br /&gt;
|-&lt;br /&gt;
| TOWNGROWTH_NONE&lt;br /&gt;
| Don&#039;t affect town growth (default)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Cargo variables==&lt;br /&gt;
&lt;br /&gt;
Cargos have no variables (yet).&lt;br /&gt;
&lt;br /&gt;
==Cargo 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 set (with 1 sprite)&lt;br /&gt;
| Graphics for the cargo icon (only if property &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;sprite&amp;lt;/code&amp;gt; is set to NEW_CARGO_SPRITE)&lt;br /&gt;
|-&lt;br /&gt;
| station_rating&lt;br /&gt;
| -16384 .. 16383&lt;br /&gt;
| See detailed explanation below&lt;br /&gt;
|-&lt;br /&gt;
| profit&lt;br /&gt;
| -12748 .. 12748&lt;br /&gt;
| Called whenever cargo is delivered. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0xttaadddd&amp;lt;/code&amp;gt; with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tt&amp;lt;/code&amp;gt; being the time spent en-route (1 unit = 2.5 days), &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;aa&amp;lt;/code&amp;gt; the amount of cargo delivered and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;dddd&amp;lt;/code&amp;gt; the manhattan distance it was transported. The returned value is multiplied by the amount and the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;price_factor&amp;lt;/code&amp;gt; and then divided by 256 to determine the income the player receives. Returning negative values is possible, it makes players pay for the delivery.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Station rating callback===&lt;br /&gt;
&lt;br /&gt;
The station rating callback is quite complicated and deserves some detailed explanation. The default station rating calculation works as follows:&lt;br /&gt;
&lt;br /&gt;
Internally, station rating is byte with values 0 .. 255, representing respectively 0% and 100%. Every 2.5 days, the transportation &#039;performance&#039; is calculated using some factors outlined below. The station rating is then set to this performance value, with the caveat that the rating change cannot exceed 2 points. Therefore, rating changes are always slow, this callback cannot change this. The initial rating is 175 points (69%). The following factors are parts of the performance, their effects are summed.&lt;br /&gt;
&lt;br /&gt;
====Time since the cargo was last picked up====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Time units (days)&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;gt;21 (&amp;amp;gt;52.5 days)&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| 13 .. 21 (32.5 days .. 52.5 days)&lt;br /&gt;
| 25 (10%)&lt;br /&gt;
|-&lt;br /&gt;
| 7 .. 12 (17.5 days .. 32.5 days)&lt;br /&gt;
| 50 (20%)&lt;br /&gt;
|-&lt;br /&gt;
| 4 .. 6 (10 days .. 17.5 days)&lt;br /&gt;
| 95 (37%)&lt;br /&gt;
|-&lt;br /&gt;
| 0..3 (0 days..10 days)&lt;br /&gt;
| 130 (51%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The time unit used equals 185 engine ticks, or 2.5 TTD days. For ships, the time units are divided by 4 before calculating this component, so ships have four times more time before the ratings start dropping.&lt;br /&gt;
&lt;br /&gt;
====Amount of cargo waiting====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Amount of cargo&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;gt;1500&lt;br /&gt;
| -90 (-35%)&lt;br /&gt;
|-&lt;br /&gt;
| 1001..1500&lt;br /&gt;
| -35 (-14%)&lt;br /&gt;
|-&lt;br /&gt;
| 601..1000&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| 301..600&lt;br /&gt;
| 10 (4%)&lt;br /&gt;
|-&lt;br /&gt;
| 101..300&lt;br /&gt;
| 30 (12%)&lt;br /&gt;
|-&lt;br /&gt;
| 0..100&lt;br /&gt;
| 40 (16%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Max. speed of the last vehicle picking up the cargo====&lt;br /&gt;
&lt;br /&gt;
This calculation is somewhat complicated. The maximum speed of the vehicle is expressed in &amp;quot;speed units&amp;quot;. For trains and road vehicles, the speed unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead. If the vehicle is slower than 85 units, no points are awarded; otherwise, you get (speed_units-85)/4 points. Therefore, the maximum you can get is 42 points, or 16%.&lt;br /&gt;
&lt;br /&gt;
====Age of the last carrier picking up the cargo====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Age of vehicle (years)&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 10 (4%)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 20 (8%)&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 33 (13%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In TTDPatch this changes when the &#039;newagerating&#039; switch is enabled&lt;br /&gt;
&lt;br /&gt;
====Bonus for AI companies (TTDPatch only)====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! AI intelligence setting&lt;br /&gt;
! Score (%, rounded)&lt;br /&gt;
|-&lt;br /&gt;
| Low&lt;br /&gt;
| 0 (0%)&lt;br /&gt;
|-&lt;br /&gt;
| Medium&lt;br /&gt;
| 31 (12%)&lt;br /&gt;
|-&lt;br /&gt;
| High&lt;br /&gt;
| 63 (25%)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Bonus for statue in nearest town====&lt;br /&gt;
&lt;br /&gt;
If your company has erected a statue in the nearest town, you get 26 points (10%) bonus to all cargo ratings.&lt;br /&gt;
&lt;br /&gt;
====Callback parameters====&lt;br /&gt;
&lt;br /&gt;
During the callback, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains one of the following values in the lowest byte:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!value!!meaning&lt;br /&gt;
|-&lt;br /&gt;
|0x10||the last vehicle entering the station was a train&lt;br /&gt;
|-&lt;br /&gt;
|0x11||the last vehicle entering the station was a road vehicle&lt;br /&gt;
|-&lt;br /&gt;
|0x12||the last vehicle entering the station was a ship&lt;br /&gt;
|-&lt;br /&gt;
|0x13||the last vehicle entering the station was an aircraft&lt;br /&gt;
|-&lt;br /&gt;
|0||no vehicle entered the station yet, or (TTDPatch) the last one entering was sold&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Please note that there&#039;s only one &amp;quot;last vehicle type&amp;quot; field per station, so the vehicle this refers to may not have picked up any of your cargo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; has the value &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0xssaaaatt&amp;lt;/code&amp;gt;, where&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tt&amp;lt;/code&amp;gt; is the time since the cargo was last picked up, in the time units described above (1 unit = 2.5 days independent of vehicle type)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;aaaa&amp;lt;/code&amp;gt; is the amount of cargo waiting&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ss&amp;lt;/code&amp;gt; is the speed of the last vehicle picking the cargo up, in the speed units described above (if no vehicle entered the station yet, the value is 0xFF)&lt;br /&gt;
&lt;br /&gt;
====Effect of callback====&lt;br /&gt;
&lt;br /&gt;
The return value of the callback replaces the first three components (time since pickup, amount of cargo, max speed) of the calculation. The bonus for statues, TTDPatch AIs and new vehicles is always in effect, you cannot (yet) change this.&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3263</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=3263"/>
		<updated>2012-08-02T19:22:24Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Add note about industry substitute/overrides&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 (tile) ID allocation ==&lt;br /&gt;
Industry and industry tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new industry (tile). The value of this property should be the ID of a [[IndustryDefaultProps|default industry]] or [[IndustryTileDefaultProps|default industry tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF). &lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing industry (tile) to be replaced with your item. You should use this if you are for example defining a coal mine which changes production more dynamically. If your type is not a direct replacement of an existing item, don&#039;t set this property.&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;
{{nml|0.2}} 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;
{{nml|0.3}}. 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;
| build_prod_change&lt;br /&gt;
| Value in range 4-128&lt;br /&gt;
| Called when an industry is constructed.  Return value is production level (default 16).  Can also be used to initialise permanent storage when an industry is constructed.  Requires OpenTTD &amp;gt; r24186 and nml &amp;gt; 1886.&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 closure 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>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Canals&amp;diff=3262</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=3262"/>
		<updated>2012-08-02T19:08:30Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Move ID section to the top, add some usage notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
== Canal ids ==&lt;br /&gt;
The used item ID defines what sprites this item provides. Item IDs should be picked from the following table (WF_XXX).&lt;br /&gt;
&lt;br /&gt;
The &#039;normal sprites&#039; column contains the amount of sprites that should be provided for this feature. If the appropriate bit in the graphics_flags-property (see below) the amount of sprites stated in the &#039;alternative sprites&#039; column must be provided instead.&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;br /&gt;
&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;
| There is currently only one possible bit: &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;
&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_XXX&lt;br /&gt;
| &lt;br /&gt;
;TILETYPE_NORMAL&lt;br /&gt;
:Normal grass in all climates&lt;br /&gt;
;TILETYPE_DESERT&lt;br /&gt;
;TILETYPE_RAIN_FOREST&lt;br /&gt;
:In tropical climate only: some tiles in the mountains, distant from desert and sea&lt;br /&gt;
;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;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3261</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=3261"/>
		<updated>2012-08-02T18:58:18Z</updated>

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

		<summary type="html">&lt;p&gt;Hirundo: Add NML (decimal) vehicle IDs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a list of vehicle IDs, for example for choosing the ID to change in [[Action0|action 0]] or [[Action3|Action 3]].&lt;br /&gt;
&lt;br /&gt;
The first column of each table shows the ID of the vehicle within the game (in decimal), the second columns shows the ID to use for .NFO files (in hex), and the third column shows the standard name of the vehicle.&lt;br /&gt;
&lt;br /&gt;
Please see the RoadVehicleIDRecommendation for information on how to make your road vehicle set compatible with other road vehicle sets.&lt;br /&gt;
&lt;br /&gt;
The IDs listed are the only IDs that can be used in TTDPatch and OpenTTD prior to r12924. Since OpenTTD r13482, IDs greater than 255 are allowed, up to a theoretical limit of 65535. Any engine defined which is not in the original range listed below will have no default properties, including name.&lt;br /&gt;
&lt;br /&gt;
==Train Engines==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||&amp;lt;center&amp;gt;00&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;||Kirby Paul Tank (Steam)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||&amp;lt;center&amp;gt;01&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;1&amp;lt;/center&amp;gt;||MJS 250 (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||&amp;lt;center&amp;gt;02&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2&amp;lt;/center&amp;gt;||Ploddyphut Choo-Choo&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||&amp;lt;center&amp;gt;03&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3&amp;lt;/center&amp;gt;||Powernaut Choo-Choo&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4||&amp;lt;center&amp;gt;04&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4&amp;lt;/center&amp;gt;||Mightymover Choo-Choo&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|5||&amp;lt;center&amp;gt;05&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;5&amp;lt;/center&amp;gt;||Ploddyphut Diesel&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|6||&amp;lt;center&amp;gt;06&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;6&amp;lt;/center&amp;gt;||Powernaut Diesel&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||&amp;lt;center&amp;gt;07&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;7&amp;lt;/center&amp;gt;||Wills 2-8-0 (Steam)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8||&amp;lt;center&amp;gt;08&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;8&amp;lt;/center&amp;gt;||Chaney &#039;Jubilee&#039; (Steam)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|9||&amp;lt;center&amp;gt;09&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;9&amp;lt;/center&amp;gt;||Ginzu &#039;A4&#039; (Steam)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10||&amp;lt;center&amp;gt;0A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||SH &#039;8P&#039; (Steam)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11||&amp;lt;center&amp;gt;0B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||Manley-Morel DMU (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12||&amp;lt;center&amp;gt;0C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||&#039;Dash&#039; (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13||&amp;lt;center&amp;gt;0D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||SH/Hendry &#039;25&#039; (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14||&amp;lt;center&amp;gt;0E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||UU &#039;37&#039; (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15||&amp;lt;center&amp;gt;0F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||Floss &#039;47&#039; (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||CS 4000 (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||CS 2400 (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||Centennial (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|19||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||Kelling 3100 (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|20||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||Turner Turbo (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|21||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||MJS 1000 (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|22||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||SH &#039;125&#039; (Diesel)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|23||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||SH &#039;30&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|24||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||SH &#039;40&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|25||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||&#039;T.I.M.&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|26||&amp;lt;center&amp;gt;1A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||&#039;AsiaStar&#039; (Electric)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Train Wagons==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|27||&amp;lt;center&amp;gt;1B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||Passenger Carriage&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|28||&amp;lt;center&amp;gt;1C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||Mail Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|29||&amp;lt;center&amp;gt;1D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;29&amp;lt;/center&amp;gt;||Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|30||&amp;lt;center&amp;gt;1E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;30&amp;lt;/center&amp;gt;||Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|31||&amp;lt;center&amp;gt;1F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;31&amp;lt;/center&amp;gt;||Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|32||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;32&amp;lt;/center&amp;gt;||Goods Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|33||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;33&amp;lt;/center&amp;gt;||Grain Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|34||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;34&amp;lt;/center&amp;gt;||Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|35||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;35&amp;lt;/center&amp;gt;||Iron Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|36||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;36&amp;lt;/center&amp;gt;||Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|37||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;37&amp;lt;/center&amp;gt;||Armoured Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|38||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;38&amp;lt;/center&amp;gt;||Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|39||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;39&amp;lt;/center&amp;gt;||Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|40||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;40&amp;lt;/center&amp;gt;||Copper Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|41||&amp;lt;center&amp;gt;29&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;41&amp;lt;/center&amp;gt;||Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|42||&amp;lt;center&amp;gt;2A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;42&amp;lt;/center&amp;gt;||Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|43||&amp;lt;center&amp;gt;2B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;43&amp;lt;/center&amp;gt;||Rubber Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|44||&amp;lt;center&amp;gt;2C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;44&amp;lt;/center&amp;gt;||Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|45||&amp;lt;center&amp;gt;2D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;45&amp;lt;/center&amp;gt;||Candyfloss Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|46||&amp;lt;center&amp;gt;2E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;46&amp;lt;/center&amp;gt;||Toffee Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|47||&amp;lt;center&amp;gt;2F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;47&amp;lt;/center&amp;gt;||Bubble Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|48||&amp;lt;center&amp;gt;30&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;48&amp;lt;/center&amp;gt;||Cola Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|49||&amp;lt;center&amp;gt;31&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;49&amp;lt;/center&amp;gt;||Sweet Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|50||&amp;lt;center&amp;gt;32&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;50&amp;lt;/center&amp;gt;||Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|51||&amp;lt;center&amp;gt;33&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;51&amp;lt;/center&amp;gt;||Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|52||&amp;lt;center&amp;gt;34&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;52&amp;lt;/center&amp;gt;||Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|53||&amp;lt;center&amp;gt;35&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;53&amp;lt;/center&amp;gt;||Plastic Truck&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Monorail Engines==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|54||&amp;lt;center&amp;gt;36&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;54&amp;lt;/center&amp;gt;||&#039;X2001&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|55||&amp;lt;center&amp;gt;37&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;55&amp;lt;/center&amp;gt;||&#039;Millennium Z1&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|56||&amp;lt;center&amp;gt;38&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;56&amp;lt;/center&amp;gt;||Wizzowow Z99&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Monorail Wagons==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|57||&amp;lt;center&amp;gt;39&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;57&amp;lt;/center&amp;gt;||Passenger Carriage&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|58||&amp;lt;center&amp;gt;3A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;58&amp;lt;/center&amp;gt;||Mail Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|59||&amp;lt;center&amp;gt;3B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;59&amp;lt;/center&amp;gt;||Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|60||&amp;lt;center&amp;gt;3C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;60&amp;lt;/center&amp;gt;||Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|61||&amp;lt;center&amp;gt;3D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;61&amp;lt;/center&amp;gt;||Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|62||&amp;lt;center&amp;gt;3E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;62&amp;lt;/center&amp;gt;||Goods Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|63||&amp;lt;center&amp;gt;3F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;63&amp;lt;/center&amp;gt;||Grain Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|64||&amp;lt;center&amp;gt;40&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;64&amp;lt;/center&amp;gt;||Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|65||&amp;lt;center&amp;gt;41&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;65&amp;lt;/center&amp;gt;||Iron Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|66||&amp;lt;center&amp;gt;42&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;66&amp;lt;/center&amp;gt;||Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|67||&amp;lt;center&amp;gt;43&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;67&amp;lt;/center&amp;gt;||Armoured Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|68||&amp;lt;center&amp;gt;44&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;68&amp;lt;/center&amp;gt;||Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|69||&amp;lt;center&amp;gt;45&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;69&amp;lt;/center&amp;gt;||Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|70||&amp;lt;center&amp;gt;46&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;70&amp;lt;/center&amp;gt;||Copper Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|71||&amp;lt;center&amp;gt;47&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;71&amp;lt;/center&amp;gt;||Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|72||&amp;lt;center&amp;gt;48&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;72&amp;lt;/center&amp;gt;||Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|73||&amp;lt;center&amp;gt;49&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;73&amp;lt;/center&amp;gt;||Rubber Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|74||&amp;lt;center&amp;gt;4A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;74&amp;lt;/center&amp;gt;||Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|75||&amp;lt;center&amp;gt;4B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;75&amp;lt;/center&amp;gt;||Candyfloss Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|76||&amp;lt;center&amp;gt;4C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;76&amp;lt;/center&amp;gt;||Toffee Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|77||&amp;lt;center&amp;gt;4D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;77&amp;lt;/center&amp;gt;||Bubble Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|78||&amp;lt;center&amp;gt;4E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;78&amp;lt;/center&amp;gt;||Cola Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|79||&amp;lt;center&amp;gt;4F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;79&amp;lt;/center&amp;gt;||Sweet Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|80||&amp;lt;center&amp;gt;50&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;80&amp;lt;/center&amp;gt;||Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|81||&amp;lt;center&amp;gt;51&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;81&amp;lt;/center&amp;gt;||Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|82||&amp;lt;center&amp;gt;52&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;82&amp;lt;/center&amp;gt;||Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|83||&amp;lt;center&amp;gt;53&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;83&amp;lt;/center&amp;gt;||Plastic Truck&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Maglev Engines==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|84||&amp;lt;center&amp;gt;54&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;84&amp;lt;/center&amp;gt;||Lev1 &#039;Leviathan&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|85||&amp;lt;center&amp;gt;55&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;85&amp;lt;/center&amp;gt;||Lev2 &#039;Cyclops&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|86||&amp;lt;center&amp;gt;56&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;86&amp;lt;/center&amp;gt;||Lev3 &#039;Pegasus&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|87||&amp;lt;center&amp;gt;57&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;87&amp;lt;/center&amp;gt;||Lev4 &#039;Chimaera&#039; (Electric)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|88||&amp;lt;center&amp;gt;58&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;88&amp;lt;/center&amp;gt;||Wizzowow Rocketeer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Maglev Wagons==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|89||&amp;lt;center&amp;gt;59&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;89&amp;lt;/center&amp;gt;||Passenger Carriage&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|90||&amp;lt;center&amp;gt;5A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;90&amp;lt;/center&amp;gt;||Mail Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|91||&amp;lt;center&amp;gt;5B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;91&amp;lt;/center&amp;gt;||Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|92||&amp;lt;center&amp;gt;5C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;92&amp;lt;/center&amp;gt;||Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|93||&amp;lt;center&amp;gt;5D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;93&amp;lt;/center&amp;gt;||Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|94||&amp;lt;center&amp;gt;5E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;94&amp;lt;/center&amp;gt;||Goods Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|95||&amp;lt;center&amp;gt;5F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;95&amp;lt;/center&amp;gt;||Grain Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|96||&amp;lt;center&amp;gt;60&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;96&amp;lt;/center&amp;gt;||Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|97||&amp;lt;center&amp;gt;61&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;97&amp;lt;/center&amp;gt;||Iron Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|98||&amp;lt;center&amp;gt;62&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;98&amp;lt;/center&amp;gt;||Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|99||&amp;lt;center&amp;gt;63&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;99&amp;lt;/center&amp;gt;||Armoured Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|100||&amp;lt;center&amp;gt;64&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;100&amp;lt;/center&amp;gt;||Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|101||&amp;lt;center&amp;gt;65&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;101&amp;lt;/center&amp;gt;||Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|102||&amp;lt;center&amp;gt;66&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;102&amp;lt;/center&amp;gt;||Copper Ore Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|103||&amp;lt;center&amp;gt;67&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;103&amp;lt;/center&amp;gt;||Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|104||&amp;lt;center&amp;gt;68&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;104&amp;lt;/center&amp;gt;||Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|105||&amp;lt;center&amp;gt;69&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;105&amp;lt;/center&amp;gt;||Rubber Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|106||&amp;lt;center&amp;gt;6A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;106&amp;lt;/center&amp;gt;||Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|107||&amp;lt;center&amp;gt;6B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;107&amp;lt;/center&amp;gt;||Candyfloss Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|108||&amp;lt;center&amp;gt;6C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;108&amp;lt;/center&amp;gt;||Toffee Hopper&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|109||&amp;lt;center&amp;gt;6D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;109&amp;lt;/center&amp;gt;||Bubble Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|110||&amp;lt;center&amp;gt;6E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;110&amp;lt;/center&amp;gt;||Cola Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|111||&amp;lt;center&amp;gt;6F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;111&amp;lt;/center&amp;gt;||Sweet Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|112||&amp;lt;center&amp;gt;70&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;112&amp;lt;/center&amp;gt;||Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|113||&amp;lt;center&amp;gt;71&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;113&amp;lt;/center&amp;gt;||Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|114||&amp;lt;center&amp;gt;72&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;114&amp;lt;/center&amp;gt;||Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|115||&amp;lt;center&amp;gt;73&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;115&amp;lt;/center&amp;gt;||Plastic Truck&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Buses==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|116||&amp;lt;center&amp;gt;00&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;||MPS Regal Bus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|117||&amp;lt;center&amp;gt;01&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;1&amp;lt;/center&amp;gt;||Hereford Leopard Bus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|118||&amp;lt;center&amp;gt;02&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2&amp;lt;/center&amp;gt;||Foster Bus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|119||&amp;lt;center&amp;gt;03&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3&amp;lt;/center&amp;gt;||Foster MkII Superbus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|120||&amp;lt;center&amp;gt;04&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4&amp;lt;/center&amp;gt;||Ploddyphut MkI Bus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|121||&amp;lt;center&amp;gt;05&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;5&amp;lt;/center&amp;gt;||Ploddyphut MkII Bus&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|122||&amp;lt;center&amp;gt;06&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;6&amp;lt;/center&amp;gt;||Ploddyphut MkIII Bus&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Trucks - Regular climates (mostly)==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|123||&amp;lt;center&amp;gt;07&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;7&amp;lt;/center&amp;gt;||Balogh Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|124||&amp;lt;center&amp;gt;08&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;8&amp;lt;/center&amp;gt;||Uhl Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|125||&amp;lt;center&amp;gt;09&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;9&amp;lt;/center&amp;gt;||DW Coal Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|126||&amp;lt;center&amp;gt;0A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||MPS Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|127||&amp;lt;center&amp;gt;0B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||Reynard Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|128||&amp;lt;center&amp;gt;0C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||Perry Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|129||&amp;lt;center&amp;gt;0D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||MightyMover Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|130||&amp;lt;center&amp;gt;0E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||Powernaught Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|131||&amp;lt;center&amp;gt;0F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||Wizzowow Mail Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|132||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||Witcombe Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|133||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||Foster Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|134||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||Perry Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|135||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||Talbott Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|136||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||Uhl Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|137||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||Foster Livestock Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|138||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||Balogh Goods Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|139||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||Craighead Goods Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|140||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||Goss Goods Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|141||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||Hereford Grain Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|142||&amp;lt;center&amp;gt;1A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||Thomas Grain Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|143||&amp;lt;center&amp;gt;1B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||Goss Grain Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|144||&amp;lt;center&amp;gt;1C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||Witcombe Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|145||&amp;lt;center&amp;gt;1D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;29&amp;lt;/center&amp;gt;||Foster Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|146||&amp;lt;center&amp;gt;1E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;30&amp;lt;/center&amp;gt;||Moreland Wood Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|147||&amp;lt;center&amp;gt;1F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;31&amp;lt;/center&amp;gt;||MPS Iron Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|148||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;32&amp;lt;/center&amp;gt;||Uhl Iron Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|149||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;33&amp;lt;/center&amp;gt;||Chippy Iron Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|150||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;34&amp;lt;/center&amp;gt;||Balogh Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|151||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;35&amp;lt;/center&amp;gt;||Uhl Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|152||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;36&amp;lt;/center&amp;gt;||Kelling Steel Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|153||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;37&amp;lt;/center&amp;gt;||Balogh Armoured Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|154||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;38&amp;lt;/center&amp;gt;||Uhl Armoured Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|155||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;39&amp;lt;/center&amp;gt;||Foster Armoured Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|156||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;40&amp;lt;/center&amp;gt;||Foster Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|157||&amp;lt;center&amp;gt;29&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;41&amp;lt;/center&amp;gt;||Perry Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|158||&amp;lt;center&amp;gt;2A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;42&amp;lt;/center&amp;gt;||Chippy Food Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|159||&amp;lt;center&amp;gt;2B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;43&amp;lt;/center&amp;gt;||Uhl Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|160||&amp;lt;center&amp;gt;2C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;44&amp;lt;/center&amp;gt;||Balogh Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|161||&amp;lt;center&amp;gt;2D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;45&amp;lt;/center&amp;gt;||MPS Paper Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|162||&amp;lt;center&amp;gt;2E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;46&amp;lt;/center&amp;gt;||MPS Copper Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|163||&amp;lt;center&amp;gt;2F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;47&amp;lt;/center&amp;gt;||Uhl Copper Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|164||&amp;lt;center&amp;gt;30&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;48&amp;lt;/center&amp;gt;||Goss Copper Ore Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|165||&amp;lt;center&amp;gt;31&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;49&amp;lt;/center&amp;gt;||Uhl Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|166||&amp;lt;center&amp;gt;32&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;50&amp;lt;/center&amp;gt;||Balogh Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|167||&amp;lt;center&amp;gt;33&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;51&amp;lt;/center&amp;gt;||MPS Water Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|168||&amp;lt;center&amp;gt;34&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;52&amp;lt;/center&amp;gt;||Balogh Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|169||&amp;lt;center&amp;gt;35&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;53&amp;lt;/center&amp;gt;||Uhl Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|170||&amp;lt;center&amp;gt;36&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;54&amp;lt;/center&amp;gt;||Kelling Fruit Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|171||&amp;lt;center&amp;gt;37&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;55&amp;lt;/center&amp;gt;||Balogh Rubber Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|172||&amp;lt;center&amp;gt;38&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;56&amp;lt;/center&amp;gt;||Uhl Rubber Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|173||&amp;lt;center&amp;gt;39&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;57&amp;lt;/center&amp;gt;||RMT Rubber Truck&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Trucks - Toyland==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|174||&amp;lt;center&amp;gt;3A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;58&amp;lt;/center&amp;gt;||MightyMover Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|175||&amp;lt;center&amp;gt;3B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;59&amp;lt;/center&amp;gt;||Powernaught Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|176||&amp;lt;center&amp;gt;3C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;60&amp;lt;/center&amp;gt;||Wizzowow Sugar Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|177||&amp;lt;center&amp;gt;3D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;61&amp;lt;/center&amp;gt;||MightyMover Cola Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|178||&amp;lt;center&amp;gt;3E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;62&amp;lt;/center&amp;gt;||Powernaught Cola Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|179||&amp;lt;center&amp;gt;3F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;63&amp;lt;/center&amp;gt;||Wizzowow Cola Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|180||&amp;lt;center&amp;gt;40&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;64&amp;lt;/center&amp;gt;||MightyMover Candyfloss Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|181||&amp;lt;center&amp;gt;41&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;65&amp;lt;/center&amp;gt;||Powernaught Candyfloss Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|182||&amp;lt;center&amp;gt;42&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;66&amp;lt;/center&amp;gt;||Wizzowow Candyfloss Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|183||&amp;lt;center&amp;gt;43&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;67&amp;lt;/center&amp;gt;||MightyMover Toffee Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|184||&amp;lt;center&amp;gt;44&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;68&amp;lt;/center&amp;gt;||Powernaught Toffee Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|185||&amp;lt;center&amp;gt;45&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;69&amp;lt;/center&amp;gt;||Wizzowow Toffee Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|186||&amp;lt;center&amp;gt;46&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;70&amp;lt;/center&amp;gt;||MightyMover Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|187||&amp;lt;center&amp;gt;47&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;71&amp;lt;/center&amp;gt;||Powernaught Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|188||&amp;lt;center&amp;gt;48&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;72&amp;lt;/center&amp;gt;||Wizzowow Toy Van&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|189||&amp;lt;center&amp;gt;49&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;73&amp;lt;/center&amp;gt;||MightyMover Sweet Lorry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|190||&amp;lt;center&amp;gt;4A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;74&amp;lt;/center&amp;gt;||Powernaught Sweet Lorry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|191||&amp;lt;center&amp;gt;4B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;75&amp;lt;/center&amp;gt;||Wizzowow Sweet Lorry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|192||&amp;lt;center&amp;gt;4C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;76&amp;lt;/center&amp;gt;||MightyMover Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|193||&amp;lt;center&amp;gt;4D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;77&amp;lt;/center&amp;gt;||Powernaught Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|194||&amp;lt;center&amp;gt;4E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;78&amp;lt;/center&amp;gt;||Wizzowow Battery Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|195||&amp;lt;center&amp;gt;4F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;79&amp;lt;/center&amp;gt;||MightyMover Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|196||&amp;lt;center&amp;gt;50&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;80&amp;lt;/center&amp;gt;||Powernaught Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|197||&amp;lt;center&amp;gt;51&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;81&amp;lt;/center&amp;gt;||Wizzowow Fizzy Drink Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|198||&amp;lt;center&amp;gt;52&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;82&amp;lt;/center&amp;gt;||MightyMover Plastic Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|199||&amp;lt;center&amp;gt;53&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;83&amp;lt;/center&amp;gt;||Powernaught Plastic Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|200||&amp;lt;center&amp;gt;54&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;84&amp;lt;/center&amp;gt;||Wizzowow Plastic Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|201||&amp;lt;center&amp;gt;55&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;85&amp;lt;/center&amp;gt;||MightyMover Bubble Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|202||&amp;lt;center&amp;gt;56&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;86&amp;lt;/center&amp;gt;||Powernaught Bubble Truck&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|203||&amp;lt;center&amp;gt;57&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;87&amp;lt;/center&amp;gt;||Wizzowow Bubble Truck&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ships==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|204||&amp;lt;center&amp;gt;00&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;||MPS Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|205||&amp;lt;center&amp;gt;01&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;1&amp;lt;/center&amp;gt;||CS-Inc. Oil Tanker&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|206||&amp;lt;center&amp;gt;02&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2&amp;lt;/center&amp;gt;||MPS Passenger Ferry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|207||&amp;lt;center&amp;gt;03&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3&amp;lt;/center&amp;gt;||FFP Passenger Ferry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|208||&amp;lt;center&amp;gt;04&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4&amp;lt;/center&amp;gt;||Bakewell 300 Hovercraft&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|209||&amp;lt;center&amp;gt;05&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;5&amp;lt;/center&amp;gt;||Chugger-Chug Passenger Ferry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|210||&amp;lt;center&amp;gt;06&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;6&amp;lt;/center&amp;gt;||Shivershake Passenger Ferry&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|211||&amp;lt;center&amp;gt;07&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;7&amp;lt;/center&amp;gt;||Yate Cargo ship&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|212||&amp;lt;center&amp;gt;08&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;8&amp;lt;/center&amp;gt;||Bakewell Cargo ship&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|213||&amp;lt;center&amp;gt;09&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;9&amp;lt;/center&amp;gt;||Mightymover Cargo ship&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|214||&amp;lt;center&amp;gt;0A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||Powernaut Cargo ship&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Planes==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|215||&amp;lt;center&amp;gt;00&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;||Sampson U52&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|216||&amp;lt;center&amp;gt;01&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;1&amp;lt;/center&amp;gt;||Coleman Count&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|217||&amp;lt;center&amp;gt;02&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2&amp;lt;/center&amp;gt;||FFP Dart&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|218||&amp;lt;center&amp;gt;03&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3&amp;lt;/center&amp;gt;||Yate Haugan&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|219||&amp;lt;center&amp;gt;04&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4&amp;lt;/center&amp;gt;||Bakewell Cotswald LB-3&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|220||&amp;lt;center&amp;gt;05&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;5&amp;lt;/center&amp;gt;||Bakewell Luckett LB-8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|221||&amp;lt;center&amp;gt;06&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;6&amp;lt;/center&amp;gt;||Bakewell Luckett LB-9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|222||&amp;lt;center&amp;gt;07&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;7&amp;lt;/center&amp;gt;||Bakewell Luckett LB80&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|223||&amp;lt;center&amp;gt;08&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;8&amp;lt;/center&amp;gt;||Bakewell Luckett LB-10&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|224||&amp;lt;center&amp;gt;09&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;9&amp;lt;/center&amp;gt;||Bakewell Luckett LB-11&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|225||&amp;lt;center&amp;gt;0A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||Yate Aerospace YAC 1-11&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|226||&amp;lt;center&amp;gt;0B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||Darwin 100&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|227||&amp;lt;center&amp;gt;0C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||Darwin 200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|228||&amp;lt;center&amp;gt;0D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||Darwin 300&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|229||&amp;lt;center&amp;gt;0E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||Darwin 400&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|230||&amp;lt;center&amp;gt;0F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||Darwin 500&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|231||&amp;lt;center&amp;gt;10&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||Darwin 600&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|232||&amp;lt;center&amp;gt;11&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||Guru Galaxy&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|233||&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||Airtaxi A21&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|234||&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||Airtaxi A31&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|235||&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||Airtaxi A32&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|236||&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||Airtaxi A33&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|237||&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||Yate Aerospace YAe46&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|238||&amp;lt;center&amp;gt;17&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||Dinger 100&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|239||&amp;lt;center&amp;gt;18&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||AirTaxi A34-1000&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|240||&amp;lt;center&amp;gt;19&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||Yate Z-Shuttle&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|241||&amp;lt;center&amp;gt;1A&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||Kelling K1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|242||&amp;lt;center&amp;gt;1B&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||Kelling K6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|243||&amp;lt;center&amp;gt;1C&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||Kelling K7&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|244||&amp;lt;center&amp;gt;1D&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;29&amp;lt;/center&amp;gt;||Darwin 700&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|245||&amp;lt;center&amp;gt;1E&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;30&amp;lt;/center&amp;gt;||FFP Hyperdart 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|246||&amp;lt;center&amp;gt;1F&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;31&amp;lt;/center&amp;gt;||Dinger 200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|247||&amp;lt;center&amp;gt;20&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;32&amp;lt;/center&amp;gt;||Dinger 1000&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|248||&amp;lt;center&amp;gt;21&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;33&amp;lt;/center&amp;gt;||Ploddyphut 100&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|249||&amp;lt;center&amp;gt;22&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;34&amp;lt;/center&amp;gt;||Ploddyphut 500&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|250||&amp;lt;center&amp;gt;23&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;35&amp;lt;/center&amp;gt;||Flashbang X1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|251||&amp;lt;center&amp;gt;24&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;36&amp;lt;/center&amp;gt;||Juggerplane M1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|252||&amp;lt;center&amp;gt;25&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;37&amp;lt;/center&amp;gt;||Flashbang Wizzer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Helicopters==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!ID!!NFO ID!!NML ID!!Name&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|253||&amp;lt;center&amp;gt;26&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;38&amp;lt;/center&amp;gt;||Tricario Helicopter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|254||&amp;lt;center&amp;gt;27&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;39&amp;lt;/center&amp;gt;||Guru X2 Helicopter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|255||&amp;lt;center&amp;gt;28&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;40&amp;lt;/center&amp;gt;||Powernaut Helicopter&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3259</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3259"/>
		<updated>2012-08-02T08:16:21Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House properties */ Fix local_authority_impact description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| building_flags&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x2&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x2&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Callbacks for tiles are synchronised&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random animation&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3256</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3256"/>
		<updated>2012-07-31T19:06:04Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ Add 60+x vars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| building_flags&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x2&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x2&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Callbacks for tiles are synchronised&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random animation&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness increase of the city council, if the building is destroyed&lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_house_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses with a given ID on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_town&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| other_class_count_map&lt;br /&gt;
| ID of house defined in this NewGRF (0..255)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of houses, with the same class as the house with the given ID, on the whole map&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| SLOPE_XXX&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&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;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_ever&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot;&amp;gt;Cargo type should be from your cargo translation table. X- and y-offset are optional, if provided both must be in range -128..127. A station is considered nearby if the tile is in the station&#039;s acceptance area. This is the purpose of the x- and y-offset, as other tiles may have other stations nearby.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was accepted at a nearby station in the last month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_this_month&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station in this month, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_last_bigtick&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was ever accepted at a nearby station since the last periodic processing, which happens every 250 ticks. 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_nearby_watched&lt;br /&gt;
| cargo type, x- and y-offset &amp;lt;ref name=&amp;quot;cargo_accepted_nearby&amp;quot; /&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given cargo type was one of the cargo types that triggered the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;-callback (only during this callback), 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearest_house_matching_criterion&lt;br /&gt;
| radius (1..63) and criterion (SEARCH_HOUSE_BY_XXX, XXX = [&amp;lt;nowiki&amp;gt;ID | CLASS | GRFID&amp;lt;/nowiki&amp;gt;])&lt;br /&gt;
| 1..63, or 0 if not found&lt;br /&gt;
| Perform a circular search for a house matching either the id, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; or GRFID of this house, depending on the second parameter. The first parameter specifies the maximum search radius. Return value is the Manhattan distance of the closest matching house tile, or 0 if no match was found. Note that tiles of the originating house never match.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_id&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, or 0 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, X (0..255) if the tile contains old house type X, 256+X if the tile contains a house from this NewGRF with ID X, 512+X if the tile contains a house from a different NewGRF with ID X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_class&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0, or 256 .. 767&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile does not have a class (this includes all old house types), 256+X (X = 0..255) if the house has been defined by this NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X or 512+X if the house has been defined by a different NewGRF with &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; X.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_house_grfid&lt;br /&gt;
| x- and y-offset (both signed, range -8..7)&lt;br /&gt;
| -1, 0 or a GRFID&lt;br /&gt;
| Return value is -1 if the tile is not a house tile, 0 if the house tile contains an old house type, or else the GRFID of the NewGRF defining the house.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3255</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3255"/>
		<updated>2012-07-31T17:22:07Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* House variables */ Add information about 40+x vars&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| building_flags&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x2&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x2&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Callbacks for tiles are synchronised&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random animation&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness increase of the city council, if the building is destroyed&lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
==House 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;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&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;
| 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;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&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;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3254</id>
		<title>VariationalAction2/Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3254"/>
		<updated>2012-07-31T12:03:02Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: /* Current animation frame (46) */ Don&amp;#039;t confuse variables and properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!Version*!!Description&lt;br /&gt;
|-&lt;br /&gt;
|40||B||{{ottdp|0.6|2.5}}||Construction stage and pseudo-random values&lt;br /&gt;
|-&lt;br /&gt;
|41||B||{{ottdp|0.6|2.5}}||Age of the building in years (or, strictly speaking, the difference between the current year and the year the building was built). Returns 255 for buildings older than 255 years.&lt;br /&gt;
|-&lt;br /&gt;
|42||B||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Town zone where the building is situated.&lt;br /&gt;
|-&lt;br /&gt;
|43||B||{{ottdp|0.6|2.5}}||Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Building counts&lt;br /&gt;
|-&lt;br /&gt;
|45||B||{{ottdp|0.6|2.5|ttdprev=alpha 38}}||Town expansion bits&lt;br /&gt;
|-&lt;br /&gt;
|46||B||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Current animation frame&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.7|2.6|ottdrev=r14294|ttdprev=r2020}}||XY Coordinate of the building&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=alpha 56}}||Other building counts&lt;br /&gt;
|-&lt;br /&gt;
|61||D||{{ottdp|0.6|2.5|ttdprev=alpha 56}}||Other building counts&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Land info for nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|63||B||{{ottdp|0.7|2.6|ttdprev=r1665}}||Current animation frame of nearby house tiles&lt;br /&gt;
|-&lt;br /&gt;
|64||B||{{ottdp|1.2|2.6|ottdrev=r23070|ttdprev=r1672}}||Cargo acceptance history of nearby stations&lt;br /&gt;
|-&lt;br /&gt;
|65||B||{{ottdp|0.7|2.6|ottdrev=r13603|ttdprev=r2242}}||Distance of nearest house matching a given criterion&lt;br /&gt;
|-&lt;br /&gt;
|66||D||{{ottdp|1.0|2.6|ttdprev=r2246}}||Class and ID of nearby house tile&lt;br /&gt;
|-&lt;br /&gt;
|67||D||{{ottdp|1.0|2.6|ttdprev=r2246}}||GRFID of nearby house tile&lt;br /&gt;
|-&lt;br /&gt;
|80+x||||||None defined, and none ever will because town buildings don&#039;t have an internal structure. Trying to access these variables crashes TTD.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Specified version is earliest known to support the variable in its current form. Some variables may have been available earlier.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Construction stage and pseudo-random values (40) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bits!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0..1||Construction state: 0..2: various states of construction, 3: construction finished&lt;br /&gt;
|-&lt;br /&gt;
|2..3||A pseudo-random value. It isn&#039;t actually random, but is derived from the position of the building. Old buildings use this value to randomize their colors. TTDPatch has a better way to randomize things, but you can still use that value to mimic unpatched TTD behaviour. Note that adjacent tiles aren&#039;t guaranteed to have the same pseudo-random bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Town zone (42) ===&lt;br /&gt;
&lt;br /&gt;
Town zone where the building is situated. The value is between 0 and 4, where 0 is the outermost zone of the town. Smaller towns have fewer zones. Roads are plain in zone 0 and 1, paved in zone 2, have trees in zone 3 and streetlights in zone 4&lt;br /&gt;
&lt;br /&gt;
=== Building counts (44) ===&lt;br /&gt;
&lt;br /&gt;
Returns dword LLllCCcc, where cc means how many buildings of the current type can be found in the current town, while CC is the same for the whole map. ll and LL are similar to cc and CC, but contain the number of tiles that have the same class as the current one. For tiles that have no class, ll and LL are always zero. Overridden old types are considered to be the new type they were overridden with. During [[Callbacks#House construction check (17)|callback 17]], the current building isn&#039;t on the map yet, and therefore isn&#039;t counted. In other cases, the building count is at least one, since the current building is counted as well.&lt;br /&gt;
&lt;br /&gt;
=== Town expansion bits (45) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Set if TTD is currently creating a random town, clear otherwise. PLEASE NOTE: while TTD is generating a random town, town variables 82 (town population) and B6 (number of buildings) are incorrect. The population counter contains the population of buildings generated _yet_, which means the final value may be larger than you get. The building count variable, on the other hand, is surely higher than the final value will be. If you want to check these variables during [[Callbacks#House construction check (17)|callback 17]], you may need to check variable 45 as well and make adjustments if this bit is set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other bits are currently reserved for future use.&lt;br /&gt;
&lt;br /&gt;
=== Current animation frame (46) ===&lt;br /&gt;
&lt;br /&gt;
The current animation frame being displayed. If you don&#039;t use animation callbacks, it&#039;s between zero and the value set in property 1A. Animation callbacks can set this to anything between 0 and 127.&lt;br /&gt;
&lt;br /&gt;
Enabling animation on a house tile by setting properties 9, 1A and probably 1B ensures that variable 46 will indeed change with time, and the building is redrawn every time variable 46 changes. This means that you can use a VarAction2 to choose the current frame according to variable 46. Please note that this kind of animation needs more CPU time and more sprites, so you should prefer palette animation if possible.&lt;br /&gt;
&lt;br /&gt;
=== XY Coordinate of the building (47) ===&lt;br /&gt;
&lt;br /&gt;
The coordinate of the tile this part of the building is located. &amp;amp;nbsp;If the building is not yet constructed, like during [[Callbacks#House construction check (17)|callback 17]], the returned value will be the proposed location. &amp;amp;nbsp;The format of the var is YYYYXXXX.&lt;br /&gt;
&lt;br /&gt;
=== Other building counts (60, 61) ===&lt;br /&gt;
&lt;br /&gt;
For variable 60, the parameter is an old house type number. For variable 61, it is a new house type number defined in the current GRF file.&lt;br /&gt;
&lt;br /&gt;
These variables work like variable 44, but they count the given house type instead of the current one.&lt;br /&gt;
&lt;br /&gt;
Please note that, unlike random graphics, changes of deterministic building graphics don&#039;t automatically redraw the building (except when either the construction state or property 46 changes), resulting in temporary graphics glitches when a visible building changes its graphics. These glitches can be fixed by scrolling the building out of view, then back again.&lt;br /&gt;
&lt;br /&gt;
=== Land info for nearby tiles (62) ===&lt;br /&gt;
&lt;br /&gt;
This variable works exactly like [[VarAction2IndustryTiles#Land info of nearby tiles 60|var. 60 for industry tiles]], except that bit 0 of the &#039;&#039;&#039;bb&#039;&#039;&#039; part is undefined.&lt;br /&gt;
&lt;br /&gt;
=== Current animation frame of nearby house tiles (63) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. Although you can query a 16x16 area with these parameters, it&#039;s currently useless to use offsets other than -1, 0 and +1; if you query a tile that doesn&#039;t belong to the same building as the current tile, the result is meaningless. It may even be junk if the queried tile isn&#039;t a house tile at all.&lt;br /&gt;
&lt;br /&gt;
=== Cargo acceptance history of nearby stations (64) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is a cargo identifier. {{grfFrom|7}} If your GRF is version 7 or later and has a cargo translation table, this is an index to that table; otherwise, it&#039;s a cargo slot number. Additionally, GRF register 100h should contain an offset relative to the current tile (use 0 for the current tile). The lowest byte contains the signed X offset and the next higher byte the signed Y offset.&lt;br /&gt;
&lt;br /&gt;
The returned value looks like this:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit number!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||This cargo was accepted in a nearby station some time in the past&lt;br /&gt;
|-&lt;br /&gt;
|1||This cargo was accepted in a nearby station last month&lt;br /&gt;
|-&lt;br /&gt;
|2||This cargo was accepted in a nearby station this month&lt;br /&gt;
|-&lt;br /&gt;
|3||This cargo was accepted in a nearby station since the last periodic processing (which happens every 250 ticks)&lt;br /&gt;
|-&lt;br /&gt;
|4||This cargo is one of the types that triggered [[Callbacks#Watched_cargo_accepted_.28148.29|callback 148]] (only during callback 148)&lt;br /&gt;
|-&lt;br /&gt;
|other bits||undefined; reserved for future use&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A station is considered nearby if the selected tile is inside its acceptance area. That&#039;s why you can give an offset - other tiles of your multi-tile building may have different stations &amp;quot;nearby&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} The information required for this variable is stored in the station2 structure, and therefore works only if the station2 structure is present. The station2 structure is present if any of the following is true:&lt;br /&gt;
* Generalfixes is on, and miscmods.noextendstationrange is off&lt;br /&gt;
* Any of fifoloading, newcargos or irregularstations is on&lt;br /&gt;
&lt;br /&gt;
If the station2 structure isn&#039;t present, the returned value is always zero.&lt;br /&gt;
&lt;br /&gt;
=== Distance of nearest house matching a given criterion (65) ===&lt;br /&gt;
&lt;br /&gt;
This will perform a circular search around the current tile, trying to find another house tile that will match the same type, class or GRFID. (Note: other tiles of the originating house will not match.) &amp;amp;nbsp;Search result will be the [http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] between both tiles or 0, if no house tile matching the given criteria has been found.&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
Bits 0..5 indicate the radius of the search going to be performed (given in Manhattan metric). Maximum search radius is 63 while the minimum is 1. A radius of 0 is considered reserved - do not use.&lt;br /&gt;
&lt;br /&gt;
Bits 6..7 indicate the type of search to be carried out:&lt;br /&gt;
&lt;br /&gt;
0 : Search by house type as defined in the grf file&lt;br /&gt;
&lt;br /&gt;
1 : Search by building class&lt;br /&gt;
&lt;br /&gt;
2 : Search by GRFID&lt;br /&gt;
&lt;br /&gt;
Just like other search variables, be aware that this is a CPU intensive one&lt;br /&gt;
&lt;br /&gt;
=== Class and ID of nearby house tile (66) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. The returned value is structured like this:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!High word!!Information about house class&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;FFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;0000h&#039;&#039;&#039; if the selected house doesn&#039;t have a class specified (including old houses, which cannot have a class)&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;01XXh&#039;&#039;&#039; if the selected house has been defined in the current GRF with class XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;02XXh&#039;&#039;&#039; if the selected house has been defined in a different GRF with class XX&lt;br /&gt;
|-&lt;br /&gt;
!Low word!!Information about house ID&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;FFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;00XXh&#039;&#039;&#039; if the selected house is old house type XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;01XXh&#039;&#039;&#039; if the selected house has been defined in the current GRF with ID XX&lt;br /&gt;
|-&lt;br /&gt;
|||&#039;&#039;&#039;02XXh&#039;&#039;&#039; if the selected house has been defined in a different GRF with ID XX&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case the selected house comes from another GRF, you need to use variable 67 (see below) to find out the corresponding GRFID and identify the exact type of the house. Please note that variable 67 is cheaper to calculate than this one, so if you are looking for a specific GRFID/houseID combination, you should try matching the GRFID first, and get variable 66 only if the GRFID matches.&lt;br /&gt;
&lt;br /&gt;
=== GRFID of nearby house tile (67) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the position of the current tile. The low nibble contains the signed X offset (that is 0h=0, 1h=+1 ... 7h=+7; 8h=-8, 9h=-7 ... Fh=-1), the high nibble contains the Y offset. The returned value is one of the following:&lt;br /&gt;
* &#039;&#039;&#039;FFFFFFFFh&#039;&#039;&#039; if the selected tile isn&#039;t a house tile&lt;br /&gt;
* &#039;&#039;&#039;00000000h&#039;&#039;&#039; if the selected house is an old house type&lt;br /&gt;
* otherwise, the GRFID of the GRF which defined the type of the selected house&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3253</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=3253"/>
		<updated>2012-07-29T20:28:18Z</updated>

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

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

		<summary type="html">&lt;p&gt;Hirundo: Update list of command-line options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
&lt;br /&gt;
NML is a a python-based compiler, capable to compile NML files (along with their associated language, sound and graphic files) into grf and / or nfo files. Windows users can install the [http://bundles.openttdcoop.org/nml/nightlies/LATEST/ windows binary] which contains a binary which bundles all required libraries. Users on other OS need to install them separately, best by means of their packet manager. In order to work, the following items are required:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;python&#039;&#039;&#039;&lt;br /&gt;
** any version from 2.5 through 2.7 will do, but not 3.x&lt;br /&gt;
** downloadable from from http://www.python.org/)&lt;br /&gt;
** Advise for windows users: apparently you can prevent a lot of problems by installing the 32bit version of python, even if you have a 64bit windows installation. Installing PIL might be troublesome if you do install the 64bit version of python.&lt;br /&gt;
* &#039;&#039;&#039;python image library&#039;&#039;&#039;&lt;br /&gt;
** downloadable from http://www.pythonware.com/products/pil/&lt;br /&gt;
* &#039;&#039;&#039;ply&#039;&#039;&#039;&lt;br /&gt;
** downloadable from http://www.dabeaz.com/ply/&lt;br /&gt;
* &#039;&#039;&#039;NML itself&#039;&#039;&#039;&lt;br /&gt;
** the latest (nightly) build can be downloaded from http://bundles.openttdcoop.org/nml/nightlies/LATEST/&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t install these with the packet manager of your choice (or there is none like on windows and you don&#039;t use the pre-compiled binary file), you should install these libraries as well as NML itself using &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;python setup.py install&amp;lt;/code&amp;gt; from your command prompt.&lt;br /&gt;
&lt;br /&gt;
OS X users have two choices: install the dependencies manually as described above, for use with the python version that ships with OS X. Or install everything from macports, including a new python version (using macports eases upgrading).  However using macports to install the dependencies for the bundled system python is likely to fail.&lt;br /&gt;
&lt;br /&gt;
To verify that everything is installed, enter &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc --version&amp;lt;/code&amp;gt; in your command line. This should output the version of NML as well as the version of the installed libraries.&lt;br /&gt;
&lt;br /&gt;
Examples for small NML &amp;quot;projects&amp;quot; are found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;examples&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;regression&amp;lt;/code&amp;gt; folder of NML. Generally it&#039;s assumed that the language files are in a separate language folder &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt;, thus a simple project may look like this:&lt;br /&gt;
&lt;br /&gt;
 mynewgrf.nml&lt;br /&gt;
 graphics.png&lt;br /&gt;
 funny_sound.wav&lt;br /&gt;
 &lt;br /&gt;
 lang/english.lng&lt;br /&gt;
&lt;br /&gt;
The compiler itself &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc&amp;lt;/code&amp;gt; is a command line tool and can take a number of parameters, at least the nml filename which it shall process, e.g. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc mynewgrf.nml&amp;lt;/code&amp;gt; will compile your nml file into the grf-file &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mynewgrf.grf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The full syntax is:&lt;br /&gt;
&lt;br /&gt;
 Usage: nmlc [options] &amp;lt;filename&amp;gt;&lt;br /&gt;
 Where &amp;lt;filename&amp;gt; is the nml file to parse&lt;br /&gt;
 &lt;br /&gt;
 Options:&lt;br /&gt;
  --version             show program&#039;s version number and exit&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -d, --debug           write the AST to stdout&lt;br /&gt;
  -s, --stack           Dump stack when an error occurs&lt;br /&gt;
  --grf=&amp;lt;file&amp;gt;          write the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --md5=&amp;lt;file&amp;gt;          Write an md5sum of the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --nfo=&amp;lt;file&amp;gt;          write nfo output to &amp;lt;file&amp;gt;&lt;br /&gt;
  -M                    output a rule suitable for make describing the&lt;br /&gt;
                        graphics dependencies of the main grf file (requires&lt;br /&gt;
                        input file or --grf)&lt;br /&gt;
  --MF=&amp;lt;file&amp;gt;           When used with -M, specifies a file to write the&lt;br /&gt;
                        dependencies to&lt;br /&gt;
  --MT=&amp;lt;file&amp;gt;           target of the rule emitted by dependency generation&lt;br /&gt;
                        (requires -M)&lt;br /&gt;
  -c                    crop extraneous transparent blue from real sprites&lt;br /&gt;
  -u                    save uncompressed data in the grf file&lt;br /&gt;
  --nml=&amp;lt;file&amp;gt;          write optimized nml to &amp;lt;file&amp;gt;&lt;br /&gt;
  -o &amp;lt;file&amp;gt;, --output=&amp;lt;file&amp;gt;&lt;br /&gt;
                        write output(nfo/grf) to &amp;lt;file&amp;gt;&lt;br /&gt;
  -t &amp;lt;file&amp;gt;, --custom-tags=&amp;lt;file&amp;gt;&lt;br /&gt;
                        Load custom tags from &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        custom_tags.txt]&lt;br /&gt;
  -l &amp;lt;dir&amp;gt;, --lang-dir=&amp;lt;dir&amp;gt;&lt;br /&gt;
                        Load language files from directory &amp;lt;dir&amp;gt; [default:&lt;br /&gt;
                        lang]&lt;br /&gt;
  --default-lang=&amp;lt;file&amp;gt;&lt;br /&gt;
                        The default language is stored in &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        english.lng]&lt;br /&gt;
  --start-sprite=&amp;lt;num&amp;gt;  Set the first sprite number to write (do not use&lt;br /&gt;
                        except when you output nfo that you want to include in&lt;br /&gt;
                        other files)&lt;br /&gt;
  -p &amp;lt;palette&amp;gt;, --palette=&amp;lt;palette&amp;gt;&lt;br /&gt;
                        Force nml to use the palette &amp;lt;pal&amp;gt; [default: ANY].&lt;br /&gt;
                        Valid values are &#039;DOS&#039;, &#039;WIN&#039;, &#039;ANY&#039;&lt;br /&gt;
  --quiet               Disable all warnings. Errors will be printed normally.&lt;br /&gt;
  -n, --no-cache        Disable caching of sprites in .cache[index] files,&lt;br /&gt;
                        which may reduce compilation time.&lt;br /&gt;
&lt;br /&gt;
== Installing manually ==&lt;br /&gt;
We assume that you have a python setup (2.5 ... 2.7) where the distutils are available so that setup.py can be executed. You&#039;ll additionally need a gcc compiler in your path. On linux it is strongly recommended to use your package manager to install these packages.&lt;br /&gt;
&lt;br /&gt;
=== Install PLY ===&lt;br /&gt;
This is easy. Get the library from the link as mentioned above.&lt;br /&gt;
Install it from the unpacked PLY directory via&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=== Install the Python Imaging Library (PIL) ===&lt;br /&gt;
Get the library from the above mentioned link (the source kit for PIL 1.1.7). From the PIL source directory, test the setup for all available dependencies:&lt;br /&gt;
 python setup.py build_ext -i&lt;br /&gt;
You should get an output like which concludes with a summary of the available dependencies:&lt;br /&gt;
 PIL 1.1.7 SETUP SUMMARY&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- TKINTER support available&lt;br /&gt;
 --- JPEG support available&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support available&lt;br /&gt;
 --- FREETYPE2 support available&lt;br /&gt;
 --- LITTLECMS support available&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
If you&#039;re missing zlib or jpeg support, install those libraries, too.&lt;br /&gt;
&lt;br /&gt;
If that build shows everything available, test the setup:&lt;br /&gt;
 python selftest.py&lt;br /&gt;
A successful selftest will result in&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 PIL 1.1.7 TEST SUMMARY &lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Python modules loaded from ./PIL&lt;br /&gt;
 Binary modules loaded from ./PIL&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- PIL CORE support ok&lt;br /&gt;
 --- TKINTER support ok&lt;br /&gt;
 --- JPEG support ok&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support ok&lt;br /&gt;
 --- FREETYPE2 support ok&lt;br /&gt;
 --- LITTLECMS support ok&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Running selftest:&lt;br /&gt;
 --- 57 tests passed.&lt;br /&gt;
If all is successful, finally install the library:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=== Install NML ===&lt;br /&gt;
Now, that you have installed ply and pil, then you can install NML from the unpacked nml directory:&lt;br /&gt;
 sudo python setup.py install&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3249</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3249"/>
		<updated>2012-07-22T21:18:37Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Restore navbar as well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| building_flags&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x2&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x2&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Callbacks for tiles are synchronised&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random animation&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness increase of the city council, if the building is destroyed&lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
==House variables==&lt;br /&gt;
&lt;br /&gt;
House variables are not yet implemented in NML&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3248</id>
		<title>NML:Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3248"/>
		<updated>2012-07-22T21:17:16Z</updated>

		<summary type="html">&lt;p&gt;Hirundo: Restore accidentally removed callback information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==House 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house 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;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces. This will cause your house to be placed instead of the default house. This is ignored, if the default house has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| building_flags&lt;br /&gt;
| bitmask(HOUSE_FLAG_XXX,...)&lt;br /&gt;
|&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x1&lt;br /&gt;
;HOUSE_FLAG_SIZE_1x2&lt;br /&gt;
;HOUSE_FLAG_SIZE_2x2&lt;br /&gt;
;HOUSE_FLAG_NOT_SLOPED&lt;br /&gt;
:Can only be built on flat terrain&lt;br /&gt;
;HOUSE_FLAG_ANIMATE&lt;br /&gt;
:Enable animation&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Callbacks for tiles are synchronised&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random animation&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pax_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Can be increased in steps of 0.125. A station accepts a cargo, if the combined acceptance of all houses in range is at least 1.&lt;br /&gt;
|-&lt;br /&gt;
| mail_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_acceptance&lt;br /&gt;
| 0 ... 1&lt;br /&gt;
| Like passenger acceptance. Additionally flag can be added which defines one of the cargo type&lt;br /&gt;
;HOUSE_ACCEPT_GOODS&lt;br /&gt;
;HOUSE_ACCEPT_FOOD&lt;br /&gt;
;HOUSE_ACCEPT_FIZZY_DRINKS&lt;br /&gt;
:FIZZY_DRINKS has in toyland the same meaning as FOOD in other climates.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargo&lt;br /&gt;
|&lt;br /&gt;
| up to three cargo labels, e.g. MAIL, PASS, COAL&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness increase of the city council, if the building is destroyed&lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 16 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&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;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 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;
| building_class&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
==House variables==&lt;br /&gt;
&lt;br /&gt;
House variables are not yet implemented in NML&lt;br /&gt;
&lt;br /&gt;
==House 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 house 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&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&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;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code&amp;gt;building_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;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&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&amp;gt;accepted_cargo&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 the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&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;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount&lt;br /&gt;
| Called every 256 ticks. Called multiple times until 0x20FF is returned. The high byte of the result contains a cargo type, the low byte contains the amount of that cargo to produce. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&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;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hirundo</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3247</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=3247"/>
		<updated>2012-07-22T16:12:09Z</updated>

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