<?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=Rito12</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=Rito12"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Rito12"/>
	<updated>2026-07-07T01:19:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5272</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5272"/>
		<updated>2026-06-09T21:20:06Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Road stop properties */ Fix some value ranges.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| cargo bitmask&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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_ROAD_STOP_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Company number of the roadstop owner.&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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| If nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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 = [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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Animation_speed&amp;diff=5271</id>
		<title>NML:Animation speed</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Animation_speed&amp;diff=5271"/>
		<updated>2026-06-09T20:25:01Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Fix: &amp;#039;as&amp;#039; and &amp;#039;length&amp;#039; used twice in single sentence.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavAdditionalreferences}}&lt;br /&gt;
&lt;br /&gt;
House, industry and airport tiles can define an animation speed. This property gives the animation speed in ticks, spaced by powers of two. For houses the minimum value is 2 (=4 ticks). Both the ingame and real lengths are given as rounded values for reference only, assuming normal game speed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! animation&amp;lt;br /&amp;gt;length in ticks&lt;br /&gt;
! ingame&lt;br /&gt;
! real time&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
|&lt;br /&gt;
| 0.03 s&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
| 0.06 s&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 4&lt;br /&gt;
|&lt;br /&gt;
| 0.11 s&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 8&lt;br /&gt;
|&lt;br /&gt;
| 0.22 s&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 16&lt;br /&gt;
|&lt;br /&gt;
| 0.45 s&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 32&lt;br /&gt;
| half a day&lt;br /&gt;
| 0.9 s&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 64&lt;br /&gt;
| nearly 1 day&lt;br /&gt;
| 1.8 s&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 128&lt;br /&gt;
| 2 days&lt;br /&gt;
| 3½ s&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 256&lt;br /&gt;
| 3½ days&lt;br /&gt;
| 7 s&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 512&lt;br /&gt;
| 7 days&lt;br /&gt;
| 15 s&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 1024&lt;br /&gt;
| 14 days&lt;br /&gt;
| 30 s&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 2048&lt;br /&gt;
| 28 days&lt;br /&gt;
| 1 min&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 4096&lt;br /&gt;
| 55 days&lt;br /&gt;
| 2 min&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 8192&lt;br /&gt;
| 3½ months&lt;br /&gt;
| 4 min&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 16384&lt;br /&gt;
| 7½ months&lt;br /&gt;
| 7½ min&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| 32768&lt;br /&gt;
| 15 months&lt;br /&gt;
| 15 min&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 65536&lt;br /&gt;
| 2½ years&lt;br /&gt;
| 30 min&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5270</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5270"/>
		<updated>2026-06-09T15:44:16Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Road stop callbacks */ CB_RESULT_CB_RESULT_START_ANIMATION is wrong.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Company number of the roadstop owner.&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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| If nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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 = [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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Parameter_assignment&amp;diff=5269</id>
		<title>NML:Parameter assignment</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Parameter_assignment&amp;diff=5269"/>
		<updated>2026-06-08T09:14:23Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Named parameters and constants.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&lt;br /&gt;
 param[&amp;amp;lt;expression&amp;amp;gt;] = &amp;amp;lt;expression&amp;amp;gt;;&lt;br /&gt;
&lt;br /&gt;
Set a parameter to the given [[NML:Block syntax#Syntax|expression]]. Neither of the two expressions has to be constant, the following is perfectly valid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[param[2] + 1] = param[3] * param[4];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Parameters can also be named, then it is possible to access them by that name instead of index.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 custom_bit_mask = add_trains + (add_planes &amp;lt;&amp;lt; 1);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When assigning value to named parameter that has not been used/defined earlier it is given an unused index, therefore it is better not to mix named parameters with unnamed ones in one grf.&lt;br /&gt;
&lt;br /&gt;
==Compile time values==&lt;br /&gt;
&lt;br /&gt;
Since {{nml|0.7.6}} it is possible to create user defined constants. They work the same way as default ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 const &amp;lt;expression&amp;gt; = &amp;lt;expression&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 const CC_WEIRD = 12;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is adviced to use screaming snake case for constants to distinguish them from runtime expressions.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=5268</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=5268"/>
		<updated>2026-06-08T07:22:04Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables without a parameter */ It is station not vehicle.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Since {{ottd|15.0}} {{nml|0.7.6}} it is possible to register up to 256 tile types.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15.0}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles &amp;lt;br&amp;gt;&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated since &#039;&#039;&#039;{{nml|0.7.6}}&#039;&#039;&#039; , replaced by &#039;&#039;&#039;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_flags&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_ALL_TILES&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_PERIMETER {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;perimeter&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
:Since {{ottd|16.0}} if &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA&amp;lt;/code&amp;gt; is also set it does not do anything.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA {{ottd|16.0}} {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;area&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Deprecated since {{nml|0.9.0}}.&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(STAT_ANIM_XXX, ANIM_TRIGGER_STAT_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TILELOOP&lt;br /&gt;
:Tile is processed in the periodic processing loop&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TRAIN_RESERVES&lt;br /&gt;
:Train reserves platform (using PBS)&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| tile_flags&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(STAT_TILE_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.7.6}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
; PYLON&lt;br /&gt;
: Draw pylon on tile with that type.&lt;br /&gt;
; NOWIRE&lt;br /&gt;
: Hide wire on tile with that type.&lt;br /&gt;
; BLOCKED&lt;br /&gt;
: Do not allow trains to enter tile with that type.&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the station.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this station (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the station tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the station being bridgeable.&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
;CORNER_W : Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
;CORNER_S : Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
;CORNER_E : Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
;CORNER_N : Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
;EDGE_NE : Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
;EDGE_SE : Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
;EDGE_SW : Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
;EDGE_NW : Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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;wikitable sortable&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;wikitable sortable&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;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&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 station 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;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station 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;wikitable sortable&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_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&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_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&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 [[#Station_sections|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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the rail station has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
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 cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
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;wikitable sortable&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;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, even values up to FE can be returned as long as the tile is defined.&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 24, 8)&amp;lt;/code&amp;gt;: Original tile type in static layout.&lt;br /&gt;
&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5267</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5267"/>
		<updated>2026-06-08T07:21:06Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables without a parameter */ TTDP does not support roadstops at all, and probably will never do.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Company number of the roadstop owner.&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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| If nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5266</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5266"/>
		<updated>2026-06-08T07:20:01Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables without a parameter */  It is roadstop not vehicle.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| Company number of the roadstop 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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| If nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5265</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5265"/>
		<updated>2026-06-07T16:33:17Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require one or more parameters */ Is should be If&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| 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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| If nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Stations&amp;diff=5264</id>
		<title>VariationalAction2/Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Stations&amp;diff=5264"/>
		<updated>2026-06-05T16:45:15Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Description */ add var 6B&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Rail stations share a number of variables with airports. The common variables are documented on a [[VariationalAction2/BaseStation|separate page]]&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Version!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!Description&lt;br /&gt;
|-&lt;br /&gt;
|10||{{ottdp|0.7|2.5}}||D||Additional information for sprite selection - see [[Action0/Stations#General_Flags_.2813.29|General station flags]] and [[AdvancedSpriteLayout]]&lt;br /&gt;
|-&lt;br /&gt;
|40||{{ottdp|0.6|2.5}}||D||Platform info and relative position&lt;br /&gt;
|-&lt;br /&gt;
|41||{{ottdp|0.6|2.5}}||D||Platform info and relative position for individually built sections&lt;br /&gt;
|-&lt;br /&gt;
|42||{{ottdp|0.6|2.5}}||D||Terrain and track type&lt;br /&gt;
|-&lt;br /&gt;
|43 &amp;lt;ref&amp;gt;{{ottdp|1.2|2.5|ottdrev=r22848|ttdprev=2.5 beta 2}} Available in the purchase list as well.&amp;lt;/ref&amp;gt;||{{ottdp|1.2|2.5|ottdrev=r22848}}||D||Player info, see [[VarAction2Vehicles#Player info (43)|vehicle variable 43]]&lt;br /&gt;
|-&lt;br /&gt;
|44||{{ottdp|0.7|2.5}}||B||Path-based signalling info&lt;br /&gt;
|-&lt;br /&gt;
|45||{{ottdp|0.6|2.5}}||W||Rail continuation info&lt;br /&gt;
|-&lt;br /&gt;
|46,47||{{ottdp|0.6|2.5}}||D||Platform info, counted from the middle&lt;br /&gt;
|-&lt;br /&gt;
|48|| || ||See [[VariationalAction2/BaseStation|Base Stations]].&lt;br /&gt;
|-&lt;br /&gt;
|49||{{ottdp|0.6|2.5}}||D||Platform info and relative position of same-direction section&lt;br /&gt;
|-&lt;br /&gt;
|4A||{{ottdp|0.7|2.5}}||B||Current animation frame&lt;br /&gt;
|-&lt;br /&gt;
|60-65|| || ||See [[VariationalAction2/BaseStation|Base Stations]].&lt;br /&gt;
|-&lt;br /&gt;
|66||{{ottdp|0.6|2.5}}||D||Animation frame of nearby tile&lt;br /&gt;
|-&lt;br /&gt;
|67||{{ottdp|0.6|2.6}}||D||Land info of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|68||{{ottdp|0.6|2.6}}||D||Station info of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|69|| || ||See [[VariationalAction2/BaseStation|Base Stations]].&lt;br /&gt;
|-&lt;br /&gt;
|6A||{{ottdp|1.10|no|ottdrev=5df01bf}}||D||GRFID of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|6B||{{ottdp|14.0|no|ottdrev=8d62a8f}}||D||16-bit station ID of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|80||{{ottdp|no|no}} &amp;lt;ref&amp;gt;Works in TTDPatch for sufficiently small stations.&amp;lt;/ref&amp;gt;||B||Number and length of train platforms&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_StationArray TTD station structure]. Note that you have to subtract 0x10 from the offsets there, or else the facility bit mask and construction date would not be accessible; instead you lose access to variables 00..0F which are meaningless anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: Please do not use variables 8C..EB directly. The meaning of these variables changes if the newcargos switch is on. Use the variables 60..64 instead (see below). Those always work correctly.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
=== Platform info (40, 41, 46, 47, 49) ===&lt;br /&gt;
&lt;br /&gt;
Variables 40, 41, 46, 47 and 49 all return information about the current tile, which platform it is on and how far along the platform. The difference is in the section of the station that they consider.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variables!!Regular station!!Irregular station&lt;br /&gt;
|-&lt;br /&gt;
|40, 46||Whole station||Counting entire length and all adjacent platforms&lt;br /&gt;
|-&lt;br /&gt;
|41, 47||Individually built sections||&lt;br /&gt;
|-&lt;br /&gt;
|49||Whole station||Counting length and platforms that have the same direction&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;counting&amp;quot; here refers to starting at the tile in question, and counting tiles in all four directions. The two directions aligned with the station direction will be the length of the station, and the other two directions give the number of platforms. For variables 40 and 46, this counting stops at the edge of the station, i.e. the first non-station tile. For variable 49, it stops either at the edge, or at a station tile that is in the wrong direction. &amp;amp;nbsp;The resulting information is probably not really useful in the case of irregular stations, with the exception of edge detection. To correctly detect edges, you have the choice of either the station-&amp;amp;gt;non-station transition (vars. 40, 46), or additional an opposite-direction transition (var. 49).&lt;br /&gt;
&lt;br /&gt;
Variable 41 is largely unaffected by irregular stations, because it only refers to individually built sections. However, when these individual sections are built over existing tiles, the var. 41 information of surrounding tiles changes as well, due to an internal limitation in how it is stored.&lt;br /&gt;
&lt;br /&gt;
For variables 40, 41 and 49, the position is counted from the northern most edge of the station, and returned in the form TNLcCpP, where:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Bits!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|T||8||Tile type: the current tile type/layout&lt;br /&gt;
{{ottdp|no|}} In TTDPatch this information is only available during callback 14 (and via variable 10 during callback 24).&lt;br /&gt;
|-&lt;br /&gt;
|N||4||Total number of platforms&lt;br /&gt;
|-&lt;br /&gt;
|L||4||Total platform length&lt;br /&gt;
|-&lt;br /&gt;
|c||4||Platform number current being drawn, counted from the end (starting at zero)&lt;br /&gt;
|-&lt;br /&gt;
|C||4||Platform number currently being drawn (starting from zero)&lt;br /&gt;
|-&lt;br /&gt;
|p||4||Position along this platform counted from the end, zero at the end&lt;br /&gt;
|-&lt;br /&gt;
|P||4||Position along this platform, zero at the beginning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;beginning&amp;quot; of a station is its northern-most (up on the screen) tile, and the &amp;quot;end&amp;quot; is the southern-most (down on the screen) tile. Each variable consists of 4 bits.&lt;br /&gt;
&lt;br /&gt;
For variables 46 and 47, the position is counted from the middle, i.e. the center tile has C=0 and P=0. For even lengths and numbers of platforms, the middle tile is at position L/2 resp. N/2, e.g. for length 6, it is tile 3, which is the fourth tile. The return format is xTNLxxCP, where T, N and L are as above, and C and P are the positions counted from the middle.&lt;br /&gt;
&lt;br /&gt;
Since C and P can have negative numbers, here&#039;s how this is encoded:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Hex!!Binary!!Decimal&lt;br /&gt;
|-&lt;br /&gt;
|0||0000||0&lt;br /&gt;
|-&lt;br /&gt;
|1||0001||1&lt;br /&gt;
|-&lt;br /&gt;
|7||0111||7&lt;br /&gt;
|-&lt;br /&gt;
|8||1000||-8&lt;br /&gt;
|-&lt;br /&gt;
|9||1001||-7&lt;br /&gt;
|-&lt;br /&gt;
|E||1110||-2&lt;br /&gt;
|-&lt;br /&gt;
|F||1111||-1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The counting goes like this, preferring an extra negative number for an even count (because there are 8 negative numbers available but only 7 positive ones):&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Count!!Numbers&lt;br /&gt;
|-&lt;br /&gt;
|1||&amp;lt;pre&amp;gt;          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|2||&amp;lt;pre&amp;gt;      -1  0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3||&amp;lt;pre&amp;gt;      -1  0  1&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4||&amp;lt;pre&amp;gt;   -2 -1  0  1&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|5||&amp;lt;pre&amp;gt;   -2 -1  0  1  2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|6||&amp;lt;pre&amp;gt;-3 -2 -1  0  1  2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(etc.)&lt;br /&gt;
&lt;br /&gt;
=== Terrain and track type (42) ===&lt;br /&gt;
&lt;br /&gt;
Variable 42 is of the format xxxxttTT, where TT is the terrain type and tt is the (translated) railway track type.&lt;br /&gt;
&lt;br /&gt;
They can have the following values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!TT!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||normal (grass)&lt;br /&gt;
|-&lt;br /&gt;
|1||desert&lt;br /&gt;
|-&lt;br /&gt;
|2||rainforest&lt;br /&gt;
|-&lt;br /&gt;
|4||on or above snowline&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no railtype translation table is present in the GRF, then the default translation table is used:&lt;br /&gt;
{| |-&lt;br /&gt;
!tt!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|00||railroad, regular&lt;br /&gt;
|-&lt;br /&gt;
|01||railroad, electrified&lt;br /&gt;
|-&lt;br /&gt;
|02||monorail&lt;br /&gt;
|-&lt;br /&gt;
|03||maglev&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the railtype is not present in the table, then tt returns FF.&lt;br /&gt;
&lt;br /&gt;
=== Path-based signalling info (44) ===&lt;br /&gt;
&lt;br /&gt;
This returns the following value in bits 0-2: (bit 2 only available from alpha 47 and up)&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!State!!Value (binary)!!Value (decimal)&lt;br /&gt;
|-&lt;br /&gt;
|Reserved||111||7&lt;br /&gt;
|-&lt;br /&gt;
|Not reserved||100||4&lt;br /&gt;
|-&lt;br /&gt;
|No PBS||010||2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At the moment, PBS on/off refers to the switch setting, in a future alpha version it will actually refer to whether the switch is on &#039;&#039;and&#039;&#039; the current block actually uses PBS.&lt;br /&gt;
&lt;br /&gt;
The bits are defined this way to allow easy fallback to non-PBS cases. If you need graphics to show the &amp;quot;unreserved&amp;quot; state in non-PBS cases, use bit 0, but if you need the &amp;quot;reserved&amp;quot; state in non-PBS cases, use bit 1. To explicitly check whether PBS is active or not, use bit 2.&lt;br /&gt;
&lt;br /&gt;
All other bits are reserved and must be masked out.&lt;br /&gt;
&lt;br /&gt;
=== Rail continuation info (45) ===&lt;br /&gt;
&lt;br /&gt;
This variable returns 16 bits of info whether the rail tracks continue in the eight tiles adjacent to the station tile.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Set if rail continues in direction of...&lt;br /&gt;
|-&lt;br /&gt;
|0||01||+Length&lt;br /&gt;
|-&lt;br /&gt;
|1||02||-Length&lt;br /&gt;
|-&lt;br /&gt;
|2||04||+Platforms&lt;br /&gt;
|-&lt;br /&gt;
|3||08||-Platforms&lt;br /&gt;
|-&lt;br /&gt;
|4||10||+Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|5||20||-Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|6||40||+Length, -Platforms&lt;br /&gt;
|-&lt;br /&gt;
|7||80||-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;
Bits 0 to 3 are set if there is track on the given tile, and it has a connection to the station tile. For bits 2, 3, the station of course has itself no connection to those tiles, but this doesn&#039;t matter for this variable. Bits 4 to 7 check connections to the neighbouring platform tile, i.e. bits 4 and 5 resp. 6 and 7 indicate a connection from that tile to tile 2 resp. 3. (This has changed again with 2.5 beta 4 r325.)&lt;br /&gt;
&lt;br /&gt;
Bits 8..15 repeat the above, but are set if there are any train tracks on the tile and disregard whether the track is connected to the station or not entirely.&lt;br /&gt;
&lt;br /&gt;
=== Animation frame of nearby tile (66) ===&lt;br /&gt;
&lt;br /&gt;
(From TTDPatch 2.5 beta 5)&lt;br /&gt;
&lt;br /&gt;
The parameter defines the offset relative to the current tile. Both nibbles are considered signed (that is, 8h=-8, 9h=-7, ...., Fh=-1, 0h=0, 1h=1, ..., 7h=7). The high nibble contains the amount to move sideways (between platforms), the low one is the amount to move along the platform. Negative offsets move northwards, positive ones southwards. If the selected tile is a rail station tile that belongs to the current station, its animation state is returned. Otherwise, FFFFFFFFh is returned.&lt;br /&gt;
&lt;br /&gt;
=== Land info of nearby tiles (67) ===&lt;br /&gt;
&lt;br /&gt;
This variable works like [[VarAction2IndustryTiles#Land_info_of_nearby_tiles_60_|industry tile variable 60]], except for three things:&lt;br /&gt;
* The offsets in the parameter are interpreted relatively to the alignment of the station, the same way as for variable 66&lt;br /&gt;
* The &#039;&#039;&#039;ss&#039;&#039;&#039; part is &amp;quot;mirrored&amp;quot; (bit 0 and 2 swapped) for the NW-SE orientation; this will allow you to handle analogous slopes of the two orientations without checking the orientation explicitly (since TTDPatch 2.6 r1693)&lt;br /&gt;
* Bit 0 of the &#039;&#039;&#039;bb&#039;&#039;&#039; part is undefined&lt;br /&gt;
&lt;br /&gt;
=== Station info of nearby tiles (68) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable works the same way as the parameter of variable 66. The returned value is FFFFFFFFh if the selected tile isn&#039;t a railway station tile. Otherwise, the returned value can be separated to the following parts:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bits!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0..7||If the tile is defined in the current GRF, this is the setID used in the definition. Otherwise, the content is undefined.&lt;br /&gt;
|-&lt;br /&gt;
|8..9||0 - the tile uses original TTD graphics&lt;br /&gt;
&lt;br /&gt;
1 - the tile is defined in the current GRF&lt;br /&gt;
&lt;br /&gt;
2 - the tile is defined in another GRF&lt;br /&gt;
|-&lt;br /&gt;
|10||set if the selected tile belongs to the current station, clear otherwise&lt;br /&gt;
|-&lt;br /&gt;
|11||clear if the selected tile is parallel with the current one, set if perpendicular to it&lt;br /&gt;
|-&lt;br /&gt;
|12..13||0 - plain platform&lt;br /&gt;
&lt;br /&gt;
1 - platform with building&lt;br /&gt;
&lt;br /&gt;
2 - platform with roof, left side&lt;br /&gt;
&lt;br /&gt;
3 - platform with roof, right side&lt;br /&gt;
|-&lt;br /&gt;
|14..31||Undefined, reserved for future use&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GRFID of nearby station tile (6A) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable works the same way as the parameter of variable 66.&lt;br /&gt;
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 station tile&lt;br /&gt;
* &#039;&#039;&#039;00000000h&#039;&#039;&#039; if the selected station is a default station (no NewGRF station)&lt;br /&gt;
* otherwise, the GRFID of the GRF which defined the type of the selected station&lt;br /&gt;
&lt;br /&gt;
=== Station id of nearby tiles (6B) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable works the same way as the parameter of variable 66. The returned value is 0xFFFFFFFF if the selected tile isn&#039;t a railway station tile and 0xFFFE if it is from another grf. Otherwise, the returned value is a 16 bit station id.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryTiles&amp;diff=5263</id>
		<title>NML:IndustryTiles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryTiles&amp;diff=5263"/>
		<updated>2026-06-05T10:45:30Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Industry tile callbacks */ var 18 bit 8&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on industry tile properties, variables and callbacks. [[NML:Industries|Industries]] are closely related.&lt;br /&gt;
&lt;br /&gt;
== Industry tile ID allocation ==&lt;br /&gt;
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 [[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 tile properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039; 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;
{{nml|0.5}} {{ottdp|1.9|no}}Array with up to 16 [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;
See also &amp;lt;code&amp;gt;INDTILE_FLAG_ACCEPT_ALL&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;
|&lt;br /&gt;
;INDTILE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
: set this if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
;INDTILE_FLAG_ACCEPT_ALL {{nml|0.5}} {{ottd|1.9}} &lt;br /&gt;
: In addition to the cargotypes set by accepted_cargos, the tile accepts all cargotypes which the industry accepts.&lt;br /&gt;
* This considers industry property cargo_types and callback cargo_input.&lt;br /&gt;
* This does not consider industry callback stop_accept_cargo.&lt;br /&gt;
* This property adds 8/8 acceptance for the matching cargotypes. You can list negative acceptances (-8/8) in property 13 to exclude specific cargos.&lt;br /&gt;
* Tile callback cargo_type_accept overrides all acceptances including those added by this flag. &lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 &amp;quot;tile_check&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:IndustryCommonVariables}}&lt;br /&gt;
&lt;br /&gt;
==Industry tile variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;wikitable sortable&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_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the industry tile has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 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.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, 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;
*&amp;lt;code&amp;gt;getbits(extra_callback_info2, 8, 1)&amp;lt;/code&amp;gt;: Whether triggered when placing new industries.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: The industry layout number.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: The [[#Industry creation types|creation type]]&lt;br /&gt;
Note: use of this callback will deactivate the use of the landshape flags. 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;
{{NML:LocationCheckResults}}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
Since {{ottd|15.0}} also triggered when placing new industries.&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>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=5262</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=5262"/>
		<updated>2026-06-05T10:42:51Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* House callbacks */ var18 bit 0&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;
{{ottdp|15}} Since OpenTTD 15 the allowed ID range is increased to 0..4095.&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;
Note, setting the 4th parameter requires to also set the 3rd parameter. If you want automatic id assignment (mind the notes on the [[NML:Item|Item page]]), you need to set the 3rd parameter to -1. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_HOUSES, item_brewery, -1, HOUSE_SIZE_2X2) {&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;wikitable sortable&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;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house is not available for some reason. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039; 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces (and thus disabling the default). This is ignored, if the default house has already been overridden (disabling it another time is pointless). 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 unconditionally on (the beginning of) construction. If not set, animation can still be started (conditionally) via the callbacks &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;construction_anim&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;.&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. This also affects how many passengers the house generates, unless the &amp;lt;code&amp;gt;cargo_production&amp;lt;/code&amp;gt; callback is used.&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Affects how much mail the building generates. Not used if the &amp;lt;code&amp;gt;cargo_production&amp;lt;/code&amp;gt; callback is used.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs. &lt;br /&gt;
{{nml|0.5}}{{ottdp|1.9|no}} Array with up to 16 [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;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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..4095&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..4095&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;wikitable sortable&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_map&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;TYPE | 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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the house has that specific badge attached.&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;wikitable sortable&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 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.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
Since {{ottd|15.0}} also triggered when placing new house.&lt;br /&gt;
*&amp;lt;code&amp;gt;getbits(extra_callback_info2, 0, 1)&amp;lt;/code&amp;gt; : Whether triggered when placing new house.&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, or &amp;lt;code&amp;gt;CB_RESULT_HOUSE_NO_MORE_PRODUCTION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called every 256 ticks. The return value specifies what cargo and what amount is produced. The callback is called multiple times until &amp;lt;code&amp;gt;CB_RESULT_HOUSE_NO_MORE_PRODUCTION&amp;lt;/code&amp;gt; is returned.&lt;br /&gt;
* &amp;lt;code&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The number of iterations so far.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;: 32 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>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=5261</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=5261"/>
		<updated>2026-06-05T10:38:36Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* House callbacks */ ottd #14089&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;
{{ottdp|15}} Since OpenTTD 15 the allowed ID range is increased to 0..4095.&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;
Note, setting the 4th parameter requires to also set the 3rd parameter. If you want automatic id assignment (mind the notes on the [[NML:Item|Item page]]), you need to set the 3rd parameter to -1. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 item(FEAT_HOUSES, item_brewery, -1, HOUSE_SIZE_2X2) {&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;wikitable sortable&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;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house is not available for some reason. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039; 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;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces (and thus disabling the default). This is ignored, if the default house has already been overridden (disabling it another time is pointless). 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 unconditionally on (the beginning of) construction. If not set, animation can still be started (conditionally) via the callbacks &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt;, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;construction_anim&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt;.&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. This also affects how many passengers the house generates, unless the &amp;lt;code&amp;gt;cargo_production&amp;lt;/code&amp;gt; callback is used.&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Affects how much mail the building generates. Not used if the &amp;lt;code&amp;gt;cargo_production&amp;lt;/code&amp;gt; callback is used.&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs. &lt;br /&gt;
{{nml|0.5}}{{ottdp|1.9|no}} Array with up to 16 [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;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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..4095&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..4095&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;wikitable sortable&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_map&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;TYPE | 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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the house has that specific badge attached.&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;wikitable sortable&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 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.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
Since {{ottd|15.0}} also triggered when placing new house.&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, or &amp;lt;code&amp;gt;CB_RESULT_HOUSE_NO_MORE_PRODUCTION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called every 256 ticks. The return value specifies what cargo and what amount is produced. The callback is called multiple times until &amp;lt;code&amp;gt;CB_RESULT_HOUSE_NO_MORE_PRODUCTION&amp;lt;/code&amp;gt; is returned.&lt;br /&gt;
* &amp;lt;code&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The number of iterations so far.&lt;br /&gt;
* &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;: 32 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>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryTiles&amp;diff=5260</id>
		<title>NML:IndustryTiles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryTiles&amp;diff=5260"/>
		<updated>2026-06-05T10:33:34Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Animation triggers */ ottd #14089&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on industry tile properties, variables and callbacks. [[NML:Industries|Industries]] are closely related.&lt;br /&gt;
&lt;br /&gt;
== Industry tile ID allocation ==&lt;br /&gt;
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 [[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 tile properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039; 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;
{{nml|0.5}} {{ottdp|1.9|no}}Array with up to 16 [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;
See also &amp;lt;code&amp;gt;INDTILE_FLAG_ACCEPT_ALL&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;
|&lt;br /&gt;
;INDTILE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
: set this if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
;INDTILE_FLAG_ACCEPT_ALL {{nml|0.5}} {{ottd|1.9}} &lt;br /&gt;
: In addition to the cargotypes set by accepted_cargos, the tile accepts all cargotypes which the industry accepts.&lt;br /&gt;
* This considers industry property cargo_types and callback cargo_input.&lt;br /&gt;
* This does not consider industry callback stop_accept_cargo.&lt;br /&gt;
* This property adds 8/8 acceptance for the matching cargotypes. You can list negative acceptances (-8/8) in property 13 to exclude specific cargos.&lt;br /&gt;
* Tile callback cargo_type_accept overrides all acceptances including those added by this flag. &lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 &amp;quot;tile_check&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:IndustryCommonVariables}}&lt;br /&gt;
&lt;br /&gt;
==Industry tile variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;wikitable sortable&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_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the industry tile has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 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.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, 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;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: The industry layout number.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: The [[#Industry creation types|creation type]]&lt;br /&gt;
Note: use of this callback will deactivate the use of the landshape flags. 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;
{{NML:LocationCheckResults}}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
Since {{ottd|15.0}} also triggered when placing new industries.&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>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5259</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5259"/>
		<updated>2026-06-05T10:11:37Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Road stop properties */ nml #388&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the road stop.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this road stop (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one [[#List of road stop views|view]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the road stop tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the road stop being bridgeable.&lt;br /&gt;
See [[#List_of_bridge_pillar_flags|list of bridge pillar flags]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of bridge pillar flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_W &lt;br /&gt;
| Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_S &lt;br /&gt;
| Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_E &lt;br /&gt;
| Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_CORNER_N &lt;br /&gt;
| Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NE &lt;br /&gt;
| Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SE &lt;br /&gt;
| Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_SW &lt;br /&gt;
| Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
| BRIDGE_PILLAR_EDGE_NW &lt;br /&gt;
| Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| 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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| Is nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5258</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5258"/>
		<updated>2026-06-05T09:58:30Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* List of road stop views */ Add value to the table.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| 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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| Is nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
| 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=5257</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=5257"/>
		<updated>2026-06-05T09:27:45Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Station properties */  add #388&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Since {{ottd|15.0}} {{nml|0.7.6}} it is possible to register up to 256 tile types.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15.0}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles &amp;lt;br&amp;gt;&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated since &#039;&#039;&#039;{{nml|0.7.6}}&#039;&#039;&#039; , replaced by &#039;&#039;&#039;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_flags&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_ALL_TILES&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_PERIMETER {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;perimeter&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
:Since {{ottd|16.0}} if &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA&amp;lt;/code&amp;gt; is also set it does not do anything.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA {{ottd|16.0}} {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;area&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Deprecated since {{nml|0.9.0}}.&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(STAT_ANIM_XXX, ANIM_TRIGGER_STAT_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TILELOOP&lt;br /&gt;
:Tile is processed in the periodic processing loop&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TRAIN_RESERVES&lt;br /&gt;
:Train reserves platform (using PBS)&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| tile_flags&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(STAT_TILE_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.7.6}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
; PYLON&lt;br /&gt;
: Draw pylon on tile with that type.&lt;br /&gt;
; NOWIRE&lt;br /&gt;
: Hide wire on tile with that type.&lt;br /&gt;
; BLOCKED&lt;br /&gt;
: Do not allow trains to enter tile with that type.&lt;br /&gt;
|-&lt;br /&gt;
| heights&lt;br /&gt;
| Array of unsigned ints&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
Specifies the bridge height so bridges can be build above the station.&lt;br /&gt;
The bridge height defines minimum clearances required for a bridge for the sprite layouts of this station (or zero to not allow any bridge).&lt;br /&gt;
Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
|-&lt;br /&gt;
| blocked_pillars&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(BRIDGE_PILLAR_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.8.1}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the station tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the station being bridgeable.&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
;CORNER_W : Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
;CORNER_S : Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
;CORNER_E : Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
;CORNER_N : Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
;EDGE_NE : Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
;EDGE_SE : Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
;EDGE_SW : Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
;EDGE_NW : Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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;wikitable sortable&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;wikitable sortable&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;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&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;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station 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;wikitable sortable&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_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&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_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&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 [[#Station_sections|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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the rail station has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
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 cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
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;wikitable sortable&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;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, even values up to FE can be returned as long as the tile is defined.&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 24, 8)&amp;lt;/code&amp;gt;: Original tile type in static layout.&lt;br /&gt;
&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=5256</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=5256"/>
		<updated>2026-06-05T08:11:55Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require an argument */ ` -&amp;gt; &amp;lt;code&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. If set to 0, cargo does not age. Repeated tests have shown that the gameplay effects of this property often do not match the expectations of grf authors. Explaining why requires a detailed understanding of the OpenTTD cargo aging algorithm, and how that works with e.g. different map sizes, vehicle speeds, multi-leg feeder systems, etc. TL;DR avoid using this property unless you absolutely understand the effect it will have.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variant_group&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vehicle ID or alternatively the vehicle numeric ID (0 ... 65535)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
{{ottd|13}} This property supports grouping vehicles in the purchase menu (also the autoreplace menu). The property value is the ID of another vehicle in the same GRF which will act as the parent for vehicles in the group.&lt;br /&gt;
&lt;br /&gt;
Groups can also be nested (this is experimental as of December 2022 and may change with testing).&lt;br /&gt;
&lt;br /&gt;
See also vehicle extra_flags which can influence the behaviour of vehicles in variant groups.&lt;br /&gt;
&lt;br /&gt;
See also https://github.com/OpenTTD/OpenTTD/pull/10220&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|13}} &lt;br /&gt;
;VEHICLE_FLAG_DISABLE_NEW_VEHICLE_MESSAGE&lt;br /&gt;
: Disable &amp;quot;New Vehicle&amp;quot; news message for this engine&lt;br /&gt;
;VEHICLE_FLAG_DISABLE_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Disable &amp;quot;Exclusive Preview&amp;quot; for this engine&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Variants - Include this variant when primary engine has &amp;quot;Exclusive Preview&amp;quot;&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_RELIABILITY&lt;br /&gt;
: Variants - (Attempt to) Synchronize reliability the primary engine.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| yes&lt;br /&gt;
| Since {{ottd|15.0}}&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. The length of each phase and the starting, peak, and final reliabilities are randomized for each engine when starting a new game. Also note that phase 2 (the vehicle&#039;s peak performance) is actually about 8 years shorter than the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; parameter.&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 + (0 to 15 months)&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.6 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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).  See also curve_speed_mod property.&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. {{ottdp|13|no|no}} this flag is no longer required, flip is always allowed, except for multi-header or articulated vehicles which cannot be flipped.  For vehicles shorter than 8/8, see [[Action0/Vehicles/Trains#cite_note-6|this note about sprite offsets]]&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;
;TRAIN_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|16}} &lt;br /&gt;
;VEHICLE_FLAG_TRAIN_HAS_CAB&lt;br /&gt;
: Train wagon has a cab and can lead a train when driving backwards, without any speed reduction.&lt;br /&gt;
Additionally, trains have the extra flags common to all vehicle types, described above.&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;
|{{ottd|15.0.0}} array of items from railtypetable &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;15.0.0}} item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 9.8 * weight (in tons), with 9.8 being an approximation of the acceleration of gravity (9.81 m/s).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;curve_speed_mod&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127.996 (float)&lt;br /&gt;
| yes&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Maximum curve speed modifier.&lt;br /&gt;
&lt;br /&gt;
The modifier is applied after the normal curve speed calculation is done using the formula max_curve_speed * (1 + curve_speed_mod). This means that the default property value of 0 is equivalent to no change. Negative values are supported, but the resulting vehicle curve speed is clamped at 2 mph-ish to make sure vehicles don&#039;t become permanently stuck.&lt;br /&gt;
&lt;br /&gt;
If different vehicles in a train have different curve speed modifiers, the lowest value wins.&lt;br /&gt;
&lt;br /&gt;
See also TRAIN_FLAG_TILT, which is an older and less flexible way of managing vehicle curve speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 ... 511km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| road_type &#039;&#039;or&#039;&#039; tram_type &lt;br /&gt;
| item from [[NML:Railtypetable-Roadtypetable-Tramtypetable|roadtypetable]] or [[NML:Railtypetable-Roadtypetable-Tramtypetable|tramtypetable]]&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Only &#039;&#039;one&#039;&#039; of these properties may be set.  &lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tram_type&amp;lt;/code&amp;gt; is set, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ROADVEH_FLAG_TRAM&amp;lt;/code&amp;gt; must also be set for the vehicle in &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If not set, road vehicles will default to ROAD and tram vehicles will default to RAIL (this does not overlap with railtype RAIL).&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;
;ROADVEH_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| {{ottd|14}}{{nml|7.5}} 0 .. 32767 km/h (float, speed units)&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;
;SHIP_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 1 ... 255&lt;br /&gt;
| {{ottd|14}} Acceleration in units of ~0.5 km/h per tick. 1 is the default and is the acceleration of default ships.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
;AIRCRAFT_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]]. This also affects custom rotor sprites.&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all, similarly checking current_roadtype for a tram won&#039;t return a useful result.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_type&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|Cargo label]]&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo type in the consist.  Prior to nml r2320 this was known as most_common_refit, and didn&#039;t work, and was also incorrectly documented :)&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo subtype for most_common_cargo_type&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;
| flight_state&lt;br /&gt;
| 0 ... 28&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.8.1}} Only for aircrafts.&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 ... 0xFFFFFF&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for driving animations.&lt;br /&gt;
For that, make the animation use a number of frames, which is a power of two, i.e. 2, 4, 8, 16, 32, ... frames, and then use the lower n bits of motion_counter.&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_flipped&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 sprite is reversed via flip-vehicle-in-depot (trains only), or if it&#039;s the rear-most part of a dual-head engine.&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;
| train_is_driving_backwards&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottd|16}} Value is 1 if the train is driving backwards (trains only)&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;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| This variable is useless due to equivalent railtypes, use tile_xxx_railtype instead.  If you do use this variable, it will not work as expected 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.&lt;br /&gt;
|-&lt;br /&gt;
| current_roadtype&lt;br /&gt;
| Entry from current_roadtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent roadtypes, use tile_xxx_roadtype instead.  Don&#039;t use this variable unless you&#039;ve defined a roadtype translation table. If the road vehicle is running on a roadtype that is not listed in your roadtype translation table this variable will contain 0xFF. Checking this for a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| current_tramtype&lt;br /&gt;
| Entry from tramtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent tramtypes, use tile_xxx_tramtype instead. Don&#039;t use this variable unless you&#039;ve defined a tramtype translation table. If the road vehicle is running on a tramtype that is not listed in your tramtype translation table this variable will contain 0xFF. Checking this for a road vehicle that is not a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_catenary&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} True if the track_type on the tile has catenary. This is a little simplified as it is intended for sprite changes (e.g. raise/lower pantograph) and only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of electric track, AC and DC voltages etc, ... use tile_xxx_railtype/tile_xxx_roadtype/tile_xxx_tramtype instead.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| tile_supports_railtype &amp;lt;br /&amp;gt; tile_supports_roadtype &amp;lt;br /&amp;gt; tile_supports_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are compatible with the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_supports_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_powers_railtype &amp;lt;br /&amp;gt; tile_powers_roadtype &amp;lt;br /&amp;gt;tile_powers_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are powered on the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_powers_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_is_railtype &amp;lt;br /&amp;gt; tile_is_roadtype &amp;lt;br /&amp;gt; tile_is_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} The track_type label used as parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_is_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} Check if the vehicle has that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| count_has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| 0..255&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} The number of vehicles in the current consist that have that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_railtype_badge &amp;lt;br /&amp;gt; tile_has_roadtype_badge &amp;lt;br /&amp;gt; tile_has_tramtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} Check if the rail/road/tram type of the current tile occupied by the vehicle has that specific badge attached. &#039;&#039;&#039;Trains/RVs/Trams only.&#039;&#039;&#039; &amp;lt;code&amp;gt;tile_has_roadtype_badge&amp;lt;/code&amp;gt; also works for trams to allow code reuse.&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;wikitable sortable&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;
| &amp;lt;b&amp;gt;NOTE: As of OpenTTD 13, this feature is considered deprecated for most uses. Use variants instead.&amp;lt;/b&amp;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 to select specific sprites for the vehicle&#039;s current cargo subtype.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; The sound event, see the [[#Sound events|table]] below.&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc.&lt;br /&gt;
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;
The vehicle ID for the articulated part must be in the range 0 .. 16383.&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;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The new cargo type.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;: 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).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 16)&amp;lt;/code&amp;gt;: A bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. &lt;br /&gt;
Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_build_probability&lt;br /&gt;
| {{nml|0.7.5}} {{ottd|14.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
| 0 &lt;br /&gt;
| Probability of reversing rail vehicle, i.e. facing forward or backward, when purchased.&lt;br /&gt;
|-&lt;br /&gt;
| refit&lt;br /&gt;
| {{ottd|15.0}} All vehicle types&lt;br /&gt;
| Callback runs once, in purchase scope only &lt;br /&gt;
| &lt;br /&gt;
* 0 Don&#039;t change refittability (i.e. use whatever the evaluation of the various refittability vehicle props has determined).&lt;br /&gt;
* 1 Allow cargo type as a refit.&lt;br /&gt;
* 2 Disallow cargo type as a refit.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
The custom refit callback allows overriding the refittablity of each cargo as defined by the standard vehicle properties. It will be called for each defined cargo type once after the game has loaded all NewGRF files. The callback is run in purchase list scope, i.e. for cargotype FF. No variables of an actual vehicle are available. Information about the cargo type the callback is called for is available in variables 10 and 18:&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As this callback is not re-evaluated after game initialization, using any dynamic variables like e.g. game date will lead to undefined and faulty behaviour. &lt;br /&gt;
&lt;br /&gt;
This callback is available starting with {{ottdp|15|no|ottdrev=gd2496b6ec4}} OpenTTD 15.&lt;br /&gt;
&lt;br /&gt;
See https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29&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;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_mod&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| {{nml|0.7.2}} {{ottd|14.0}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| Can be used to display vehicle name differently depending on context (purchase menu, depot, nested variant depth etc). &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains detailed information about context - please see https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Engine_name_.28161.29&lt;br /&gt;
|}&lt;br /&gt;
&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;getbits(extra_callback_info1, 0, 8)&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;
! getbits(extra_callback_info1, 0, 8) !! 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 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;
===Composing vehicles from multiple sprites===&lt;br /&gt;
{{ottdp|1.7|no|ottdrev=r27668}} Since OpenTTD r27668 you can draw vehicles by drawing multiple sprites on top of each other.&lt;br /&gt;
* The sprites can use different recolouring.&lt;br /&gt;
* When using 32bpp sprites, the sprites can use the alpha channel to blend with the other sprites. In particular you can use this to alpha-blend company colours over other sprites.&lt;br /&gt;
&lt;br /&gt;
To enable this, you need to set &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;XXX_FLAG_SPRITE_STACK&amp;lt;/code&amp;gt; in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
When enabled, sprites are resolved multiple times while incrementing an iteration number, that can be read via&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For OpenTTD 1.7 to 12.0, this is limited to at most 4 sprites per articulated part.&lt;br /&gt;
&lt;br /&gt;
Increased to 8 sprites per articulated part for OpenTTD 13.0 {{ottdp|13.0|no}}&lt;br /&gt;
&lt;br /&gt;
In addition you need to set register 100 as additional result:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(CB_FLAG_MORE_SPRITES | recolouring, 0x100)&amp;lt;/code&amp;gt; if there are more sprites to draw.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(recolouring, 0x100)&amp;lt;/code&amp;gt; if there are no more sprites to draw.&lt;br /&gt;
&amp;quot;recolouring&amp;quot; can be:&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_USE_DEFAULT&amp;lt;/code&amp;gt; to use the default vehicle recolouring.&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_IDENTITY&amp;lt;/code&amp;gt; to use no recolouring&lt;br /&gt;
* Any other default or custom recolouring sprite.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;br /&gt;
&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;
Note that while vehicle ID affects the order in which vehicles appear in the purchase menu, this can be overridden using the [[NML:Sorting vehicles in the purchase list|sort block]].&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;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=5255</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=5255"/>
		<updated>2026-06-05T08:11:21Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require an argument */ Fix the style.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. If set to 0, cargo does not age. Repeated tests have shown that the gameplay effects of this property often do not match the expectations of grf authors. Explaining why requires a detailed understanding of the OpenTTD cargo aging algorithm, and how that works with e.g. different map sizes, vehicle speeds, multi-leg feeder systems, etc. TL;DR avoid using this property unless you absolutely understand the effect it will have.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variant_group&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vehicle ID or alternatively the vehicle numeric ID (0 ... 65535)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
{{ottd|13}} This property supports grouping vehicles in the purchase menu (also the autoreplace menu). The property value is the ID of another vehicle in the same GRF which will act as the parent for vehicles in the group.&lt;br /&gt;
&lt;br /&gt;
Groups can also be nested (this is experimental as of December 2022 and may change with testing).&lt;br /&gt;
&lt;br /&gt;
See also vehicle extra_flags which can influence the behaviour of vehicles in variant groups.&lt;br /&gt;
&lt;br /&gt;
See also https://github.com/OpenTTD/OpenTTD/pull/10220&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|13}} &lt;br /&gt;
;VEHICLE_FLAG_DISABLE_NEW_VEHICLE_MESSAGE&lt;br /&gt;
: Disable &amp;quot;New Vehicle&amp;quot; news message for this engine&lt;br /&gt;
;VEHICLE_FLAG_DISABLE_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Disable &amp;quot;Exclusive Preview&amp;quot; for this engine&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Variants - Include this variant when primary engine has &amp;quot;Exclusive Preview&amp;quot;&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_RELIABILITY&lt;br /&gt;
: Variants - (Attempt to) Synchronize reliability the primary engine.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| yes&lt;br /&gt;
| Since {{ottd|15.0}}&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. The length of each phase and the starting, peak, and final reliabilities are randomized for each engine when starting a new game. Also note that phase 2 (the vehicle&#039;s peak performance) is actually about 8 years shorter than the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; parameter.&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 + (0 to 15 months)&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.6 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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).  See also curve_speed_mod property.&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. {{ottdp|13|no|no}} this flag is no longer required, flip is always allowed, except for multi-header or articulated vehicles which cannot be flipped.  For vehicles shorter than 8/8, see [[Action0/Vehicles/Trains#cite_note-6|this note about sprite offsets]]&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;
;TRAIN_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|16}} &lt;br /&gt;
;VEHICLE_FLAG_TRAIN_HAS_CAB&lt;br /&gt;
: Train wagon has a cab and can lead a train when driving backwards, without any speed reduction.&lt;br /&gt;
Additionally, trains have the extra flags common to all vehicle types, described above.&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;
|{{ottd|15.0.0}} array of items from railtypetable &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;15.0.0}} item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 9.8 * weight (in tons), with 9.8 being an approximation of the acceleration of gravity (9.81 m/s).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;curve_speed_mod&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127.996 (float)&lt;br /&gt;
| yes&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Maximum curve speed modifier.&lt;br /&gt;
&lt;br /&gt;
The modifier is applied after the normal curve speed calculation is done using the formula max_curve_speed * (1 + curve_speed_mod). This means that the default property value of 0 is equivalent to no change. Negative values are supported, but the resulting vehicle curve speed is clamped at 2 mph-ish to make sure vehicles don&#039;t become permanently stuck.&lt;br /&gt;
&lt;br /&gt;
If different vehicles in a train have different curve speed modifiers, the lowest value wins.&lt;br /&gt;
&lt;br /&gt;
See also TRAIN_FLAG_TILT, which is an older and less flexible way of managing vehicle curve speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 ... 511km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| road_type &#039;&#039;or&#039;&#039; tram_type &lt;br /&gt;
| item from [[NML:Railtypetable-Roadtypetable-Tramtypetable|roadtypetable]] or [[NML:Railtypetable-Roadtypetable-Tramtypetable|tramtypetable]]&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Only &#039;&#039;one&#039;&#039; of these properties may be set.  &lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tram_type&amp;lt;/code&amp;gt; is set, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ROADVEH_FLAG_TRAM&amp;lt;/code&amp;gt; must also be set for the vehicle in &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If not set, road vehicles will default to ROAD and tram vehicles will default to RAIL (this does not overlap with railtype RAIL).&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;
;ROADVEH_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| {{ottd|14}}{{nml|7.5}} 0 .. 32767 km/h (float, speed units)&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;
;SHIP_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 1 ... 255&lt;br /&gt;
| {{ottd|14}} Acceleration in units of ~0.5 km/h per tick. 1 is the default and is the acceleration of default ships.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
;AIRCRAFT_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]]. This also affects custom rotor sprites.&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all, similarly checking current_roadtype for a tram won&#039;t return a useful result.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_type&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|Cargo label]]&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo type in the consist.  Prior to nml r2320 this was known as most_common_refit, and didn&#039;t work, and was also incorrectly documented :)&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo subtype for most_common_cargo_type&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;
| flight_state&lt;br /&gt;
| 0 ... 28&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.8.1}} Only for aircrafts.&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 ... 0xFFFFFF&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for driving animations.&lt;br /&gt;
For that, make the animation use a number of frames, which is a power of two, i.e. 2, 4, 8, 16, 32, ... frames, and then use the lower n bits of motion_counter.&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_flipped&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 sprite is reversed via flip-vehicle-in-depot (trains only), or if it&#039;s the rear-most part of a dual-head engine.&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;
| train_is_driving_backwards&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottd|16}} Value is 1 if the train is driving backwards (trains only)&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;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| This variable is useless due to equivalent railtypes, use tile_xxx_railtype instead.  If you do use this variable, it will not work as expected 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.&lt;br /&gt;
|-&lt;br /&gt;
| current_roadtype&lt;br /&gt;
| Entry from current_roadtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent roadtypes, use tile_xxx_roadtype instead.  Don&#039;t use this variable unless you&#039;ve defined a roadtype translation table. If the road vehicle is running on a roadtype that is not listed in your roadtype translation table this variable will contain 0xFF. Checking this for a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| current_tramtype&lt;br /&gt;
| Entry from tramtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent tramtypes, use tile_xxx_tramtype instead. Don&#039;t use this variable unless you&#039;ve defined a tramtype translation table. If the road vehicle is running on a tramtype that is not listed in your tramtype translation table this variable will contain 0xFF. Checking this for a road vehicle that is not a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_catenary&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} True if the track_type on the tile has catenary. This is a little simplified as it is intended for sprite changes (e.g. raise/lower pantograph) and only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of electric track, AC and DC voltages etc, ... use tile_xxx_railtype/tile_xxx_roadtype/tile_xxx_tramtype instead.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| tile_supports_railtype &amp;lt;br /&amp;gt; tile_supports_roadtype &amp;lt;br /&amp;gt; tile_supports_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are compatible with the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_supports_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_powers_railtype &amp;lt;br /&amp;gt; tile_powers_roadtype &amp;lt;br /&amp;gt;tile_powers_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are powered on the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_powers_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_is_railtype &amp;lt;br /&amp;gt; tile_is_roadtype &amp;lt;br /&amp;gt; tile_is_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} The track_type label used as parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_is_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} Check if the vehicle has that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| count_has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| 0..255&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} The number of vehicles in the current consist that have that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_railtype_badge &amp;lt;br /&amp;gt; tile_has_roadtype_badge &amp;lt;br /&amp;gt; tile_has_tramtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} {{nml|0.9.0}} Check if the rail/road/tram type of the current tile occupied by the vehicle has that specific badge attached. &#039;&#039;&#039;Trains/RVs/Trams only.&#039;&#039;&#039; `tile_has_roadtype_badge` also works for trams to allow code reuse.&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;wikitable sortable&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;
| &amp;lt;b&amp;gt;NOTE: As of OpenTTD 13, this feature is considered deprecated for most uses. Use variants instead.&amp;lt;/b&amp;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 to select specific sprites for the vehicle&#039;s current cargo subtype.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; The sound event, see the [[#Sound events|table]] below.&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc.&lt;br /&gt;
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;
The vehicle ID for the articulated part must be in the range 0 .. 16383.&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;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The new cargo type.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;: 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).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 16)&amp;lt;/code&amp;gt;: A bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. &lt;br /&gt;
Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_build_probability&lt;br /&gt;
| {{nml|0.7.5}} {{ottd|14.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
| 0 &lt;br /&gt;
| Probability of reversing rail vehicle, i.e. facing forward or backward, when purchased.&lt;br /&gt;
|-&lt;br /&gt;
| refit&lt;br /&gt;
| {{ottd|15.0}} All vehicle types&lt;br /&gt;
| Callback runs once, in purchase scope only &lt;br /&gt;
| &lt;br /&gt;
* 0 Don&#039;t change refittability (i.e. use whatever the evaluation of the various refittability vehicle props has determined).&lt;br /&gt;
* 1 Allow cargo type as a refit.&lt;br /&gt;
* 2 Disallow cargo type as a refit.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
The custom refit callback allows overriding the refittablity of each cargo as defined by the standard vehicle properties. It will be called for each defined cargo type once after the game has loaded all NewGRF files. The callback is run in purchase list scope, i.e. for cargotype FF. No variables of an actual vehicle are available. Information about the cargo type the callback is called for is available in variables 10 and 18:&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As this callback is not re-evaluated after game initialization, using any dynamic variables like e.g. game date will lead to undefined and faulty behaviour. &lt;br /&gt;
&lt;br /&gt;
This callback is available starting with {{ottdp|15|no|ottdrev=gd2496b6ec4}} OpenTTD 15.&lt;br /&gt;
&lt;br /&gt;
See https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29&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;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_mod&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| {{nml|0.7.2}} {{ottd|14.0}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| Can be used to display vehicle name differently depending on context (purchase menu, depot, nested variant depth etc). &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains detailed information about context - please see https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Engine_name_.28161.29&lt;br /&gt;
|}&lt;br /&gt;
&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;getbits(extra_callback_info1, 0, 8)&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;
! getbits(extra_callback_info1, 0, 8) !! 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 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;
===Composing vehicles from multiple sprites===&lt;br /&gt;
{{ottdp|1.7|no|ottdrev=r27668}} Since OpenTTD r27668 you can draw vehicles by drawing multiple sprites on top of each other.&lt;br /&gt;
* The sprites can use different recolouring.&lt;br /&gt;
* When using 32bpp sprites, the sprites can use the alpha channel to blend with the other sprites. In particular you can use this to alpha-blend company colours over other sprites.&lt;br /&gt;
&lt;br /&gt;
To enable this, you need to set &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;XXX_FLAG_SPRITE_STACK&amp;lt;/code&amp;gt; in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
When enabled, sprites are resolved multiple times while incrementing an iteration number, that can be read via&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For OpenTTD 1.7 to 12.0, this is limited to at most 4 sprites per articulated part.&lt;br /&gt;
&lt;br /&gt;
Increased to 8 sprites per articulated part for OpenTTD 13.0 {{ottdp|13.0|no}}&lt;br /&gt;
&lt;br /&gt;
In addition you need to set register 100 as additional result:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(CB_FLAG_MORE_SPRITES | recolouring, 0x100)&amp;lt;/code&amp;gt; if there are more sprites to draw.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(recolouring, 0x100)&amp;lt;/code&amp;gt; if there are no more sprites to draw.&lt;br /&gt;
&amp;quot;recolouring&amp;quot; can be:&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_USE_DEFAULT&amp;lt;/code&amp;gt; to use the default vehicle recolouring.&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_IDENTITY&amp;lt;/code&amp;gt; to use no recolouring&lt;br /&gt;
* Any other default or custom recolouring sprite.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;br /&gt;
&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;
Note that while vehicle ID affects the order in which vehicles appear in the purchase menu, this can be overridden using the [[NML:Sorting vehicles in the purchase list|sort block]].&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;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=5254</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=5254"/>
		<updated>2026-06-05T08:00:02Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require an argument */ add an notice that tile_has_roadtype_badge and tile_has_tramtype_badge are the same under the hood.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. If set to 0, cargo does not age. Repeated tests have shown that the gameplay effects of this property often do not match the expectations of grf authors. Explaining why requires a detailed understanding of the OpenTTD cargo aging algorithm, and how that works with e.g. different map sizes, vehicle speeds, multi-leg feeder systems, etc. TL;DR avoid using this property unless you absolutely understand the effect it will have.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variant_group&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vehicle ID or alternatively the vehicle numeric ID (0 ... 65535)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
{{ottd|13}} This property supports grouping vehicles in the purchase menu (also the autoreplace menu). The property value is the ID of another vehicle in the same GRF which will act as the parent for vehicles in the group.&lt;br /&gt;
&lt;br /&gt;
Groups can also be nested (this is experimental as of December 2022 and may change with testing).&lt;br /&gt;
&lt;br /&gt;
See also vehicle extra_flags which can influence the behaviour of vehicles in variant groups.&lt;br /&gt;
&lt;br /&gt;
See also https://github.com/OpenTTD/OpenTTD/pull/10220&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|13}} &lt;br /&gt;
;VEHICLE_FLAG_DISABLE_NEW_VEHICLE_MESSAGE&lt;br /&gt;
: Disable &amp;quot;New Vehicle&amp;quot; news message for this engine&lt;br /&gt;
;VEHICLE_FLAG_DISABLE_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Disable &amp;quot;Exclusive Preview&amp;quot; for this engine&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Variants - Include this variant when primary engine has &amp;quot;Exclusive Preview&amp;quot;&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_RELIABILITY&lt;br /&gt;
: Variants - (Attempt to) Synchronize reliability the primary engine.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| yes&lt;br /&gt;
| Since {{ottd|15.0}}&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. The length of each phase and the starting, peak, and final reliabilities are randomized for each engine when starting a new game. Also note that phase 2 (the vehicle&#039;s peak performance) is actually about 8 years shorter than the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; parameter.&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 + (0 to 15 months)&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.6 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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).  See also curve_speed_mod property.&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. {{ottdp|13|no|no}} this flag is no longer required, flip is always allowed, except for multi-header or articulated vehicles which cannot be flipped.  For vehicles shorter than 8/8, see [[Action0/Vehicles/Trains#cite_note-6|this note about sprite offsets]]&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;
;TRAIN_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|16}} &lt;br /&gt;
;VEHICLE_FLAG_TRAIN_HAS_CAB&lt;br /&gt;
: Train wagon has a cab and can lead a train when driving backwards, without any speed reduction.&lt;br /&gt;
Additionally, trains have the extra flags common to all vehicle types, described above.&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;
|{{ottd|15.0.0}} array of items from railtypetable &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;15.0.0}} item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 9.8 * weight (in tons), with 9.8 being an approximation of the acceleration of gravity (9.81 m/s).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;curve_speed_mod&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127.996 (float)&lt;br /&gt;
| yes&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Maximum curve speed modifier.&lt;br /&gt;
&lt;br /&gt;
The modifier is applied after the normal curve speed calculation is done using the formula max_curve_speed * (1 + curve_speed_mod). This means that the default property value of 0 is equivalent to no change. Negative values are supported, but the resulting vehicle curve speed is clamped at 2 mph-ish to make sure vehicles don&#039;t become permanently stuck.&lt;br /&gt;
&lt;br /&gt;
If different vehicles in a train have different curve speed modifiers, the lowest value wins.&lt;br /&gt;
&lt;br /&gt;
See also TRAIN_FLAG_TILT, which is an older and less flexible way of managing vehicle curve speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 ... 511km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| road_type &#039;&#039;or&#039;&#039; tram_type &lt;br /&gt;
| item from [[NML:Railtypetable-Roadtypetable-Tramtypetable|roadtypetable]] or [[NML:Railtypetable-Roadtypetable-Tramtypetable|tramtypetable]]&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Only &#039;&#039;one&#039;&#039; of these properties may be set.  &lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tram_type&amp;lt;/code&amp;gt; is set, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ROADVEH_FLAG_TRAM&amp;lt;/code&amp;gt; must also be set for the vehicle in &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If not set, road vehicles will default to ROAD and tram vehicles will default to RAIL (this does not overlap with railtype RAIL).&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;
;ROADVEH_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| {{ottd|14}}{{nml|7.5}} 0 .. 32767 km/h (float, speed units)&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;
;SHIP_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 1 ... 255&lt;br /&gt;
| {{ottd|14}} Acceleration in units of ~0.5 km/h per tick. 1 is the default and is the acceleration of default ships.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
;AIRCRAFT_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]]. This also affects custom rotor sprites.&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all, similarly checking current_roadtype for a tram won&#039;t return a useful result.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_type&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|Cargo label]]&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo type in the consist.  Prior to nml r2320 this was known as most_common_refit, and didn&#039;t work, and was also incorrectly documented :)&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo subtype for most_common_cargo_type&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;
| flight_state&lt;br /&gt;
| 0 ... 28&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.8.1}} Only for aircrafts.&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 ... 0xFFFFFF&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for driving animations.&lt;br /&gt;
For that, make the animation use a number of frames, which is a power of two, i.e. 2, 4, 8, 16, 32, ... frames, and then use the lower n bits of motion_counter.&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_flipped&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 sprite is reversed via flip-vehicle-in-depot (trains only), or if it&#039;s the rear-most part of a dual-head engine.&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;
| train_is_driving_backwards&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottd|16}} Value is 1 if the train is driving backwards (trains only)&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;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| This variable is useless due to equivalent railtypes, use tile_xxx_railtype instead.  If you do use this variable, it will not work as expected 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.&lt;br /&gt;
|-&lt;br /&gt;
| current_roadtype&lt;br /&gt;
| Entry from current_roadtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent roadtypes, use tile_xxx_roadtype instead.  Don&#039;t use this variable unless you&#039;ve defined a roadtype translation table. If the road vehicle is running on a roadtype that is not listed in your roadtype translation table this variable will contain 0xFF. Checking this for a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| current_tramtype&lt;br /&gt;
| Entry from tramtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent tramtypes, use tile_xxx_tramtype instead. Don&#039;t use this variable unless you&#039;ve defined a tramtype translation table. If the road vehicle is running on a tramtype that is not listed in your tramtype translation table this variable will contain 0xFF. Checking this for a road vehicle that is not a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_catenary&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} True if the track_type on the tile has catenary. This is a little simplified as it is intended for sprite changes (e.g. raise/lower pantograph) and only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of electric track, AC and DC voltages etc, ... use tile_xxx_railtype/tile_xxx_roadtype/tile_xxx_tramtype instead.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| tile_supports_railtype &amp;lt;br /&amp;gt; tile_supports_roadtype &amp;lt;br /&amp;gt; tile_supports_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are compatible with the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_supports_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_powers_railtype &amp;lt;br /&amp;gt; tile_powers_roadtype &amp;lt;br /&amp;gt;tile_powers_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are powered on the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_powers_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_is_railtype &amp;lt;br /&amp;gt; tile_is_roadtype &amp;lt;br /&amp;gt; tile_is_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} The track_type label used as parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_is_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|15.0}} Check if the vehicle has that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| count_has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| 0..255&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} The number of vehicles in the current consist that have that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_railtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the rail type of the current tile occupied by the train has that specific badge attached. &#039;&#039;&#039;Trains only&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_roadtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the road type of the current tile occupied by the road vehicle has that specific badge attached. &#039;&#039;&#039;RVs only&#039;&#039;&#039;, although if used on tram works the same way as &amp;lt;code&amp;gt;tile_has_tramtype_badge&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_tramtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the tram track type of the current tile occupied by the tram has that specific badge attached. &#039;&#039;&#039;Trams only&#039;&#039;&#039;&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;wikitable sortable&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;
| &amp;lt;b&amp;gt;NOTE: As of OpenTTD 13, this feature is considered deprecated for most uses. Use variants instead.&amp;lt;/b&amp;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 to select specific sprites for the vehicle&#039;s current cargo subtype.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; The sound event, see the [[#Sound events|table]] below.&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc.&lt;br /&gt;
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;
The vehicle ID for the articulated part must be in the range 0 .. 16383.&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;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The new cargo type.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;: 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).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 16)&amp;lt;/code&amp;gt;: A bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. &lt;br /&gt;
Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_build_probability&lt;br /&gt;
| {{nml|0.7.5}} {{ottd|14.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
| 0 &lt;br /&gt;
| Probability of reversing rail vehicle, i.e. facing forward or backward, when purchased.&lt;br /&gt;
|-&lt;br /&gt;
| refit&lt;br /&gt;
| {{ottd|15.0}} All vehicle types&lt;br /&gt;
| Callback runs once, in purchase scope only &lt;br /&gt;
| &lt;br /&gt;
* 0 Don&#039;t change refittability (i.e. use whatever the evaluation of the various refittability vehicle props has determined).&lt;br /&gt;
* 1 Allow cargo type as a refit.&lt;br /&gt;
* 2 Disallow cargo type as a refit.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
The custom refit callback allows overriding the refittablity of each cargo as defined by the standard vehicle properties. It will be called for each defined cargo type once after the game has loaded all NewGRF files. The callback is run in purchase list scope, i.e. for cargotype FF. No variables of an actual vehicle are available. Information about the cargo type the callback is called for is available in variables 10 and 18:&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As this callback is not re-evaluated after game initialization, using any dynamic variables like e.g. game date will lead to undefined and faulty behaviour. &lt;br /&gt;
&lt;br /&gt;
This callback is available starting with {{ottdp|15|no|ottdrev=gd2496b6ec4}} OpenTTD 15.&lt;br /&gt;
&lt;br /&gt;
See https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29&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;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_mod&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| {{nml|0.7.2}} {{ottd|14.0}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| Can be used to display vehicle name differently depending on context (purchase menu, depot, nested variant depth etc). &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains detailed information about context - please see https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Engine_name_.28161.29&lt;br /&gt;
|}&lt;br /&gt;
&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;getbits(extra_callback_info1, 0, 8)&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;
! getbits(extra_callback_info1, 0, 8) !! 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 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;
===Composing vehicles from multiple sprites===&lt;br /&gt;
{{ottdp|1.7|no|ottdrev=r27668}} Since OpenTTD r27668 you can draw vehicles by drawing multiple sprites on top of each other.&lt;br /&gt;
* The sprites can use different recolouring.&lt;br /&gt;
* When using 32bpp sprites, the sprites can use the alpha channel to blend with the other sprites. In particular you can use this to alpha-blend company colours over other sprites.&lt;br /&gt;
&lt;br /&gt;
To enable this, you need to set &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;XXX_FLAG_SPRITE_STACK&amp;lt;/code&amp;gt; in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
When enabled, sprites are resolved multiple times while incrementing an iteration number, that can be read via&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For OpenTTD 1.7 to 12.0, this is limited to at most 4 sprites per articulated part.&lt;br /&gt;
&lt;br /&gt;
Increased to 8 sprites per articulated part for OpenTTD 13.0 {{ottdp|13.0|no}}&lt;br /&gt;
&lt;br /&gt;
In addition you need to set register 100 as additional result:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(CB_FLAG_MORE_SPRITES | recolouring, 0x100)&amp;lt;/code&amp;gt; if there are more sprites to draw.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(recolouring, 0x100)&amp;lt;/code&amp;gt; if there are no more sprites to draw.&lt;br /&gt;
&amp;quot;recolouring&amp;quot; can be:&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_USE_DEFAULT&amp;lt;/code&amp;gt; to use the default vehicle recolouring.&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_IDENTITY&amp;lt;/code&amp;gt; to use no recolouring&lt;br /&gt;
* Any other default or custom recolouring sprite.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;br /&gt;
&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;
Note that while vehicle ID affects the order in which vehicles appear in the purchase menu, this can be overridden using the [[NML:Sorting vehicles in the purchase list|sort block]].&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;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=5253</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=5253"/>
		<updated>2026-06-05T07:56:22Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require an argument */ Add variable 0x65.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. If set to 0, cargo does not age. Repeated tests have shown that the gameplay effects of this property often do not match the expectations of grf authors. Explaining why requires a detailed understanding of the OpenTTD cargo aging algorithm, and how that works with e.g. different map sizes, vehicle speeds, multi-leg feeder systems, etc. TL;DR avoid using this property unless you absolutely understand the effect it will have.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variant_group&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vehicle ID or alternatively the vehicle numeric ID (0 ... 65535)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
{{ottd|13}} This property supports grouping vehicles in the purchase menu (also the autoreplace menu). The property value is the ID of another vehicle in the same GRF which will act as the parent for vehicles in the group.&lt;br /&gt;
&lt;br /&gt;
Groups can also be nested (this is experimental as of December 2022 and may change with testing).&lt;br /&gt;
&lt;br /&gt;
See also vehicle extra_flags which can influence the behaviour of vehicles in variant groups.&lt;br /&gt;
&lt;br /&gt;
See also https://github.com/OpenTTD/OpenTTD/pull/10220&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|13}} &lt;br /&gt;
;VEHICLE_FLAG_DISABLE_NEW_VEHICLE_MESSAGE&lt;br /&gt;
: Disable &amp;quot;New Vehicle&amp;quot; news message for this engine&lt;br /&gt;
;VEHICLE_FLAG_DISABLE_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Disable &amp;quot;Exclusive Preview&amp;quot; for this engine&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Variants - Include this variant when primary engine has &amp;quot;Exclusive Preview&amp;quot;&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_RELIABILITY&lt;br /&gt;
: Variants - (Attempt to) Synchronize reliability the primary engine.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| yes&lt;br /&gt;
| Since {{ottd|15.0}}&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. The length of each phase and the starting, peak, and final reliabilities are randomized for each engine when starting a new game. Also note that phase 2 (the vehicle&#039;s peak performance) is actually about 8 years shorter than the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; parameter.&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 + (0 to 15 months)&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.6 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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).  See also curve_speed_mod property.&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. {{ottdp|13|no|no}} this flag is no longer required, flip is always allowed, except for multi-header or articulated vehicles which cannot be flipped.  For vehicles shorter than 8/8, see [[Action0/Vehicles/Trains#cite_note-6|this note about sprite offsets]]&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;
;TRAIN_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|16}} &lt;br /&gt;
;VEHICLE_FLAG_TRAIN_HAS_CAB&lt;br /&gt;
: Train wagon has a cab and can lead a train when driving backwards, without any speed reduction.&lt;br /&gt;
Additionally, trains have the extra flags common to all vehicle types, described above.&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;
|{{ottd|15.0.0}} array of items from railtypetable &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;15.0.0}} item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 9.8 * weight (in tons), with 9.8 being an approximation of the acceleration of gravity (9.81 m/s).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;curve_speed_mod&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127.996 (float)&lt;br /&gt;
| yes&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Maximum curve speed modifier.&lt;br /&gt;
&lt;br /&gt;
The modifier is applied after the normal curve speed calculation is done using the formula max_curve_speed * (1 + curve_speed_mod). This means that the default property value of 0 is equivalent to no change. Negative values are supported, but the resulting vehicle curve speed is clamped at 2 mph-ish to make sure vehicles don&#039;t become permanently stuck.&lt;br /&gt;
&lt;br /&gt;
If different vehicles in a train have different curve speed modifiers, the lowest value wins.&lt;br /&gt;
&lt;br /&gt;
See also TRAIN_FLAG_TILT, which is an older and less flexible way of managing vehicle curve speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 ... 511km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| road_type &#039;&#039;or&#039;&#039; tram_type &lt;br /&gt;
| item from [[NML:Railtypetable-Roadtypetable-Tramtypetable|roadtypetable]] or [[NML:Railtypetable-Roadtypetable-Tramtypetable|tramtypetable]]&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Only &#039;&#039;one&#039;&#039; of these properties may be set.  &lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tram_type&amp;lt;/code&amp;gt; is set, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ROADVEH_FLAG_TRAM&amp;lt;/code&amp;gt; must also be set for the vehicle in &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If not set, road vehicles will default to ROAD and tram vehicles will default to RAIL (this does not overlap with railtype RAIL).&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;
;ROADVEH_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| {{ottd|14}}{{nml|7.5}} 0 .. 32767 km/h (float, speed units)&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;
;SHIP_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 1 ... 255&lt;br /&gt;
| {{ottd|14}} Acceleration in units of ~0.5 km/h per tick. 1 is the default and is the acceleration of default ships.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
;AIRCRAFT_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]]. This also affects custom rotor sprites.&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all, similarly checking current_roadtype for a tram won&#039;t return a useful result.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_type&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|Cargo label]]&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo type in the consist.  Prior to nml r2320 this was known as most_common_refit, and didn&#039;t work, and was also incorrectly documented :)&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo subtype for most_common_cargo_type&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;
| flight_state&lt;br /&gt;
| 0 ... 28&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.8.1}} Only for aircrafts.&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 ... 0xFFFFFF&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for driving animations.&lt;br /&gt;
For that, make the animation use a number of frames, which is a power of two, i.e. 2, 4, 8, 16, 32, ... frames, and then use the lower n bits of motion_counter.&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_flipped&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 sprite is reversed via flip-vehicle-in-depot (trains only), or if it&#039;s the rear-most part of a dual-head engine.&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;
| train_is_driving_backwards&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottd|16}} Value is 1 if the train is driving backwards (trains only)&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;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| This variable is useless due to equivalent railtypes, use tile_xxx_railtype instead.  If you do use this variable, it will not work as expected 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.&lt;br /&gt;
|-&lt;br /&gt;
| current_roadtype&lt;br /&gt;
| Entry from current_roadtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent roadtypes, use tile_xxx_roadtype instead.  Don&#039;t use this variable unless you&#039;ve defined a roadtype translation table. If the road vehicle is running on a roadtype that is not listed in your roadtype translation table this variable will contain 0xFF. Checking this for a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| current_tramtype&lt;br /&gt;
| Entry from tramtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent tramtypes, use tile_xxx_tramtype instead. Don&#039;t use this variable unless you&#039;ve defined a tramtype translation table. If the road vehicle is running on a tramtype that is not listed in your tramtype translation table this variable will contain 0xFF. Checking this for a road vehicle that is not a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_catenary&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} True if the track_type on the tile has catenary. This is a little simplified as it is intended for sprite changes (e.g. raise/lower pantograph) and only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of electric track, AC and DC voltages etc, ... use tile_xxx_railtype/tile_xxx_roadtype/tile_xxx_tramtype instead.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| tile_supports_railtype &amp;lt;br /&amp;gt; tile_supports_roadtype &amp;lt;br /&amp;gt; tile_supports_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are compatible with the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_supports_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_powers_railtype &amp;lt;br /&amp;gt; tile_powers_roadtype &amp;lt;br /&amp;gt;tile_powers_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are powered on the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_powers_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_is_railtype &amp;lt;br /&amp;gt; tile_is_roadtype &amp;lt;br /&amp;gt; tile_is_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} The track_type label used as parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_is_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|15.0}} Check if the vehicle has that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| count_has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| 0..255&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} The number of vehicles in the current consist that have that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_railtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the rail type of the current tile occupied by the train has that specific badge attached. &#039;&#039;&#039;Trains only&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_roadtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the road type of the current tile occupied by the road vehicle has that specific badge attached. &#039;&#039;&#039;RVs only&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_tramtype_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} Check if the tram track type of the current tile occupied by the tram has that specific badge attached. &#039;&#039;&#039;Trams only&#039;&#039;&#039;&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;wikitable sortable&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;
| &amp;lt;b&amp;gt;NOTE: As of OpenTTD 13, this feature is considered deprecated for most uses. Use variants instead.&amp;lt;/b&amp;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 to select specific sprites for the vehicle&#039;s current cargo subtype.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; The sound event, see the [[#Sound events|table]] below.&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc.&lt;br /&gt;
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;
The vehicle ID for the articulated part must be in the range 0 .. 16383.&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;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The new cargo type.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;: 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).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 16)&amp;lt;/code&amp;gt;: A bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. &lt;br /&gt;
Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_build_probability&lt;br /&gt;
| {{nml|0.7.5}} {{ottd|14.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
| 0 &lt;br /&gt;
| Probability of reversing rail vehicle, i.e. facing forward or backward, when purchased.&lt;br /&gt;
|-&lt;br /&gt;
| refit&lt;br /&gt;
| {{ottd|15.0}} All vehicle types&lt;br /&gt;
| Callback runs once, in purchase scope only &lt;br /&gt;
| &lt;br /&gt;
* 0 Don&#039;t change refittability (i.e. use whatever the evaluation of the various refittability vehicle props has determined).&lt;br /&gt;
* 1 Allow cargo type as a refit.&lt;br /&gt;
* 2 Disallow cargo type as a refit.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
The custom refit callback allows overriding the refittablity of each cargo as defined by the standard vehicle properties. It will be called for each defined cargo type once after the game has loaded all NewGRF files. The callback is run in purchase list scope, i.e. for cargotype FF. No variables of an actual vehicle are available. Information about the cargo type the callback is called for is available in variables 10 and 18:&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As this callback is not re-evaluated after game initialization, using any dynamic variables like e.g. game date will lead to undefined and faulty behaviour. &lt;br /&gt;
&lt;br /&gt;
This callback is available starting with {{ottdp|15|no|ottdrev=gd2496b6ec4}} OpenTTD 15.&lt;br /&gt;
&lt;br /&gt;
See https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29&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;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_mod&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| {{nml|0.7.2}} {{ottd|14.0}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| Can be used to display vehicle name differently depending on context (purchase menu, depot, nested variant depth etc). &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains detailed information about context - please see https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Engine_name_.28161.29&lt;br /&gt;
|}&lt;br /&gt;
&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;getbits(extra_callback_info1, 0, 8)&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;
! getbits(extra_callback_info1, 0, 8) !! 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 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;
===Composing vehicles from multiple sprites===&lt;br /&gt;
{{ottdp|1.7|no|ottdrev=r27668}} Since OpenTTD r27668 you can draw vehicles by drawing multiple sprites on top of each other.&lt;br /&gt;
* The sprites can use different recolouring.&lt;br /&gt;
* When using 32bpp sprites, the sprites can use the alpha channel to blend with the other sprites. In particular you can use this to alpha-blend company colours over other sprites.&lt;br /&gt;
&lt;br /&gt;
To enable this, you need to set &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;XXX_FLAG_SPRITE_STACK&amp;lt;/code&amp;gt; in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
When enabled, sprites are resolved multiple times while incrementing an iteration number, that can be read via&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For OpenTTD 1.7 to 12.0, this is limited to at most 4 sprites per articulated part.&lt;br /&gt;
&lt;br /&gt;
Increased to 8 sprites per articulated part for OpenTTD 13.0 {{ottdp|13.0|no}}&lt;br /&gt;
&lt;br /&gt;
In addition you need to set register 100 as additional result:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(CB_FLAG_MORE_SPRITES | recolouring, 0x100)&amp;lt;/code&amp;gt; if there are more sprites to draw.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(recolouring, 0x100)&amp;lt;/code&amp;gt; if there are no more sprites to draw.&lt;br /&gt;
&amp;quot;recolouring&amp;quot; can be:&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_USE_DEFAULT&amp;lt;/code&amp;gt; to use the default vehicle recolouring.&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_IDENTITY&amp;lt;/code&amp;gt; to use no recolouring&lt;br /&gt;
* Any other default or custom recolouring sprite.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;br /&gt;
&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;
Note that while vehicle ID affects the order in which vehicles appear in the purchase menu, this can be overridden using the [[NML:Sorting vehicles in the purchase list|sort block]].&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;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5252</id>
		<title>VariationalAction2/Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5252"/>
		<updated>2026-06-05T07:52:28Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Test if rail or road type of the current type occupied by the vehicle has that specific badge attached (65) */  type -&amp;gt; tile&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;{{NFONavVehicles}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Variable!![[GRFActionsDetailed|Size]]!!Version!!Description!!Available in purchase list&lt;br /&gt;
|-&lt;br /&gt;
|10||D||{{ottdp|1.2|no|ottdrev=r23080}}||Pick sprites for different GUI windows - See [[Action2/Vehicles]].||{{ottdp|1.2|no|ottdrev=r23080}}&lt;br /&gt;
|-&lt;br /&gt;
|40||D||{{ottdp|0.6|2.5}}||Position in consist and length of consist||no&lt;br /&gt;
|-&lt;br /&gt;
|41||D||{{ottdp|0.6|2.5}}||Position in and length of chain of consecutive vehicles with same ID||no&lt;br /&gt;
|-&lt;br /&gt;
|42||D||{{ottdp|0.6|2.5}}||Cargo types transported by consist||no&lt;br /&gt;
|-&lt;br /&gt;
|43||D||{{ottdp|0.6|2.5}}||Player info||{{ottdp|0.6|2.5|ottdrev=r4611|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 48}}||Aircraft info||no&lt;br /&gt;
|-&lt;br /&gt;
|45||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 58}}||Curvature info||no&lt;br /&gt;
|-&lt;br /&gt;
|46||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 59}}||Motion counter||no&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.6|2.5}}||Vehicle cargo info||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot;&amp;gt;Variable 47 refers to the default cargo of the vehicle, when in purchase list. This differs from the cargo used in Action 3, which is 0xFF in purchase list. The &amp;quot;refit cycle&amp;quot; (F2) is currently always zero in the purchase list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|48||D||{{ottdp|0.6|2.5}}||Vehicle type information||{{ottdp|0.6|2.5|ottdrev=r5338|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|49||D||{{ottdp|0.7|2.6|ottdrev=r13376|ttdprev=r2216}}||Year of construction (long format, 0 based)||{{ottdp|0.7|no|ottdrev=r13376}} &amp;lt;ref name=&amp;quot;date&amp;quot;&amp;gt;This is the current date&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4A||D||{{ottdp|1.1|no|ottdrev=r20165}}||Info about current railtype/roadtype/tramtype||no&lt;br /&gt;
|-&lt;br /&gt;
|4B||D||{{ottdp|1.2|no|ottdrev=r23068}}||Long date of last servicing||{{ottdp|1.2|no|ottdrev=r23068}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4C||D||{{ottdp|1.3|no|ottdrev=r24246}}||Current max speed including e.g track or timetable speed limits. Only valid for front vehicle. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot;&amp;gt;See [[Action0Trains#Speed 09|train property 09]], [[Action0RoadVehicles|road vehicle property 08]] (not 15, even when using realistic acceleration), [[Action0Ships|ship property 0B]] and [[Action0Planes|aircraft property 0C]].&amp;lt;/ref&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|4D||D||{{ottdp|1.4|no|ottdrev=r26157}}||Position within articulated vehicle||no&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 57}}||Count Veh.ID occurence||no&lt;br /&gt;
|-&lt;br /&gt;
|61||-&amp;lt;ref&amp;gt;The size of the result matches the size of the queried variable.&amp;lt;/ref&amp;gt;||{{ottdp|1.2|no|ottdrev=r22997}}||Query variable of n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|1.2|no|ottdrev=r22998}}||Curvature/position difference for n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|63||D||{{ottdp|1.11|no|ottdrev=g868d84bbf}}||Test track-type of tile against another track-type||no&lt;br /&gt;
|-&lt;br /&gt;
|65||D||{{ottdp|15|no}}||Test if rail or road type of the current type occupied by the vehicle has that specific badge attached||no&lt;br /&gt;
|-&lt;br /&gt;
|7A||D||{{ottdp|15|no}}||Test if the vehicle has that specific badge attached||yes&lt;br /&gt;
|-&lt;br /&gt;
|97||B||{{ottdp|0.6|2.0}}||Tick counter, increased every engine tick||no&lt;br /&gt;
|-&lt;br /&gt;
|B2||W||||Vehicle status: bit0 = vehicle invisible (in tunnel/depot), bit1 = stopped, bit7 = crashed||no&lt;br /&gt;
|-&lt;br /&gt;
|B4||W||{{ottdp|0.6|2.0}}||Current speed. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot; /&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|B9||B||{{ottdp|0.6|2.0}}||Cargo type (type B from the list at [[CargoTypes]]; climate dependent)||no&lt;br /&gt;
|-&lt;br /&gt;
|C0||W||{{ottdp|0.6|2.0}}||Engine age in days&amp;lt;br/&amp;gt;{{ottdp|1.2|2.5|ottdrev=r22816|ttdprev=alpha 61}} Valid for wagons and articulated parts as well.||no&lt;br /&gt;
|-&lt;br /&gt;
|C4||B||{{ottdp|0.6|2.0}}||Year built (counted from 1920), note this is modified when Cht: Year is used||{{ottdp|0.6|no|ottdrev=r4611}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|C6||W||{{ottdp|0.6|2.0}}||Vehicle type ID &amp;lt;ref&amp;gt;{{ottdp|0.7|no}} In OpenTTD 0.7 and newer this is the GRF-local ID of the vehicle. Earlier versions of OpenTTD and TTDPatch report the [[VehicleIDs|TTD ID]]. For trains this is the same; for other vehicle types they differ.&amp;lt;/ref&amp;gt; (useful for [[Callbacks#Can wagon be attached (1D)|Callback 1D]])||no&lt;br /&gt;
|-&lt;br /&gt;
|C8||B||{{ottdp|0.6|2.0}}||Sprite type; FD for trains forward, FE or FF when reversed||no&lt;br /&gt;
|-&lt;br /&gt;
|C9||B||{{ottdp|0.6|2.0}}||Day counter; increased daily||no&lt;br /&gt;
|-&lt;br /&gt;
|DA||W||{{ottdp|0.6|2.0}}||Next wagon index, FFFF if last wagon (use shift-num=08 and check for FF)||no&lt;br /&gt;
|-&lt;br /&gt;
|F2||B||{{ottdp|0.6|2.5}}||Refit cycle, how many times refitted to the same cargo type||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|F4||D||{{ottdp|0.5|2.0|ottdrev=3594}}||Current horsepower of train consist||no&lt;br /&gt;
|-&lt;br /&gt;
|FE||W||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|-&lt;br /&gt;
|FF||B||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_VehicleArray TTD vehicle structure].&lt;br /&gt;
&lt;br /&gt;
Variables 40, 41, 42 and 43 are cached. This means that while they are in principle computationally expensive, they can be used without impacting performance. Variables 45 and 60 are also computationally expensive but cannot be cached, and should therefore be used sparingly. If possible 80+x variables are to be preferred.&lt;br /&gt;
&lt;br /&gt;
Cached variables are updated when the game is loaded, when the consist enters or is rearranged in a depot, and when the train reverses.&lt;br /&gt;
&lt;br /&gt;
In the purchase list only a few variables are available. Especially the front vehicle (related object) cannot be accessed, nor other articulated parts.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
=== Position and length (40, 41) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 00nnbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||position of vehicle within the consist counted from the engine (front), e.g. the engine would have ff=0, the 1st wagon or mail compartment of planes would have ff=1, the 2nd wagon or the rotor of helicopters would have ff=2, the 3rd wagon would have ff=3 etc&lt;br /&gt;
|-&lt;br /&gt;
|bb||same as ff, but counted from the end, i.e. the last wagon has bb=0, the next-to-last wagon has bb=1 etc.&lt;br /&gt;
|-&lt;br /&gt;
|nn||Total number of vehicles in the consist, including shadow and rotor for aircraft.&lt;br /&gt;
* In var 40 this is zero-based. That is, the value returned is one less than the actual number of vehicles. A train with engine and three wagons has nn=3.&lt;br /&gt;
* In var 41 this is one-based. That is, the value returned is the actual number of vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For variable 40, these numbers refer to the whole consist, but for variable 41, they only refer to the chain of consecutive vehicles with the same ID as the current wagon (including itself, but possibly excluding the engine):&lt;br /&gt;
&lt;br /&gt;
[[File:vehicle_var40_41.png]]&lt;br /&gt;
&lt;br /&gt;
Note however, that accessing the &amp;quot;related&amp;quot; object (i.e. the locomotive) doesn´t make much sense for vars 40/41, except for var40 when in a [[Callbacks#Can wagon be attached 1D|callback 1D]] chain.&lt;br /&gt;
&lt;br /&gt;
=== Consist cargo (42) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; uuiicctt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||a bit mask of all [[Action0Cargos#Cargo classes 16|cargo classes]] transported by the consist&lt;br /&gt;
|-&lt;br /&gt;
|cc||the most common [[CargoTypes|cargo type]] (from the column for type A)&lt;br /&gt;
|-&lt;br /&gt;
|ii||the most common refit cycle (var. F2) of cargo type cc&lt;br /&gt;
|-&lt;br /&gt;
|uu||the result of ORing the bits of prop. 25 from all vehicles in the train&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If used with VarAction2 type 81 (vehicle) it returns only cargo from this vehicle on, with type 82 (engine) that of the whole consist.&lt;br /&gt;
See also variable 47 for more details on the cargo carried by a vehicle.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} For GRF versions 7 and before &amp;quot;cc&amp;quot; is the untranslated bit number from [[Action0/Cargos#Bit_number_for_bitmasks_.2808.29|cargo property 8]].&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} With GRF version 8 the meaning of &amp;quot;cc&amp;quot; changes. If the grf file has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;cc&amp;quot; is the index of the cargo in that table; or FF if the cargo is not present in the table.&lt;br /&gt;
&lt;br /&gt;
=== Player info (43) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; Ccttmmnn&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|nn||the number of the current player from 0 to 7 (up to E (14) in OpenTTD since r14735)&lt;br /&gt;
|-&lt;br /&gt;
|mm||the multiplayer player number with the host player (or the single player) being 0 and the client player being 1&lt;br /&gt;
|-&lt;br /&gt;
|tt||the player type, see below for possible values&lt;br /&gt;
|-&lt;br /&gt;
|c||the primary player colour&lt;br /&gt;
|-&lt;br /&gt;
|C||{{ottdp|0.6|2.5|ttdprev=r1405}} the secondary player colour, equal to c if none (since r1405)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!tt value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||Player is human player (permanent company)&lt;br /&gt;
|-&lt;br /&gt;
|1||Player is AI player (not managed)&lt;br /&gt;
|-&lt;br /&gt;
|2||{{ottdp|no|2.5}} Player is a human managing an AI company&lt;br /&gt;
|-&lt;br /&gt;
|3||{{ottdp|no|2.5}} Player is human player&#039;s original company, now temporarily AI controlled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=r1497}} Since r1497, when the vehicle sprite is being displayed in an exclusive offer window or new vehicle news message, or in other circumstances when no player is associated with the vehicle, nn will be FF.&lt;br /&gt;
&lt;br /&gt;
=== Aircraft info (44) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxhhtt&lt;br /&gt;
&lt;br /&gt;
hh is the height of the aircraft above ground, or more properly above the height of its shadow. Buildings, including the heliport, don&#039;t count as &amp;quot;ground&amp;quot;, i.e. to get the height above a heliport, you have to subtract the heliport height from hh.&lt;br /&gt;
&lt;br /&gt;
tt is the type of the current airport: 0=small, 1=large, 2=heliport, 3=oil rig. The current airport is the target airport for aircraft that have finished the ascent and are in flight.&lt;br /&gt;
&lt;br /&gt;
=== Curvature info (45) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxTxBxF&lt;br /&gt;
&lt;br /&gt;
This returns the amount of curvature between the adjacent wagon pairs. It is useful for train vehicles that normally tilt in curves. The curvature is the difference in direction between the surrounding vehicles:&lt;br /&gt;
&lt;br /&gt;
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)&lt;br /&gt;
&lt;br /&gt;
B = for the back pair (current wagon to next wagon, 0 if wagon is last)&lt;br /&gt;
&lt;br /&gt;
T = for the triplet (previous wagon to next wagon; is zero in an S-bend)&lt;br /&gt;
&lt;br /&gt;
Possible values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Decimal!!Hex!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
| -4||C||180° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -3||D||135° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -2||E||90° curve left&lt;br /&gt;
|-&lt;br /&gt;
| -1||F||45° curve left&lt;br /&gt;
|-&lt;br /&gt;
|0||0||no curve&lt;br /&gt;
|-&lt;br /&gt;
|1||1||45° curve right&lt;br /&gt;
|-&lt;br /&gt;
|2||2||90° curve right&lt;br /&gt;
|-&lt;br /&gt;
|3||3||135° curve right (T only)&lt;br /&gt;
|-&lt;br /&gt;
|4||4||180° curve right (T only)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Motion counter (46) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 32-bit value&lt;br /&gt;
&lt;br /&gt;
This variable counts the amount of motion that a vehicle has done. &amp;amp;nbsp;It is only valid for the first vehicle in a consist (i.e. use VarAction2 type 82!). &amp;amp;nbsp;Its value is in units of 1/4096 of a tile. &amp;amp;nbsp;A vehicle actually moves visibly every time the motion counter increases by 256, and since a tile consists of 16 such subunits, 16*256=4096 motion units mean motion across one tile.&lt;br /&gt;
&lt;br /&gt;
The most useful way to access it is probably with &amp;amp;lt;shiftnum&amp;amp;gt;=08 and an appropriate &amp;amp;lt;andmask&amp;amp;gt;. &amp;amp;nbsp;For example, to achieve an animation with one frame per vehicle motion and 16 frames in total for motion across an entire tile, you would use &amp;amp;lt;shiftnum&amp;amp;gt;=08 and &amp;amp;lt;andmask&amp;amp;gt;=0F. &amp;amp;nbsp;For an animation with one frame every two vehicle motions and 4 frames total, use &amp;amp;lt;shiftnum&amp;amp;gt;=09 and &amp;amp;lt;andmask&amp;amp;gt;=03.&lt;br /&gt;
&lt;br /&gt;
If the vehicle is going very fast (&amp;amp;gt;160 mph for trains), it may move by several 1/16ths of a tile at once, and thus some frames may be skipped, but the animation will still remain in sync with the motion.&lt;br /&gt;
&lt;br /&gt;
Note that vehicle graphics are only updated every time the vehicle actually moves, so checking the lower byte is probably pointless, and only needed internally to achieve sufficient precision.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle cargo info (47) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; ccccwwtt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||the [[CargoTypes|cargo type]] transported by the vehicle (from the column for type A); translated if a translation table has been installed&lt;br /&gt;
|-&lt;br /&gt;
|ww||cargo unit weight in 1/16 tons, same as [[Action0Cargos#Weight of one unit of the cargo 0F|cargo prop. 0F]]&lt;br /&gt;
|-&lt;br /&gt;
|cccc||the [[Action0Cargos#Cargo classes 16|cargo class]] value of the cargo transported by the vehicle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that if the grf has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;tt&amp;quot; is the slot number in that table, irrespective of which actual slot or bit the cargo is using in the game. If a table has been installed, but the current cargo is not listed there, &amp;quot;tt&amp;quot; will be set to FF.&lt;br /&gt;
&lt;br /&gt;
Unlike variable 42, this variable returns the info of the current vehicle only, not the consist.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle type information (48) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxff&lt;br /&gt;
&lt;br /&gt;
The bits of ff are:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Vehicle type is available on the market&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicle type is in the testing phase&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Exclusive testing offer for a human player active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits in ff are undefined and must be masked out.&lt;br /&gt;
&lt;br /&gt;
=== Information about current railtype/roadtype/tramtype (4A) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxFFrr&lt;br /&gt;
&lt;br /&gt;
The lower byte (rr) contains the (translated) railtype/roadtype/tramtype the vehicle is currently driving on. &lt;br /&gt;
If the railtype/roadtype/tramtype has no entry in the railtype/roadtype/tramtype translation table of the GRF, this value will be 0xFF. &lt;br /&gt;
If no translation table is present, the raw value will be returned.&lt;br /&gt;
Note: only exact matches of rail-/road-/-tram-types are reported. If the translation table of the GRF does not contain the exact track-type 0xFF is returned, even if the translation table contains equivalent track-types (according to rail-/road-/tram-type property 1D). Use variable 63 to test for compatibility/poweredness/equivalency with track-types known to both the vehicle and the track-type NewGRF.&lt;br /&gt;
&lt;br /&gt;
The variable only reports about the tracks the vehicle is using: on a level crossing with rail, road and tram tracks, the vehicle (train, road vehicle, tram) can only query the track type it belongs to.&lt;br /&gt;
&lt;br /&gt;
The second byte (FF) contains the following flags:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The vehicle is/would be powered on the current railtype (this is independent from powered/non-powered wagon or anything)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|1.11|no|ottdrev=gf1bc4d840}} Set, if the track-type has catenary. This is independent of the vehicle: a NewGRF can define an engine as powered on non-electrified track (bit 0), and show a raised pantograph (bit 1) to look like a dual-powered engine. This bit is a simplified as it only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of catenaries, AC and DC voltages, ... use variable 63 instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
All other bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Position within articulated vehicle (4D) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||Position of vehicle (articulated part) within the articulated vehicle, counted from the first part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|bb||Position of vehicle (articulated part) within the articulated vehicle, counted from the last part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|xx||Reserved, do not access.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The total number of articulated parts of a vehicle equals ff + 1 + bb.&lt;br /&gt;
&lt;br /&gt;
For road vehicles &amp;quot;ff&amp;quot; and &amp;quot;bb&amp;quot; currently equal var 40, since there are no road vehicle wagons yet.&lt;br /&gt;
&lt;br /&gt;
=== Count Veh.ID occurence (60) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxnn&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the vehicle ID to look for, and the returned nn is the number of vehicles in the consist that have this ID. If used with VarAction2 type 81, only the current vehicle and onwards will be check, with VarAction2 type 82, all vehicles in the consist will be counted.&lt;br /&gt;
&lt;br /&gt;
=== Query variable of n-th vehicle in chain (61) ===&lt;br /&gt;
&lt;br /&gt;
This is a special variable to get the contents of another variable of a different vehicle in the vehicle chain. It is only supported for trains and road vehicles. It is not supported during a callback that is used to modify vehicle properties to avoid circular dependencies, which currently limits this variable to callbacks 1D, 2D, 31 and 32 plus outside callback scope.&lt;br /&gt;
&lt;br /&gt;
Temporary register 10F is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter specifies the variable to access and temporary register 10E is passed as the new 60+x parameter. Passing 61 as the variable is not allowed. Currently only vehicle specific variables listed on this page plus global variable 25 and {{ottdp|1.3|no|ottdrev=r24527}} 5F are accessible through var 61.&lt;br /&gt;
&lt;br /&gt;
The resulting value will have the size of whatever variable is queried.&lt;br /&gt;
&lt;br /&gt;
=== Curvature/position difference for n-th vehicle in chain (62) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; zzyyxxFD&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The lowest nibble (D) contains the direction difference between the selected vehicle and this vehicle, the possible values are identical to those of [[#Curvature_info_.2845.29|variable 45]].&lt;br /&gt;
&lt;br /&gt;
The next nibble (F) has the following meaning:&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The vehicle is currently hidden&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The upper three bytes contain the signed difference of the X/Y/Z position between the selected vehicle and this vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Track-type test against another track-type (63) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.11|no|ottdrev=g868d84bbf}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxFF&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is an index into the rail-/road-/tram-type translation table.&lt;br /&gt;
The result value reports how vehicles of this type would behave on the current tile.&lt;br /&gt;
This allows vehicles to behave or look differently on various track-types independent of their own track-type.&lt;br /&gt;
&lt;br /&gt;
The lower byte (FF) contains some flags:&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The track-type from the 60+x parameter is known. If unset, all other flags are unset as well, no information can be given.&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicles with type from the 60+x parameter are compatible with the track on the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Vehicles with type from the 60+x parameter are powered on the track of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The track-type from the 60+x parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the track-type of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Test if rail or road type of the current tile occupied by the vehicle has that specific badge attached (65) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
This variable only works for trains and road vehicles.&lt;br /&gt;
The specifications are the same as for [[#Test_if_the_vehicle_has_that_specific_badge_attached.287A.29|variable 7A]].&lt;br /&gt;
&lt;br /&gt;
=== Test if the vehicle has that specific badge attached (7A) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the index into the badge table.&lt;br /&gt;
The returned value is in range [0, 1].&lt;br /&gt;
&lt;br /&gt;
=== Modflags (FE and FF) ===&lt;br /&gt;
&lt;br /&gt;
The bits in FE mostly relate to gradualloading. &amp;amp;nbsp;A few useful bits for grf authors are;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Version!!Value of the bit&lt;br /&gt;
|-&lt;br /&gt;
|1||{{ottdp|1.5|2.5|ottdrev=r26430}}||Vehicle is still unloading and has not yet started loading new cargo at the current station.&lt;br /&gt;
|-&lt;br /&gt;
|5||{{ottdp|0.6|2.5}}||Vehicle is powered (engine or powered wagon, mainly useful for the latter)&lt;br /&gt;
|-&lt;br /&gt;
|6||{{ottdp|0.6|2.5}}||Vehicle would be powered (engine or powered wagon) if there were suitable track. (E.g. electric train in mixed train on normal track)&lt;br /&gt;
|-&lt;br /&gt;
|8 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottdp|0.6|2.5}}||This bit is flipped every time the train reverses direction&lt;br /&gt;
|-&lt;br /&gt;
|10||{{ottdp|0.6|2.5|ttdprev=r1334}}||Vehicle was built during the exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
|11 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottd|16}}||The train is driving backwards (trains only)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable FF is actually the high byte of variable FE, so FE bit 8 is the same as FF bit 0.&lt;br /&gt;
&lt;br /&gt;
Other bits are reserved; most are actually used for TTDPatch internal states.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5251</id>
		<title>VariationalAction2/Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5251"/>
		<updated>2026-06-05T07:43:33Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Test if rail or road type of the current type occupied by the vehicle has that specific badge attached (65) */&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;{{NFONavVehicles}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Variable!![[GRFActionsDetailed|Size]]!!Version!!Description!!Available in purchase list&lt;br /&gt;
|-&lt;br /&gt;
|10||D||{{ottdp|1.2|no|ottdrev=r23080}}||Pick sprites for different GUI windows - See [[Action2/Vehicles]].||{{ottdp|1.2|no|ottdrev=r23080}}&lt;br /&gt;
|-&lt;br /&gt;
|40||D||{{ottdp|0.6|2.5}}||Position in consist and length of consist||no&lt;br /&gt;
|-&lt;br /&gt;
|41||D||{{ottdp|0.6|2.5}}||Position in and length of chain of consecutive vehicles with same ID||no&lt;br /&gt;
|-&lt;br /&gt;
|42||D||{{ottdp|0.6|2.5}}||Cargo types transported by consist||no&lt;br /&gt;
|-&lt;br /&gt;
|43||D||{{ottdp|0.6|2.5}}||Player info||{{ottdp|0.6|2.5|ottdrev=r4611|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 48}}||Aircraft info||no&lt;br /&gt;
|-&lt;br /&gt;
|45||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 58}}||Curvature info||no&lt;br /&gt;
|-&lt;br /&gt;
|46||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 59}}||Motion counter||no&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.6|2.5}}||Vehicle cargo info||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot;&amp;gt;Variable 47 refers to the default cargo of the vehicle, when in purchase list. This differs from the cargo used in Action 3, which is 0xFF in purchase list. The &amp;quot;refit cycle&amp;quot; (F2) is currently always zero in the purchase list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|48||D||{{ottdp|0.6|2.5}}||Vehicle type information||{{ottdp|0.6|2.5|ottdrev=r5338|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|49||D||{{ottdp|0.7|2.6|ottdrev=r13376|ttdprev=r2216}}||Year of construction (long format, 0 based)||{{ottdp|0.7|no|ottdrev=r13376}} &amp;lt;ref name=&amp;quot;date&amp;quot;&amp;gt;This is the current date&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4A||D||{{ottdp|1.1|no|ottdrev=r20165}}||Info about current railtype/roadtype/tramtype||no&lt;br /&gt;
|-&lt;br /&gt;
|4B||D||{{ottdp|1.2|no|ottdrev=r23068}}||Long date of last servicing||{{ottdp|1.2|no|ottdrev=r23068}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4C||D||{{ottdp|1.3|no|ottdrev=r24246}}||Current max speed including e.g track or timetable speed limits. Only valid for front vehicle. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot;&amp;gt;See [[Action0Trains#Speed 09|train property 09]], [[Action0RoadVehicles|road vehicle property 08]] (not 15, even when using realistic acceleration), [[Action0Ships|ship property 0B]] and [[Action0Planes|aircraft property 0C]].&amp;lt;/ref&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|4D||D||{{ottdp|1.4|no|ottdrev=r26157}}||Position within articulated vehicle||no&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 57}}||Count Veh.ID occurence||no&lt;br /&gt;
|-&lt;br /&gt;
|61||-&amp;lt;ref&amp;gt;The size of the result matches the size of the queried variable.&amp;lt;/ref&amp;gt;||{{ottdp|1.2|no|ottdrev=r22997}}||Query variable of n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|1.2|no|ottdrev=r22998}}||Curvature/position difference for n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|63||D||{{ottdp|1.11|no|ottdrev=g868d84bbf}}||Test track-type of tile against another track-type||no&lt;br /&gt;
|-&lt;br /&gt;
|65||D||{{ottdp|15|no}}||Test if rail or road type of the current type occupied by the vehicle has that specific badge attached||no&lt;br /&gt;
|-&lt;br /&gt;
|7A||D||{{ottdp|15|no}}||Test if the vehicle has that specific badge attached||yes&lt;br /&gt;
|-&lt;br /&gt;
|97||B||{{ottdp|0.6|2.0}}||Tick counter, increased every engine tick||no&lt;br /&gt;
|-&lt;br /&gt;
|B2||W||||Vehicle status: bit0 = vehicle invisible (in tunnel/depot), bit1 = stopped, bit7 = crashed||no&lt;br /&gt;
|-&lt;br /&gt;
|B4||W||{{ottdp|0.6|2.0}}||Current speed. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot; /&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|B9||B||{{ottdp|0.6|2.0}}||Cargo type (type B from the list at [[CargoTypes]]; climate dependent)||no&lt;br /&gt;
|-&lt;br /&gt;
|C0||W||{{ottdp|0.6|2.0}}||Engine age in days&amp;lt;br/&amp;gt;{{ottdp|1.2|2.5|ottdrev=r22816|ttdprev=alpha 61}} Valid for wagons and articulated parts as well.||no&lt;br /&gt;
|-&lt;br /&gt;
|C4||B||{{ottdp|0.6|2.0}}||Year built (counted from 1920), note this is modified when Cht: Year is used||{{ottdp|0.6|no|ottdrev=r4611}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|C6||W||{{ottdp|0.6|2.0}}||Vehicle type ID &amp;lt;ref&amp;gt;{{ottdp|0.7|no}} In OpenTTD 0.7 and newer this is the GRF-local ID of the vehicle. Earlier versions of OpenTTD and TTDPatch report the [[VehicleIDs|TTD ID]]. For trains this is the same; for other vehicle types they differ.&amp;lt;/ref&amp;gt; (useful for [[Callbacks#Can wagon be attached (1D)|Callback 1D]])||no&lt;br /&gt;
|-&lt;br /&gt;
|C8||B||{{ottdp|0.6|2.0}}||Sprite type; FD for trains forward, FE or FF when reversed||no&lt;br /&gt;
|-&lt;br /&gt;
|C9||B||{{ottdp|0.6|2.0}}||Day counter; increased daily||no&lt;br /&gt;
|-&lt;br /&gt;
|DA||W||{{ottdp|0.6|2.0}}||Next wagon index, FFFF if last wagon (use shift-num=08 and check for FF)||no&lt;br /&gt;
|-&lt;br /&gt;
|F2||B||{{ottdp|0.6|2.5}}||Refit cycle, how many times refitted to the same cargo type||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|F4||D||{{ottdp|0.5|2.0|ottdrev=3594}}||Current horsepower of train consist||no&lt;br /&gt;
|-&lt;br /&gt;
|FE||W||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|-&lt;br /&gt;
|FF||B||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_VehicleArray TTD vehicle structure].&lt;br /&gt;
&lt;br /&gt;
Variables 40, 41, 42 and 43 are cached. This means that while they are in principle computationally expensive, they can be used without impacting performance. Variables 45 and 60 are also computationally expensive but cannot be cached, and should therefore be used sparingly. If possible 80+x variables are to be preferred.&lt;br /&gt;
&lt;br /&gt;
Cached variables are updated when the game is loaded, when the consist enters or is rearranged in a depot, and when the train reverses.&lt;br /&gt;
&lt;br /&gt;
In the purchase list only a few variables are available. Especially the front vehicle (related object) cannot be accessed, nor other articulated parts.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
=== Position and length (40, 41) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 00nnbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||position of vehicle within the consist counted from the engine (front), e.g. the engine would have ff=0, the 1st wagon or mail compartment of planes would have ff=1, the 2nd wagon or the rotor of helicopters would have ff=2, the 3rd wagon would have ff=3 etc&lt;br /&gt;
|-&lt;br /&gt;
|bb||same as ff, but counted from the end, i.e. the last wagon has bb=0, the next-to-last wagon has bb=1 etc.&lt;br /&gt;
|-&lt;br /&gt;
|nn||Total number of vehicles in the consist, including shadow and rotor for aircraft.&lt;br /&gt;
* In var 40 this is zero-based. That is, the value returned is one less than the actual number of vehicles. A train with engine and three wagons has nn=3.&lt;br /&gt;
* In var 41 this is one-based. That is, the value returned is the actual number of vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For variable 40, these numbers refer to the whole consist, but for variable 41, they only refer to the chain of consecutive vehicles with the same ID as the current wagon (including itself, but possibly excluding the engine):&lt;br /&gt;
&lt;br /&gt;
[[File:vehicle_var40_41.png]]&lt;br /&gt;
&lt;br /&gt;
Note however, that accessing the &amp;quot;related&amp;quot; object (i.e. the locomotive) doesn´t make much sense for vars 40/41, except for var40 when in a [[Callbacks#Can wagon be attached 1D|callback 1D]] chain.&lt;br /&gt;
&lt;br /&gt;
=== Consist cargo (42) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; uuiicctt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||a bit mask of all [[Action0Cargos#Cargo classes 16|cargo classes]] transported by the consist&lt;br /&gt;
|-&lt;br /&gt;
|cc||the most common [[CargoTypes|cargo type]] (from the column for type A)&lt;br /&gt;
|-&lt;br /&gt;
|ii||the most common refit cycle (var. F2) of cargo type cc&lt;br /&gt;
|-&lt;br /&gt;
|uu||the result of ORing the bits of prop. 25 from all vehicles in the train&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If used with VarAction2 type 81 (vehicle) it returns only cargo from this vehicle on, with type 82 (engine) that of the whole consist.&lt;br /&gt;
See also variable 47 for more details on the cargo carried by a vehicle.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} For GRF versions 7 and before &amp;quot;cc&amp;quot; is the untranslated bit number from [[Action0/Cargos#Bit_number_for_bitmasks_.2808.29|cargo property 8]].&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} With GRF version 8 the meaning of &amp;quot;cc&amp;quot; changes. If the grf file has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;cc&amp;quot; is the index of the cargo in that table; or FF if the cargo is not present in the table.&lt;br /&gt;
&lt;br /&gt;
=== Player info (43) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; Ccttmmnn&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|nn||the number of the current player from 0 to 7 (up to E (14) in OpenTTD since r14735)&lt;br /&gt;
|-&lt;br /&gt;
|mm||the multiplayer player number with the host player (or the single player) being 0 and the client player being 1&lt;br /&gt;
|-&lt;br /&gt;
|tt||the player type, see below for possible values&lt;br /&gt;
|-&lt;br /&gt;
|c||the primary player colour&lt;br /&gt;
|-&lt;br /&gt;
|C||{{ottdp|0.6|2.5|ttdprev=r1405}} the secondary player colour, equal to c if none (since r1405)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!tt value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||Player is human player (permanent company)&lt;br /&gt;
|-&lt;br /&gt;
|1||Player is AI player (not managed)&lt;br /&gt;
|-&lt;br /&gt;
|2||{{ottdp|no|2.5}} Player is a human managing an AI company&lt;br /&gt;
|-&lt;br /&gt;
|3||{{ottdp|no|2.5}} Player is human player&#039;s original company, now temporarily AI controlled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=r1497}} Since r1497, when the vehicle sprite is being displayed in an exclusive offer window or new vehicle news message, or in other circumstances when no player is associated with the vehicle, nn will be FF.&lt;br /&gt;
&lt;br /&gt;
=== Aircraft info (44) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxhhtt&lt;br /&gt;
&lt;br /&gt;
hh is the height of the aircraft above ground, or more properly above the height of its shadow. Buildings, including the heliport, don&#039;t count as &amp;quot;ground&amp;quot;, i.e. to get the height above a heliport, you have to subtract the heliport height from hh.&lt;br /&gt;
&lt;br /&gt;
tt is the type of the current airport: 0=small, 1=large, 2=heliport, 3=oil rig. The current airport is the target airport for aircraft that have finished the ascent and are in flight.&lt;br /&gt;
&lt;br /&gt;
=== Curvature info (45) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxTxBxF&lt;br /&gt;
&lt;br /&gt;
This returns the amount of curvature between the adjacent wagon pairs. It is useful for train vehicles that normally tilt in curves. The curvature is the difference in direction between the surrounding vehicles:&lt;br /&gt;
&lt;br /&gt;
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)&lt;br /&gt;
&lt;br /&gt;
B = for the back pair (current wagon to next wagon, 0 if wagon is last)&lt;br /&gt;
&lt;br /&gt;
T = for the triplet (previous wagon to next wagon; is zero in an S-bend)&lt;br /&gt;
&lt;br /&gt;
Possible values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Decimal!!Hex!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
| -4||C||180° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -3||D||135° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -2||E||90° curve left&lt;br /&gt;
|-&lt;br /&gt;
| -1||F||45° curve left&lt;br /&gt;
|-&lt;br /&gt;
|0||0||no curve&lt;br /&gt;
|-&lt;br /&gt;
|1||1||45° curve right&lt;br /&gt;
|-&lt;br /&gt;
|2||2||90° curve right&lt;br /&gt;
|-&lt;br /&gt;
|3||3||135° curve right (T only)&lt;br /&gt;
|-&lt;br /&gt;
|4||4||180° curve right (T only)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Motion counter (46) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 32-bit value&lt;br /&gt;
&lt;br /&gt;
This variable counts the amount of motion that a vehicle has done. &amp;amp;nbsp;It is only valid for the first vehicle in a consist (i.e. use VarAction2 type 82!). &amp;amp;nbsp;Its value is in units of 1/4096 of a tile. &amp;amp;nbsp;A vehicle actually moves visibly every time the motion counter increases by 256, and since a tile consists of 16 such subunits, 16*256=4096 motion units mean motion across one tile.&lt;br /&gt;
&lt;br /&gt;
The most useful way to access it is probably with &amp;amp;lt;shiftnum&amp;amp;gt;=08 and an appropriate &amp;amp;lt;andmask&amp;amp;gt;. &amp;amp;nbsp;For example, to achieve an animation with one frame per vehicle motion and 16 frames in total for motion across an entire tile, you would use &amp;amp;lt;shiftnum&amp;amp;gt;=08 and &amp;amp;lt;andmask&amp;amp;gt;=0F. &amp;amp;nbsp;For an animation with one frame every two vehicle motions and 4 frames total, use &amp;amp;lt;shiftnum&amp;amp;gt;=09 and &amp;amp;lt;andmask&amp;amp;gt;=03.&lt;br /&gt;
&lt;br /&gt;
If the vehicle is going very fast (&amp;amp;gt;160 mph for trains), it may move by several 1/16ths of a tile at once, and thus some frames may be skipped, but the animation will still remain in sync with the motion.&lt;br /&gt;
&lt;br /&gt;
Note that vehicle graphics are only updated every time the vehicle actually moves, so checking the lower byte is probably pointless, and only needed internally to achieve sufficient precision.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle cargo info (47) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; ccccwwtt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||the [[CargoTypes|cargo type]] transported by the vehicle (from the column for type A); translated if a translation table has been installed&lt;br /&gt;
|-&lt;br /&gt;
|ww||cargo unit weight in 1/16 tons, same as [[Action0Cargos#Weight of one unit of the cargo 0F|cargo prop. 0F]]&lt;br /&gt;
|-&lt;br /&gt;
|cccc||the [[Action0Cargos#Cargo classes 16|cargo class]] value of the cargo transported by the vehicle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that if the grf has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;tt&amp;quot; is the slot number in that table, irrespective of which actual slot or bit the cargo is using in the game. If a table has been installed, but the current cargo is not listed there, &amp;quot;tt&amp;quot; will be set to FF.&lt;br /&gt;
&lt;br /&gt;
Unlike variable 42, this variable returns the info of the current vehicle only, not the consist.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle type information (48) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxff&lt;br /&gt;
&lt;br /&gt;
The bits of ff are:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Vehicle type is available on the market&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicle type is in the testing phase&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Exclusive testing offer for a human player active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits in ff are undefined and must be masked out.&lt;br /&gt;
&lt;br /&gt;
=== Information about current railtype/roadtype/tramtype (4A) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxFFrr&lt;br /&gt;
&lt;br /&gt;
The lower byte (rr) contains the (translated) railtype/roadtype/tramtype the vehicle is currently driving on. &lt;br /&gt;
If the railtype/roadtype/tramtype has no entry in the railtype/roadtype/tramtype translation table of the GRF, this value will be 0xFF. &lt;br /&gt;
If no translation table is present, the raw value will be returned.&lt;br /&gt;
Note: only exact matches of rail-/road-/-tram-types are reported. If the translation table of the GRF does not contain the exact track-type 0xFF is returned, even if the translation table contains equivalent track-types (according to rail-/road-/tram-type property 1D). Use variable 63 to test for compatibility/poweredness/equivalency with track-types known to both the vehicle and the track-type NewGRF.&lt;br /&gt;
&lt;br /&gt;
The variable only reports about the tracks the vehicle is using: on a level crossing with rail, road and tram tracks, the vehicle (train, road vehicle, tram) can only query the track type it belongs to.&lt;br /&gt;
&lt;br /&gt;
The second byte (FF) contains the following flags:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The vehicle is/would be powered on the current railtype (this is independent from powered/non-powered wagon or anything)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|1.11|no|ottdrev=gf1bc4d840}} Set, if the track-type has catenary. This is independent of the vehicle: a NewGRF can define an engine as powered on non-electrified track (bit 0), and show a raised pantograph (bit 1) to look like a dual-powered engine. This bit is a simplified as it only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of catenaries, AC and DC voltages, ... use variable 63 instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
All other bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Position within articulated vehicle (4D) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||Position of vehicle (articulated part) within the articulated vehicle, counted from the first part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|bb||Position of vehicle (articulated part) within the articulated vehicle, counted from the last part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|xx||Reserved, do not access.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The total number of articulated parts of a vehicle equals ff + 1 + bb.&lt;br /&gt;
&lt;br /&gt;
For road vehicles &amp;quot;ff&amp;quot; and &amp;quot;bb&amp;quot; currently equal var 40, since there are no road vehicle wagons yet.&lt;br /&gt;
&lt;br /&gt;
=== Count Veh.ID occurence (60) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxnn&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the vehicle ID to look for, and the returned nn is the number of vehicles in the consist that have this ID. If used with VarAction2 type 81, only the current vehicle and onwards will be check, with VarAction2 type 82, all vehicles in the consist will be counted.&lt;br /&gt;
&lt;br /&gt;
=== Query variable of n-th vehicle in chain (61) ===&lt;br /&gt;
&lt;br /&gt;
This is a special variable to get the contents of another variable of a different vehicle in the vehicle chain. It is only supported for trains and road vehicles. It is not supported during a callback that is used to modify vehicle properties to avoid circular dependencies, which currently limits this variable to callbacks 1D, 2D, 31 and 32 plus outside callback scope.&lt;br /&gt;
&lt;br /&gt;
Temporary register 10F is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter specifies the variable to access and temporary register 10E is passed as the new 60+x parameter. Passing 61 as the variable is not allowed. Currently only vehicle specific variables listed on this page plus global variable 25 and {{ottdp|1.3|no|ottdrev=r24527}} 5F are accessible through var 61.&lt;br /&gt;
&lt;br /&gt;
The resulting value will have the size of whatever variable is queried.&lt;br /&gt;
&lt;br /&gt;
=== Curvature/position difference for n-th vehicle in chain (62) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; zzyyxxFD&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The lowest nibble (D) contains the direction difference between the selected vehicle and this vehicle, the possible values are identical to those of [[#Curvature_info_.2845.29|variable 45]].&lt;br /&gt;
&lt;br /&gt;
The next nibble (F) has the following meaning:&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The vehicle is currently hidden&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The upper three bytes contain the signed difference of the X/Y/Z position between the selected vehicle and this vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Track-type test against another track-type (63) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.11|no|ottdrev=g868d84bbf}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxFF&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is an index into the rail-/road-/tram-type translation table.&lt;br /&gt;
The result value reports how vehicles of this type would behave on the current tile.&lt;br /&gt;
This allows vehicles to behave or look differently on various track-types independent of their own track-type.&lt;br /&gt;
&lt;br /&gt;
The lower byte (FF) contains some flags:&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The track-type from the 60+x parameter is known. If unset, all other flags are unset as well, no information can be given.&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicles with type from the 60+x parameter are compatible with the track on the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Vehicles with type from the 60+x parameter are powered on the track of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The track-type from the 60+x parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the track-type of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Test if rail or road type of the current type occupied by the vehicle has that specific badge attached (65) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
This variable only works for trains and road vehicles.&lt;br /&gt;
The specifications are the same as for [[#Test_if_the_vehicle_has_that_specific_badge_attached.287A.29|variable 7A]].&lt;br /&gt;
&lt;br /&gt;
=== Test if the vehicle has that specific badge attached (7A) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the index into the badge table.&lt;br /&gt;
The returned value is in range [0, 1].&lt;br /&gt;
&lt;br /&gt;
=== Modflags (FE and FF) ===&lt;br /&gt;
&lt;br /&gt;
The bits in FE mostly relate to gradualloading. &amp;amp;nbsp;A few useful bits for grf authors are;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Version!!Value of the bit&lt;br /&gt;
|-&lt;br /&gt;
|1||{{ottdp|1.5|2.5|ottdrev=r26430}}||Vehicle is still unloading and has not yet started loading new cargo at the current station.&lt;br /&gt;
|-&lt;br /&gt;
|5||{{ottdp|0.6|2.5}}||Vehicle is powered (engine or powered wagon, mainly useful for the latter)&lt;br /&gt;
|-&lt;br /&gt;
|6||{{ottdp|0.6|2.5}}||Vehicle would be powered (engine or powered wagon) if there were suitable track. (E.g. electric train in mixed train on normal track)&lt;br /&gt;
|-&lt;br /&gt;
|8 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottdp|0.6|2.5}}||This bit is flipped every time the train reverses direction&lt;br /&gt;
|-&lt;br /&gt;
|10||{{ottdp|0.6|2.5|ttdprev=r1334}}||Vehicle was built during the exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
|11 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottd|16}}||The train is driving backwards (trains only)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable FF is actually the high byte of variable FE, so FE bit 8 is the same as FF bit 0.&lt;br /&gt;
&lt;br /&gt;
Other bits are reserved; most are actually used for TTDPatch internal states.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5250</id>
		<title>VariationalAction2/Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5250"/>
		<updated>2026-06-05T07:41:35Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Add variables 7A and 65.&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;{{NFONavVehicles}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Variable!![[GRFActionsDetailed|Size]]!!Version!!Description!!Available in purchase list&lt;br /&gt;
|-&lt;br /&gt;
|10||D||{{ottdp|1.2|no|ottdrev=r23080}}||Pick sprites for different GUI windows - See [[Action2/Vehicles]].||{{ottdp|1.2|no|ottdrev=r23080}}&lt;br /&gt;
|-&lt;br /&gt;
|40||D||{{ottdp|0.6|2.5}}||Position in consist and length of consist||no&lt;br /&gt;
|-&lt;br /&gt;
|41||D||{{ottdp|0.6|2.5}}||Position in and length of chain of consecutive vehicles with same ID||no&lt;br /&gt;
|-&lt;br /&gt;
|42||D||{{ottdp|0.6|2.5}}||Cargo types transported by consist||no&lt;br /&gt;
|-&lt;br /&gt;
|43||D||{{ottdp|0.6|2.5}}||Player info||{{ottdp|0.6|2.5|ottdrev=r4611|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 48}}||Aircraft info||no&lt;br /&gt;
|-&lt;br /&gt;
|45||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 58}}||Curvature info||no&lt;br /&gt;
|-&lt;br /&gt;
|46||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 59}}||Motion counter||no&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.6|2.5}}||Vehicle cargo info||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot;&amp;gt;Variable 47 refers to the default cargo of the vehicle, when in purchase list. This differs from the cargo used in Action 3, which is 0xFF in purchase list. The &amp;quot;refit cycle&amp;quot; (F2) is currently always zero in the purchase list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|48||D||{{ottdp|0.6|2.5}}||Vehicle type information||{{ottdp|0.6|2.5|ottdrev=r5338|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|49||D||{{ottdp|0.7|2.6|ottdrev=r13376|ttdprev=r2216}}||Year of construction (long format, 0 based)||{{ottdp|0.7|no|ottdrev=r13376}} &amp;lt;ref name=&amp;quot;date&amp;quot;&amp;gt;This is the current date&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4A||D||{{ottdp|1.1|no|ottdrev=r20165}}||Info about current railtype/roadtype/tramtype||no&lt;br /&gt;
|-&lt;br /&gt;
|4B||D||{{ottdp|1.2|no|ottdrev=r23068}}||Long date of last servicing||{{ottdp|1.2|no|ottdrev=r23068}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4C||D||{{ottdp|1.3|no|ottdrev=r24246}}||Current max speed including e.g track or timetable speed limits. Only valid for front vehicle. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot;&amp;gt;See [[Action0Trains#Speed 09|train property 09]], [[Action0RoadVehicles|road vehicle property 08]] (not 15, even when using realistic acceleration), [[Action0Ships|ship property 0B]] and [[Action0Planes|aircraft property 0C]].&amp;lt;/ref&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|4D||D||{{ottdp|1.4|no|ottdrev=r26157}}||Position within articulated vehicle||no&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 57}}||Count Veh.ID occurence||no&lt;br /&gt;
|-&lt;br /&gt;
|61||-&amp;lt;ref&amp;gt;The size of the result matches the size of the queried variable.&amp;lt;/ref&amp;gt;||{{ottdp|1.2|no|ottdrev=r22997}}||Query variable of n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|1.2|no|ottdrev=r22998}}||Curvature/position difference for n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|63||D||{{ottdp|1.11|no|ottdrev=g868d84bbf}}||Test track-type of tile against another track-type||no&lt;br /&gt;
|-&lt;br /&gt;
|65||D||{{ottdp|15|no}}||Test if rail or road type of the current type occupied by the vehicle has that specific badge attached||no&lt;br /&gt;
|-&lt;br /&gt;
|7A||D||{{ottdp|15|no}}||Test if the vehicle has that specific badge attached||yes&lt;br /&gt;
|-&lt;br /&gt;
|97||B||{{ottdp|0.6|2.0}}||Tick counter, increased every engine tick||no&lt;br /&gt;
|-&lt;br /&gt;
|B2||W||||Vehicle status: bit0 = vehicle invisible (in tunnel/depot), bit1 = stopped, bit7 = crashed||no&lt;br /&gt;
|-&lt;br /&gt;
|B4||W||{{ottdp|0.6|2.0}}||Current speed. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot; /&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|B9||B||{{ottdp|0.6|2.0}}||Cargo type (type B from the list at [[CargoTypes]]; climate dependent)||no&lt;br /&gt;
|-&lt;br /&gt;
|C0||W||{{ottdp|0.6|2.0}}||Engine age in days&amp;lt;br/&amp;gt;{{ottdp|1.2|2.5|ottdrev=r22816|ttdprev=alpha 61}} Valid for wagons and articulated parts as well.||no&lt;br /&gt;
|-&lt;br /&gt;
|C4||B||{{ottdp|0.6|2.0}}||Year built (counted from 1920), note this is modified when Cht: Year is used||{{ottdp|0.6|no|ottdrev=r4611}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|C6||W||{{ottdp|0.6|2.0}}||Vehicle type ID &amp;lt;ref&amp;gt;{{ottdp|0.7|no}} In OpenTTD 0.7 and newer this is the GRF-local ID of the vehicle. Earlier versions of OpenTTD and TTDPatch report the [[VehicleIDs|TTD ID]]. For trains this is the same; for other vehicle types they differ.&amp;lt;/ref&amp;gt; (useful for [[Callbacks#Can wagon be attached (1D)|Callback 1D]])||no&lt;br /&gt;
|-&lt;br /&gt;
|C8||B||{{ottdp|0.6|2.0}}||Sprite type; FD for trains forward, FE or FF when reversed||no&lt;br /&gt;
|-&lt;br /&gt;
|C9||B||{{ottdp|0.6|2.0}}||Day counter; increased daily||no&lt;br /&gt;
|-&lt;br /&gt;
|DA||W||{{ottdp|0.6|2.0}}||Next wagon index, FFFF if last wagon (use shift-num=08 and check for FF)||no&lt;br /&gt;
|-&lt;br /&gt;
|F2||B||{{ottdp|0.6|2.5}}||Refit cycle, how many times refitted to the same cargo type||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|F4||D||{{ottdp|0.5|2.0|ottdrev=3594}}||Current horsepower of train consist||no&lt;br /&gt;
|-&lt;br /&gt;
|FE||W||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|-&lt;br /&gt;
|FF||B||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_VehicleArray TTD vehicle structure].&lt;br /&gt;
&lt;br /&gt;
Variables 40, 41, 42 and 43 are cached. This means that while they are in principle computationally expensive, they can be used without impacting performance. Variables 45 and 60 are also computationally expensive but cannot be cached, and should therefore be used sparingly. If possible 80+x variables are to be preferred.&lt;br /&gt;
&lt;br /&gt;
Cached variables are updated when the game is loaded, when the consist enters or is rearranged in a depot, and when the train reverses.&lt;br /&gt;
&lt;br /&gt;
In the purchase list only a few variables are available. Especially the front vehicle (related object) cannot be accessed, nor other articulated parts.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
=== Position and length (40, 41) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 00nnbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||position of vehicle within the consist counted from the engine (front), e.g. the engine would have ff=0, the 1st wagon or mail compartment of planes would have ff=1, the 2nd wagon or the rotor of helicopters would have ff=2, the 3rd wagon would have ff=3 etc&lt;br /&gt;
|-&lt;br /&gt;
|bb||same as ff, but counted from the end, i.e. the last wagon has bb=0, the next-to-last wagon has bb=1 etc.&lt;br /&gt;
|-&lt;br /&gt;
|nn||Total number of vehicles in the consist, including shadow and rotor for aircraft.&lt;br /&gt;
* In var 40 this is zero-based. That is, the value returned is one less than the actual number of vehicles. A train with engine and three wagons has nn=3.&lt;br /&gt;
* In var 41 this is one-based. That is, the value returned is the actual number of vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For variable 40, these numbers refer to the whole consist, but for variable 41, they only refer to the chain of consecutive vehicles with the same ID as the current wagon (including itself, but possibly excluding the engine):&lt;br /&gt;
&lt;br /&gt;
[[File:vehicle_var40_41.png]]&lt;br /&gt;
&lt;br /&gt;
Note however, that accessing the &amp;quot;related&amp;quot; object (i.e. the locomotive) doesn´t make much sense for vars 40/41, except for var40 when in a [[Callbacks#Can wagon be attached 1D|callback 1D]] chain.&lt;br /&gt;
&lt;br /&gt;
=== Consist cargo (42) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; uuiicctt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||a bit mask of all [[Action0Cargos#Cargo classes 16|cargo classes]] transported by the consist&lt;br /&gt;
|-&lt;br /&gt;
|cc||the most common [[CargoTypes|cargo type]] (from the column for type A)&lt;br /&gt;
|-&lt;br /&gt;
|ii||the most common refit cycle (var. F2) of cargo type cc&lt;br /&gt;
|-&lt;br /&gt;
|uu||the result of ORing the bits of prop. 25 from all vehicles in the train&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If used with VarAction2 type 81 (vehicle) it returns only cargo from this vehicle on, with type 82 (engine) that of the whole consist.&lt;br /&gt;
See also variable 47 for more details on the cargo carried by a vehicle.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} For GRF versions 7 and before &amp;quot;cc&amp;quot; is the untranslated bit number from [[Action0/Cargos#Bit_number_for_bitmasks_.2808.29|cargo property 8]].&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} With GRF version 8 the meaning of &amp;quot;cc&amp;quot; changes. If the grf file has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;cc&amp;quot; is the index of the cargo in that table; or FF if the cargo is not present in the table.&lt;br /&gt;
&lt;br /&gt;
=== Player info (43) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; Ccttmmnn&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|nn||the number of the current player from 0 to 7 (up to E (14) in OpenTTD since r14735)&lt;br /&gt;
|-&lt;br /&gt;
|mm||the multiplayer player number with the host player (or the single player) being 0 and the client player being 1&lt;br /&gt;
|-&lt;br /&gt;
|tt||the player type, see below for possible values&lt;br /&gt;
|-&lt;br /&gt;
|c||the primary player colour&lt;br /&gt;
|-&lt;br /&gt;
|C||{{ottdp|0.6|2.5|ttdprev=r1405}} the secondary player colour, equal to c if none (since r1405)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!tt value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||Player is human player (permanent company)&lt;br /&gt;
|-&lt;br /&gt;
|1||Player is AI player (not managed)&lt;br /&gt;
|-&lt;br /&gt;
|2||{{ottdp|no|2.5}} Player is a human managing an AI company&lt;br /&gt;
|-&lt;br /&gt;
|3||{{ottdp|no|2.5}} Player is human player&#039;s original company, now temporarily AI controlled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=r1497}} Since r1497, when the vehicle sprite is being displayed in an exclusive offer window or new vehicle news message, or in other circumstances when no player is associated with the vehicle, nn will be FF.&lt;br /&gt;
&lt;br /&gt;
=== Aircraft info (44) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxhhtt&lt;br /&gt;
&lt;br /&gt;
hh is the height of the aircraft above ground, or more properly above the height of its shadow. Buildings, including the heliport, don&#039;t count as &amp;quot;ground&amp;quot;, i.e. to get the height above a heliport, you have to subtract the heliport height from hh.&lt;br /&gt;
&lt;br /&gt;
tt is the type of the current airport: 0=small, 1=large, 2=heliport, 3=oil rig. The current airport is the target airport for aircraft that have finished the ascent and are in flight.&lt;br /&gt;
&lt;br /&gt;
=== Curvature info (45) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxTxBxF&lt;br /&gt;
&lt;br /&gt;
This returns the amount of curvature between the adjacent wagon pairs. It is useful for train vehicles that normally tilt in curves. The curvature is the difference in direction between the surrounding vehicles:&lt;br /&gt;
&lt;br /&gt;
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)&lt;br /&gt;
&lt;br /&gt;
B = for the back pair (current wagon to next wagon, 0 if wagon is last)&lt;br /&gt;
&lt;br /&gt;
T = for the triplet (previous wagon to next wagon; is zero in an S-bend)&lt;br /&gt;
&lt;br /&gt;
Possible values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Decimal!!Hex!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
| -4||C||180° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -3||D||135° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -2||E||90° curve left&lt;br /&gt;
|-&lt;br /&gt;
| -1||F||45° curve left&lt;br /&gt;
|-&lt;br /&gt;
|0||0||no curve&lt;br /&gt;
|-&lt;br /&gt;
|1||1||45° curve right&lt;br /&gt;
|-&lt;br /&gt;
|2||2||90° curve right&lt;br /&gt;
|-&lt;br /&gt;
|3||3||135° curve right (T only)&lt;br /&gt;
|-&lt;br /&gt;
|4||4||180° curve right (T only)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Motion counter (46) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 32-bit value&lt;br /&gt;
&lt;br /&gt;
This variable counts the amount of motion that a vehicle has done. &amp;amp;nbsp;It is only valid for the first vehicle in a consist (i.e. use VarAction2 type 82!). &amp;amp;nbsp;Its value is in units of 1/4096 of a tile. &amp;amp;nbsp;A vehicle actually moves visibly every time the motion counter increases by 256, and since a tile consists of 16 such subunits, 16*256=4096 motion units mean motion across one tile.&lt;br /&gt;
&lt;br /&gt;
The most useful way to access it is probably with &amp;amp;lt;shiftnum&amp;amp;gt;=08 and an appropriate &amp;amp;lt;andmask&amp;amp;gt;. &amp;amp;nbsp;For example, to achieve an animation with one frame per vehicle motion and 16 frames in total for motion across an entire tile, you would use &amp;amp;lt;shiftnum&amp;amp;gt;=08 and &amp;amp;lt;andmask&amp;amp;gt;=0F. &amp;amp;nbsp;For an animation with one frame every two vehicle motions and 4 frames total, use &amp;amp;lt;shiftnum&amp;amp;gt;=09 and &amp;amp;lt;andmask&amp;amp;gt;=03.&lt;br /&gt;
&lt;br /&gt;
If the vehicle is going very fast (&amp;amp;gt;160 mph for trains), it may move by several 1/16ths of a tile at once, and thus some frames may be skipped, but the animation will still remain in sync with the motion.&lt;br /&gt;
&lt;br /&gt;
Note that vehicle graphics are only updated every time the vehicle actually moves, so checking the lower byte is probably pointless, and only needed internally to achieve sufficient precision.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle cargo info (47) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; ccccwwtt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||the [[CargoTypes|cargo type]] transported by the vehicle (from the column for type A); translated if a translation table has been installed&lt;br /&gt;
|-&lt;br /&gt;
|ww||cargo unit weight in 1/16 tons, same as [[Action0Cargos#Weight of one unit of the cargo 0F|cargo prop. 0F]]&lt;br /&gt;
|-&lt;br /&gt;
|cccc||the [[Action0Cargos#Cargo classes 16|cargo class]] value of the cargo transported by the vehicle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that if the grf has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;tt&amp;quot; is the slot number in that table, irrespective of which actual slot or bit the cargo is using in the game. If a table has been installed, but the current cargo is not listed there, &amp;quot;tt&amp;quot; will be set to FF.&lt;br /&gt;
&lt;br /&gt;
Unlike variable 42, this variable returns the info of the current vehicle only, not the consist.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle type information (48) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxff&lt;br /&gt;
&lt;br /&gt;
The bits of ff are:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Vehicle type is available on the market&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicle type is in the testing phase&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Exclusive testing offer for a human player active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits in ff are undefined and must be masked out.&lt;br /&gt;
&lt;br /&gt;
=== Information about current railtype/roadtype/tramtype (4A) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxFFrr&lt;br /&gt;
&lt;br /&gt;
The lower byte (rr) contains the (translated) railtype/roadtype/tramtype the vehicle is currently driving on. &lt;br /&gt;
If the railtype/roadtype/tramtype has no entry in the railtype/roadtype/tramtype translation table of the GRF, this value will be 0xFF. &lt;br /&gt;
If no translation table is present, the raw value will be returned.&lt;br /&gt;
Note: only exact matches of rail-/road-/-tram-types are reported. If the translation table of the GRF does not contain the exact track-type 0xFF is returned, even if the translation table contains equivalent track-types (according to rail-/road-/tram-type property 1D). Use variable 63 to test for compatibility/poweredness/equivalency with track-types known to both the vehicle and the track-type NewGRF.&lt;br /&gt;
&lt;br /&gt;
The variable only reports about the tracks the vehicle is using: on a level crossing with rail, road and tram tracks, the vehicle (train, road vehicle, tram) can only query the track type it belongs to.&lt;br /&gt;
&lt;br /&gt;
The second byte (FF) contains the following flags:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The vehicle is/would be powered on the current railtype (this is independent from powered/non-powered wagon or anything)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|1.11|no|ottdrev=gf1bc4d840}} Set, if the track-type has catenary. This is independent of the vehicle: a NewGRF can define an engine as powered on non-electrified track (bit 0), and show a raised pantograph (bit 1) to look like a dual-powered engine. This bit is a simplified as it only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of catenaries, AC and DC voltages, ... use variable 63 instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
All other bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Position within articulated vehicle (4D) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||Position of vehicle (articulated part) within the articulated vehicle, counted from the first part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|bb||Position of vehicle (articulated part) within the articulated vehicle, counted from the last part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|xx||Reserved, do not access.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The total number of articulated parts of a vehicle equals ff + 1 + bb.&lt;br /&gt;
&lt;br /&gt;
For road vehicles &amp;quot;ff&amp;quot; and &amp;quot;bb&amp;quot; currently equal var 40, since there are no road vehicle wagons yet.&lt;br /&gt;
&lt;br /&gt;
=== Count Veh.ID occurence (60) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxnn&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the vehicle ID to look for, and the returned nn is the number of vehicles in the consist that have this ID. If used with VarAction2 type 81, only the current vehicle and onwards will be check, with VarAction2 type 82, all vehicles in the consist will be counted.&lt;br /&gt;
&lt;br /&gt;
=== Query variable of n-th vehicle in chain (61) ===&lt;br /&gt;
&lt;br /&gt;
This is a special variable to get the contents of another variable of a different vehicle in the vehicle chain. It is only supported for trains and road vehicles. It is not supported during a callback that is used to modify vehicle properties to avoid circular dependencies, which currently limits this variable to callbacks 1D, 2D, 31 and 32 plus outside callback scope.&lt;br /&gt;
&lt;br /&gt;
Temporary register 10F is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter specifies the variable to access and temporary register 10E is passed as the new 60+x parameter. Passing 61 as the variable is not allowed. Currently only vehicle specific variables listed on this page plus global variable 25 and {{ottdp|1.3|no|ottdrev=r24527}} 5F are accessible through var 61.&lt;br /&gt;
&lt;br /&gt;
The resulting value will have the size of whatever variable is queried.&lt;br /&gt;
&lt;br /&gt;
=== Curvature/position difference for n-th vehicle in chain (62) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; zzyyxxFD&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The lowest nibble (D) contains the direction difference between the selected vehicle and this vehicle, the possible values are identical to those of [[#Curvature_info_.2845.29|variable 45]].&lt;br /&gt;
&lt;br /&gt;
The next nibble (F) has the following meaning:&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The vehicle is currently hidden&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The upper three bytes contain the signed difference of the X/Y/Z position between the selected vehicle and this vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Track-type test against another track-type (63) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.11|no|ottdrev=g868d84bbf}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxFF&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is an index into the rail-/road-/tram-type translation table.&lt;br /&gt;
The result value reports how vehicles of this type would behave on the current tile.&lt;br /&gt;
This allows vehicles to behave or look differently on various track-types independent of their own track-type.&lt;br /&gt;
&lt;br /&gt;
The lower byte (FF) contains some flags:&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The track-type from the 60+x parameter is known. If unset, all other flags are unset as well, no information can be given.&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicles with type from the 60+x parameter are compatible with the track on the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Vehicles with type from the 60+x parameter are powered on the track of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The track-type from the 60+x parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the track-type of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Test if rail or road type of the current type occupied by the vehicle has that specific badge attached (65) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
This variable only works for trains and road vehicles.&lt;br /&gt;
The specifications are the same as for [[#Curvature_info_.2845.29|variable 7A]].&lt;br /&gt;
&lt;br /&gt;
=== Test if the vehicle has that specific badge attached (7A) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15|no}}&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the index into the badge table.&lt;br /&gt;
The returned value is in range [0, 1].&lt;br /&gt;
&lt;br /&gt;
=== Modflags (FE and FF) ===&lt;br /&gt;
&lt;br /&gt;
The bits in FE mostly relate to gradualloading. &amp;amp;nbsp;A few useful bits for grf authors are;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Version!!Value of the bit&lt;br /&gt;
|-&lt;br /&gt;
|1||{{ottdp|1.5|2.5|ottdrev=r26430}}||Vehicle is still unloading and has not yet started loading new cargo at the current station.&lt;br /&gt;
|-&lt;br /&gt;
|5||{{ottdp|0.6|2.5}}||Vehicle is powered (engine or powered wagon, mainly useful for the latter)&lt;br /&gt;
|-&lt;br /&gt;
|6||{{ottdp|0.6|2.5}}||Vehicle would be powered (engine or powered wagon) if there were suitable track. (E.g. electric train in mixed train on normal track)&lt;br /&gt;
|-&lt;br /&gt;
|8 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottdp|0.6|2.5}}||This bit is flipped every time the train reverses direction&lt;br /&gt;
|-&lt;br /&gt;
|10||{{ottdp|0.6|2.5|ttdprev=r1334}}||Vehicle was built during the exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
|11 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottd|16}}||The train is driving backwards (trains only)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable FF is actually the high byte of variable FE, so FE bit 8 is the same as FF bit 0.&lt;br /&gt;
&lt;br /&gt;
Other bits are reserved; most are actually used for TTDPatch internal states.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5249</id>
		<title>VariationalAction2/Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Vehicles&amp;diff=5249"/>
		<updated>2026-06-05T07:12:57Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Remove empty headers&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;{{NFONavVehicles}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Variable!![[GRFActionsDetailed|Size]]!!Version!!Description!!Available in purchase list&lt;br /&gt;
|-&lt;br /&gt;
|10||D||{{ottdp|1.2|no|ottdrev=r23080}}||Pick sprites for different GUI windows - See [[Action2/Vehicles]].||{{ottdp|1.2|no|ottdrev=r23080}}&lt;br /&gt;
|-&lt;br /&gt;
|40||D||{{ottdp|0.6|2.5}}||Position in consist and length of consist||no&lt;br /&gt;
|-&lt;br /&gt;
|41||D||{{ottdp|0.6|2.5}}||Position in and length of chain of consecutive vehicles with same ID||no&lt;br /&gt;
|-&lt;br /&gt;
|42||D||{{ottdp|0.6|2.5}}||Cargo types transported by consist||no&lt;br /&gt;
|-&lt;br /&gt;
|43||D||{{ottdp|0.6|2.5}}||Player info||{{ottdp|0.6|2.5|ottdrev=r4611|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|44||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 48}}||Aircraft info||no&lt;br /&gt;
|-&lt;br /&gt;
|45||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 58}}||Curvature info||no&lt;br /&gt;
|-&lt;br /&gt;
|46||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 59}}||Motion counter||no&lt;br /&gt;
|-&lt;br /&gt;
|47||D||{{ottdp|0.6|2.5}}||Vehicle cargo info||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot;&amp;gt;Variable 47 refers to the default cargo of the vehicle, when in purchase list. This differs from the cargo used in Action 3, which is 0xFF in purchase list. The &amp;quot;refit cycle&amp;quot; (F2) is currently always zero in the purchase list.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|48||D||{{ottdp|0.6|2.5}}||Vehicle type information||{{ottdp|0.6|2.5|ottdrev=r5338|ttdprev=beta 2}}&lt;br /&gt;
|-&lt;br /&gt;
|49||D||{{ottdp|0.7|2.6|ottdrev=r13376|ttdprev=r2216}}||Year of construction (long format, 0 based)||{{ottdp|0.7|no|ottdrev=r13376}} &amp;lt;ref name=&amp;quot;date&amp;quot;&amp;gt;This is the current date&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4A||D||{{ottdp|1.1|no|ottdrev=r20165}}||Info about current railtype/roadtype/tramtype||no&lt;br /&gt;
|-&lt;br /&gt;
|4B||D||{{ottdp|1.2|no|ottdrev=r23068}}||Long date of last servicing||{{ottdp|1.2|no|ottdrev=r23068}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4C||D||{{ottdp|1.3|no|ottdrev=r24246}}||Current max speed including e.g track or timetable speed limits. Only valid for front vehicle. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot;&amp;gt;See [[Action0Trains#Speed 09|train property 09]], [[Action0RoadVehicles|road vehicle property 08]] (not 15, even when using realistic acceleration), [[Action0Ships|ship property 0B]] and [[Action0Planes|aircraft property 0C]].&amp;lt;/ref&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|4D||D||{{ottdp|1.4|no|ottdrev=r26157}}||Position within articulated vehicle||no&lt;br /&gt;
|-&lt;br /&gt;
|60||D||{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 57}}||Count Veh.ID occurence||no&lt;br /&gt;
|-&lt;br /&gt;
|61||-&amp;lt;ref&amp;gt;The size of the result matches the size of the queried variable.&amp;lt;/ref&amp;gt;||{{ottdp|1.2|no|ottdrev=r22997}}||Query variable of n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|62||D||{{ottdp|1.2|no|ottdrev=r22998}}||Curvature/position difference for n-th vehicle in chain||no&lt;br /&gt;
|-&lt;br /&gt;
|63||D||{{ottdp|1.11|no|ottdrev=g868d84bbf}}||Test track-type of tile against another track-type||no&lt;br /&gt;
|-&lt;br /&gt;
|97||B||{{ottdp|0.6|2.0}}||Tick counter, increased every engine tick||no&lt;br /&gt;
|-&lt;br /&gt;
|B2||W||||Vehicle status: bit0 = vehicle invisible (in tunnel/depot), bit1 = stopped, bit7 = crashed||no&lt;br /&gt;
|-&lt;br /&gt;
|B4||W||{{ottdp|0.6|2.0}}||Current speed. Note, units differ for each vehicle type&amp;lt;ref name=&amp;quot;speed&amp;quot; /&amp;gt;||no&lt;br /&gt;
|-&lt;br /&gt;
|B9||B||{{ottdp|0.6|2.0}}||Cargo type (type B from the list at [[CargoTypes]]; climate dependent)||no&lt;br /&gt;
|-&lt;br /&gt;
|C0||W||{{ottdp|0.6|2.0}}||Engine age in days&amp;lt;br/&amp;gt;{{ottdp|1.2|2.5|ottdrev=r22816|ttdprev=alpha 61}} Valid for wagons and articulated parts as well.||no&lt;br /&gt;
|-&lt;br /&gt;
|C4||B||{{ottdp|0.6|2.0}}||Year built (counted from 1920), note this is modified when Cht: Year is used||{{ottdp|0.6|no|ottdrev=r4611}} &amp;lt;ref name=&amp;quot;date&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|C6||W||{{ottdp|0.6|2.0}}||Vehicle type ID &amp;lt;ref&amp;gt;{{ottdp|0.7|no}} In OpenTTD 0.7 and newer this is the GRF-local ID of the vehicle. Earlier versions of OpenTTD and TTDPatch report the [[VehicleIDs|TTD ID]]. For trains this is the same; for other vehicle types they differ.&amp;lt;/ref&amp;gt; (useful for [[Callbacks#Can wagon be attached (1D)|Callback 1D]])||no&lt;br /&gt;
|-&lt;br /&gt;
|C8||B||{{ottdp|0.6|2.0}}||Sprite type; FD for trains forward, FE or FF when reversed||no&lt;br /&gt;
|-&lt;br /&gt;
|C9||B||{{ottdp|0.6|2.0}}||Day counter; increased daily||no&lt;br /&gt;
|-&lt;br /&gt;
|DA||W||{{ottdp|0.6|2.0}}||Next wagon index, FFFF if last wagon (use shift-num=08 and check for FF)||no&lt;br /&gt;
|-&lt;br /&gt;
|F2||B||{{ottdp|0.6|2.5}}||Refit cycle, how many times refitted to the same cargo type||{{ottdp|0.7|no|ottdrev=r15542}} &amp;lt;ref name=&amp;quot;var47&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|F4||D||{{ottdp|0.5|2.0|ottdrev=3594}}||Current horsepower of train consist||no&lt;br /&gt;
|-&lt;br /&gt;
|FE||W||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|-&lt;br /&gt;
|FF||B||{{ottdp|0.6|2.5}}||Modflags||no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_VehicleArray TTD vehicle structure].&lt;br /&gt;
&lt;br /&gt;
Variables 40, 41, 42 and 43 are cached. This means that while they are in principle computationally expensive, they can be used without impacting performance. Variables 45 and 60 are also computationally expensive but cannot be cached, and should therefore be used sparingly. If possible 80+x variables are to be preferred.&lt;br /&gt;
&lt;br /&gt;
Cached variables are updated when the game is loaded, when the consist enters or is rearranged in a depot, and when the train reverses.&lt;br /&gt;
&lt;br /&gt;
In the purchase list only a few variables are available. Especially the front vehicle (related object) cannot be accessed, nor other articulated parts.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
=== Position and length (40, 41) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 00nnbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||position of vehicle within the consist counted from the engine (front), e.g. the engine would have ff=0, the 1st wagon or mail compartment of planes would have ff=1, the 2nd wagon or the rotor of helicopters would have ff=2, the 3rd wagon would have ff=3 etc&lt;br /&gt;
|-&lt;br /&gt;
|bb||same as ff, but counted from the end, i.e. the last wagon has bb=0, the next-to-last wagon has bb=1 etc.&lt;br /&gt;
|-&lt;br /&gt;
|nn||Total number of vehicles in the consist, including shadow and rotor for aircraft.&lt;br /&gt;
* In var 40 this is zero-based. That is, the value returned is one less than the actual number of vehicles. A train with engine and three wagons has nn=3.&lt;br /&gt;
* In var 41 this is one-based. That is, the value returned is the actual number of vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For variable 40, these numbers refer to the whole consist, but for variable 41, they only refer to the chain of consecutive vehicles with the same ID as the current wagon (including itself, but possibly excluding the engine):&lt;br /&gt;
&lt;br /&gt;
[[File:vehicle_var40_41.png]]&lt;br /&gt;
&lt;br /&gt;
Note however, that accessing the &amp;quot;related&amp;quot; object (i.e. the locomotive) doesn´t make much sense for vars 40/41, except for var40 when in a [[Callbacks#Can wagon be attached 1D|callback 1D]] chain.&lt;br /&gt;
&lt;br /&gt;
=== Consist cargo (42) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; uuiicctt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||a bit mask of all [[Action0Cargos#Cargo classes 16|cargo classes]] transported by the consist&lt;br /&gt;
|-&lt;br /&gt;
|cc||the most common [[CargoTypes|cargo type]] (from the column for type A)&lt;br /&gt;
|-&lt;br /&gt;
|ii||the most common refit cycle (var. F2) of cargo type cc&lt;br /&gt;
|-&lt;br /&gt;
|uu||the result of ORing the bits of prop. 25 from all vehicles in the train&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If used with VarAction2 type 81 (vehicle) it returns only cargo from this vehicle on, with type 82 (engine) that of the whole consist.&lt;br /&gt;
See also variable 47 for more details on the cargo carried by a vehicle.&lt;br /&gt;
&lt;br /&gt;
{{grfTill|7}} For GRF versions 7 and before &amp;quot;cc&amp;quot; is the untranslated bit number from [[Action0/Cargos#Bit_number_for_bitmasks_.2808.29|cargo property 8]].&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|8}} With GRF version 8 the meaning of &amp;quot;cc&amp;quot; changes. If the grf file has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;cc&amp;quot; is the index of the cargo in that table; or FF if the cargo is not present in the table.&lt;br /&gt;
&lt;br /&gt;
=== Player info (43) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; Ccttmmnn&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|nn||the number of the current player from 0 to 7 (up to E (14) in OpenTTD since r14735)&lt;br /&gt;
|-&lt;br /&gt;
|mm||the multiplayer player number with the host player (or the single player) being 0 and the client player being 1&lt;br /&gt;
|-&lt;br /&gt;
|tt||the player type, see below for possible values&lt;br /&gt;
|-&lt;br /&gt;
|c||the primary player colour&lt;br /&gt;
|-&lt;br /&gt;
|C||{{ottdp|0.6|2.5|ttdprev=r1405}} the secondary player colour, equal to c if none (since r1405)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!tt value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||Player is human player (permanent company)&lt;br /&gt;
|-&lt;br /&gt;
|1||Player is AI player (not managed)&lt;br /&gt;
|-&lt;br /&gt;
|2||{{ottdp|no|2.5}} Player is a human managing an AI company&lt;br /&gt;
|-&lt;br /&gt;
|3||{{ottdp|no|2.5}} Player is human player&#039;s original company, now temporarily AI controlled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=r1497}} Since r1497, when the vehicle sprite is being displayed in an exclusive offer window or new vehicle news message, or in other circumstances when no player is associated with the vehicle, nn will be FF.&lt;br /&gt;
&lt;br /&gt;
=== Aircraft info (44) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxhhtt&lt;br /&gt;
&lt;br /&gt;
hh is the height of the aircraft above ground, or more properly above the height of its shadow. Buildings, including the heliport, don&#039;t count as &amp;quot;ground&amp;quot;, i.e. to get the height above a heliport, you have to subtract the heliport height from hh.&lt;br /&gt;
&lt;br /&gt;
tt is the type of the current airport: 0=small, 1=large, 2=heliport, 3=oil rig. The current airport is the target airport for aircraft that have finished the ascent and are in flight.&lt;br /&gt;
&lt;br /&gt;
=== Curvature info (45) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxTxBxF&lt;br /&gt;
&lt;br /&gt;
This returns the amount of curvature between the adjacent wagon pairs. It is useful for train vehicles that normally tilt in curves. The curvature is the difference in direction between the surrounding vehicles:&lt;br /&gt;
&lt;br /&gt;
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)&lt;br /&gt;
&lt;br /&gt;
B = for the back pair (current wagon to next wagon, 0 if wagon is last)&lt;br /&gt;
&lt;br /&gt;
T = for the triplet (previous wagon to next wagon; is zero in an S-bend)&lt;br /&gt;
&lt;br /&gt;
Possible values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Decimal!!Hex!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
| -4||C||180° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -3||D||135° curve left (T only)&lt;br /&gt;
|-&lt;br /&gt;
| -2||E||90° curve left&lt;br /&gt;
|-&lt;br /&gt;
| -1||F||45° curve left&lt;br /&gt;
|-&lt;br /&gt;
|0||0||no curve&lt;br /&gt;
|-&lt;br /&gt;
|1||1||45° curve right&lt;br /&gt;
|-&lt;br /&gt;
|2||2||90° curve right&lt;br /&gt;
|-&lt;br /&gt;
|3||3||135° curve right (T only)&lt;br /&gt;
|-&lt;br /&gt;
|4||4||180° curve right (T only)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Motion counter (46) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; 32-bit value&lt;br /&gt;
&lt;br /&gt;
This variable counts the amount of motion that a vehicle has done. &amp;amp;nbsp;It is only valid for the first vehicle in a consist (i.e. use VarAction2 type 82!). &amp;amp;nbsp;Its value is in units of 1/4096 of a tile. &amp;amp;nbsp;A vehicle actually moves visibly every time the motion counter increases by 256, and since a tile consists of 16 such subunits, 16*256=4096 motion units mean motion across one tile.&lt;br /&gt;
&lt;br /&gt;
The most useful way to access it is probably with &amp;amp;lt;shiftnum&amp;amp;gt;=08 and an appropriate &amp;amp;lt;andmask&amp;amp;gt;. &amp;amp;nbsp;For example, to achieve an animation with one frame per vehicle motion and 16 frames in total for motion across an entire tile, you would use &amp;amp;lt;shiftnum&amp;amp;gt;=08 and &amp;amp;lt;andmask&amp;amp;gt;=0F. &amp;amp;nbsp;For an animation with one frame every two vehicle motions and 4 frames total, use &amp;amp;lt;shiftnum&amp;amp;gt;=09 and &amp;amp;lt;andmask&amp;amp;gt;=03.&lt;br /&gt;
&lt;br /&gt;
If the vehicle is going very fast (&amp;amp;gt;160 mph for trains), it may move by several 1/16ths of a tile at once, and thus some frames may be skipped, but the animation will still remain in sync with the motion.&lt;br /&gt;
&lt;br /&gt;
Note that vehicle graphics are only updated every time the vehicle actually moves, so checking the lower byte is probably pointless, and only needed internally to achieve sufficient precision.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle cargo info (47) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; ccccwwtt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|tt||the [[CargoTypes|cargo type]] transported by the vehicle (from the column for type A); translated if a translation table has been installed&lt;br /&gt;
|-&lt;br /&gt;
|ww||cargo unit weight in 1/16 tons, same as [[Action0Cargos#Weight of one unit of the cargo 0F|cargo prop. 0F]]&lt;br /&gt;
|-&lt;br /&gt;
|cccc||the [[Action0Cargos#Cargo classes 16|cargo class]] value of the cargo transported by the vehicle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that if the grf has installed a [[Action0/Global_Settings#Cargo_translation_table_.2809.29|cargo translation table]], the value in &amp;quot;tt&amp;quot; is the slot number in that table, irrespective of which actual slot or bit the cargo is using in the game. If a table has been installed, but the current cargo is not listed there, &amp;quot;tt&amp;quot; will be set to FF.&lt;br /&gt;
&lt;br /&gt;
Unlike variable 42, this variable returns the info of the current vehicle only, not the consist.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle type information (48) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxff&lt;br /&gt;
&lt;br /&gt;
The bits of ff are:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Vehicle type is available on the market&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicle type is in the testing phase&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Exclusive testing offer for a human player active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits in ff are undefined and must be masked out.&lt;br /&gt;
&lt;br /&gt;
=== Information about current railtype/roadtype/tramtype (4A) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxFFrr&lt;br /&gt;
&lt;br /&gt;
The lower byte (rr) contains the (translated) railtype/roadtype/tramtype the vehicle is currently driving on. &lt;br /&gt;
If the railtype/roadtype/tramtype has no entry in the railtype/roadtype/tramtype translation table of the GRF, this value will be 0xFF. &lt;br /&gt;
If no translation table is present, the raw value will be returned.&lt;br /&gt;
Note: only exact matches of rail-/road-/-tram-types are reported. If the translation table of the GRF does not contain the exact track-type 0xFF is returned, even if the translation table contains equivalent track-types (according to rail-/road-/tram-type property 1D). Use variable 63 to test for compatibility/poweredness/equivalency with track-types known to both the vehicle and the track-type NewGRF.&lt;br /&gt;
&lt;br /&gt;
The variable only reports about the tracks the vehicle is using: on a level crossing with rail, road and tram tracks, the vehicle (train, road vehicle, tram) can only query the track type it belongs to.&lt;br /&gt;
&lt;br /&gt;
The second byte (FF) contains the following flags:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The vehicle is/would be powered on the current railtype (this is independent from powered/non-powered wagon or anything)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|1.11|no|ottdrev=gf1bc4d840}} Set, if the track-type has catenary. This is independent of the vehicle: a NewGRF can define an engine as powered on non-electrified track (bit 0), and show a raised pantograph (bit 1) to look like a dual-powered engine. This bit is a simplified as it only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of catenaries, AC and DC voltages, ... use variable 63 instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All other bits are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
All other bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Position within articulated vehicle (4D) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxbbff&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable!!Value&lt;br /&gt;
|-&lt;br /&gt;
|ff||Position of vehicle (articulated part) within the articulated vehicle, counted from the first part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|bb||Position of vehicle (articulated part) within the articulated vehicle, counted from the last part, starting with 0.&lt;br /&gt;
|-&lt;br /&gt;
|xx||Reserved, do not access.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The total number of articulated parts of a vehicle equals ff + 1 + bb.&lt;br /&gt;
&lt;br /&gt;
For road vehicles &amp;quot;ff&amp;quot; and &amp;quot;bb&amp;quot; currently equal var 40, since there are no road vehicle wagons yet.&lt;br /&gt;
&lt;br /&gt;
=== Count Veh.ID occurence (60) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxnn&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is the vehicle ID to look for, and the returned nn is the number of vehicles in the consist that have this ID. If used with VarAction2 type 81, only the current vehicle and onwards will be check, with VarAction2 type 82, all vehicles in the consist will be counted.&lt;br /&gt;
&lt;br /&gt;
=== Query variable of n-th vehicle in chain (61) ===&lt;br /&gt;
&lt;br /&gt;
This is a special variable to get the contents of another variable of a different vehicle in the vehicle chain. It is only supported for trains and road vehicles. It is not supported during a callback that is used to modify vehicle properties to avoid circular dependencies, which currently limits this variable to callbacks 1D, 2D, 31 and 32 plus outside callback scope.&lt;br /&gt;
&lt;br /&gt;
Temporary register 10F is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter specifies the variable to access and temporary register 10E is passed as the new 60+x parameter. Passing 61 as the variable is not allowed. Currently only vehicle specific variables listed on this page plus global variable 25 and {{ottdp|1.3|no|ottdrev=r24527}} 5F are accessible through var 61.&lt;br /&gt;
&lt;br /&gt;
The resulting value will have the size of whatever variable is queried.&lt;br /&gt;
&lt;br /&gt;
=== Curvature/position difference for n-th vehicle in chain (62) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; zzyyxxFD&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is interpreted as a signed integer and specifies the offset in the chain from the current vehicle. 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.&lt;br /&gt;
&lt;br /&gt;
The lowest nibble (D) contains the direction difference between the selected vehicle and this vehicle, the possible values are identical to those of [[#Curvature_info_.2845.29|variable 45]].&lt;br /&gt;
&lt;br /&gt;
The next nibble (F) has the following meaning:&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The vehicle is currently hidden&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The upper three bytes contain the signed difference of the X/Y/Z position between the selected vehicle and this vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Track-type test against another track-type (63) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.11|no|ottdrev=g868d84bbf}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Format:&#039;&#039;&#039; xxxxxxFF&lt;br /&gt;
&lt;br /&gt;
This variable is only supported for trains and road vehicles.&lt;br /&gt;
&lt;br /&gt;
The 60+x parameter is an index into the rail-/road-/tram-type translation table.&lt;br /&gt;
The result value reports how vehicles of this type would behave on the current tile.&lt;br /&gt;
This allows vehicles to behave or look differently on various track-types independent of their own track-type.&lt;br /&gt;
&lt;br /&gt;
The lower byte (FF) contains some flags:&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||The track-type from the 60+x parameter is known. If unset, all other flags are unset as well, no information can be given.&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Vehicles with type from the 60+x parameter are compatible with the track on the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Vehicles with type from the 60+x parameter are powered on the track of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||8||The track-type from the 60+x parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the track-type of the current tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bytes are reserved, and must be masked.&lt;br /&gt;
&lt;br /&gt;
=== Modflags (FE and FF) ===&lt;br /&gt;
&lt;br /&gt;
The bits in FE mostly relate to gradualloading. &amp;amp;nbsp;A few useful bits for grf authors are;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Version!!Value of the bit&lt;br /&gt;
|-&lt;br /&gt;
|1||{{ottdp|1.5|2.5|ottdrev=r26430}}||Vehicle is still unloading and has not yet started loading new cargo at the current station.&lt;br /&gt;
|-&lt;br /&gt;
|5||{{ottdp|0.6|2.5}}||Vehicle is powered (engine or powered wagon, mainly useful for the latter)&lt;br /&gt;
|-&lt;br /&gt;
|6||{{ottdp|0.6|2.5}}||Vehicle would be powered (engine or powered wagon) if there were suitable track. (E.g. electric train in mixed train on normal track)&lt;br /&gt;
|-&lt;br /&gt;
|8 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottdp|0.6|2.5}}||This bit is flipped every time the train reverses direction&lt;br /&gt;
|-&lt;br /&gt;
|10||{{ottdp|0.6|2.5|ttdprev=r1334}}||Vehicle was built during the exclusive preview&lt;br /&gt;
|-&lt;br /&gt;
|11 &amp;lt;ref&amp;gt;This bit is only accurate for the first vehicle in the consist.&amp;lt;/ref&amp;gt;||{{ottd|16}}||The train is driving backwards (trains only)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable FF is actually the high byte of variable FE, so FE bit 8 is the same as FF bit 0.&lt;br /&gt;
&lt;br /&gt;
Other bits are reserved; most are actually used for TTDPatch internal states.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0&amp;diff=5248</id>
		<title>Action0</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0&amp;diff=5248"/>
		<updated>2026-05-08T08:33:58Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Feature */ Fix last commit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Action 0 allows to change the feature properties of &#039;features&#039;, i.e. vehicles, stations, bridges, houses and more.&lt;br /&gt;
Each feature has its own very specific properties. These are explained in detail in their separate pages.&lt;br /&gt;
&lt;br /&gt;
You will also find the minimum version requirements for properites on the pages.&lt;br /&gt;
Note, that due to the nature of Action 0 unknown properties cannot be ignored. Only a whole Action 0 can be skipped.&lt;br /&gt;
OpenTTD and TTDPatch will disable GRFs once they encounter an unknown property. So, if you use some properties for optional features, which you want to disable for older versions of OpenTTD or TTDPatch, you have to skip the Action 0 using [[Action9|Action 9]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data for Action 0 looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 00 &amp;lt;Feature&amp;gt; &amp;lt;Num-props&amp;gt; &amp;lt;Num-info&amp;gt; &amp;lt;Id&amp;gt; (&amp;lt;Property &amp;lt;New-info&amp;gt;)...&lt;br /&gt;
&lt;br /&gt;
Here is a short overview of what every term means:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt; ||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Length&amp;gt; ||dec||The total number of bytes in the action&lt;br /&gt;
|-&lt;br /&gt;
|00 ||B||Action type. In this case, 00&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Feature&amp;gt; ||B||Which type of feature you would like to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Num-props&amp;gt; ||B||How many properties you would like to change per vehicle or station&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Num-info&amp;gt; ||B||How many vehicles/stations you would like to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Id&amp;gt; ||B*||The ID of the first vehicle/station to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Property&amp;gt; ||B||What property to change for each vehicle/station&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;New-info&amp;gt; ||V||The new value of the property&lt;br /&gt;
|}&lt;br /&gt;
You can put an Action 0 anywhere after [[Action8|Action 8]] in the GRF file.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 61}} The &amp;lt;Id&amp;gt; is an extended byte since TTDPatch 2.0.1 alpha 61, to support the definition of &amp;gt;255 sound effects.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|ottdrev=r13482}} {{grf|7|&amp;lt;7}} In OpenTTD since r13482, extended IDs (up to 65535) can be used for vehicles as well. However there is currently a caveat that articulated parts must be below 128.&lt;br /&gt;
{{ottdp|1.2}} {{grf|8}} In OpenTTD 1.2, extended IDs (up to 65535) can be used for vehicles as well. The ID for articulated vehicles must be below 16384.&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
Action 0 can appear anywhere in the GRF file, so set it to the sprite number you are currently at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
The total number of bytes in Action 0. Start counting from &amp;lt;Action&amp;gt;, the bit that sets the pseudo-sprite to act as the specified action.&lt;br /&gt;
&lt;br /&gt;
=== Action ===&lt;br /&gt;
&lt;br /&gt;
The type of action this pseudo-sprites defines. It should be 00 here because we want this pseudo-sprite to act as Action 0.&lt;br /&gt;
&lt;br /&gt;
=== Feature ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of [[Features|feature]] that you wish to change. Set it to:&lt;br /&gt;
{|&lt;br /&gt;
!Value&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|[[Features|Feature]]&lt;br /&gt;
|-&lt;br /&gt;
|00 || [[Action0/Vehicles/Trains|Trains]]&lt;br /&gt;
|rowspan=&amp;quot;4&amp;quot;|[[Action0/Vehicles|Common vehicle properties]]&lt;br /&gt;
|-&lt;br /&gt;
|01 || [[Action0/Vehicles/RoadVehicles|Road Vehicles]]&lt;br /&gt;
|-&lt;br /&gt;
|02 || [[Action0/Vehicles/Ships|Ships]]&lt;br /&gt;
|-&lt;br /&gt;
|03 || [[Action0/Vehicles/Planes|Aircraft]]&lt;br /&gt;
|-&lt;br /&gt;
|04&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Stations|Stations]]&lt;br /&gt;
|-&lt;br /&gt;
|05 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Canals|Canals]]&lt;br /&gt;
|-&lt;br /&gt;
|06 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Bridges|Bridges]]&lt;br /&gt;
|-&lt;br /&gt;
|07 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Houses|Houses]] (see [[DefaultHouseProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|08 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Global Settings|Global Settings]]&lt;br /&gt;
|-&lt;br /&gt;
|09 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Industry Tiles|Industry Tiles]] (see [[IndustryTileDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0A &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Industries|Industries]] (see [[IndustryDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0B &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Cargos|Cargos]] (see [[CargoDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0C &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Sound Effects|Sound Effects]]&lt;br /&gt;
|-&lt;br /&gt;
|0D &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Airports|Airports]]&lt;br /&gt;
|-&lt;br /&gt;
|0F &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Objects|Objects]]&lt;br /&gt;
|-&lt;br /&gt;
|10 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.0|no|ottdrev=r18969}} [[Action0/Railtypes|Rail Types]]&lt;br /&gt;
|-&lt;br /&gt;
|11 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.1|no|ottdrev=r19204}} [[Action0/Airport Tiles|Airport Tiles]]&lt;br /&gt;
|-&lt;br /&gt;
|12 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.10|no|ottdrev=gc02ef3e456}} [[Action0/Roadtypes|Road Types]]&lt;br /&gt;
|-&lt;br /&gt;
|13 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.10|no|ottdrev=gc02ef3e456}} [[Action0/Tramtypes|Tram Types]]&lt;br /&gt;
|-&lt;br /&gt;
|14 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|14|no|ottdrev=g4c1406a4b5}} [[Action0/Road Stops|Road Stops]]&lt;br /&gt;
|-&lt;br /&gt;
|15 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|15|no|ottdrev=g8f14894024}} [[Action0/Badges|Badges]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Num-props ===&lt;br /&gt;
&lt;br /&gt;
This is the number of properties that you wish to change per vehicle or station. Note: even if you wish to set the same properties to the same value for different vehicles then you must still repeat the properties and their values for each vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Num-info ===&lt;br /&gt;
&lt;br /&gt;
Simply the number of vehicles that you will change using this action 0.&lt;br /&gt;
&lt;br /&gt;
=== Id ===&lt;br /&gt;
The [[VehicleIDs|Vehicle ID]] of the first vehicle or station to change. If num-info is greater than one, this vehicle/station and the following vehicles/stations will be changed.&lt;br /&gt;
&lt;br /&gt;
=== Property ===&lt;br /&gt;
&lt;br /&gt;
The number of the property that will be changed. This and the New-info section are repeated as many times as there are properties to set; in total, there are &amp;lt;&lt;br /&gt;
num-props&amp;gt; property bytes.&lt;br /&gt;
&lt;br /&gt;
See relevant sub-section (links at the bottom) for more details.&lt;br /&gt;
&lt;br /&gt;
=== New-info ===&lt;br /&gt;
&lt;br /&gt;
The new information that will replace the previous information for the specified property. This is a variable size; dependent upon the property. Each property byte is followed by &amp;lt;num-info&amp;gt; new-info sections.&lt;br /&gt;
The appropriate \b, \w, and \d escape sequences can be quite useful for most &amp;lt;&lt;br /&gt;
new-info&amp;gt;s. See [[GRFActionsDetailed#Byte order|the discussion of escape sequences]] for further information.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0&amp;diff=5247</id>
		<title>Action0</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0&amp;diff=5247"/>
		<updated>2026-05-08T08:32:56Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Feature */ Make &amp;quot;types&amp;quot; separate word.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Action 0 allows to change the feature properties of &#039;features&#039;, i.e. vehicles, stations, bridges, houses and more.&lt;br /&gt;
Each feature has its own very specific properties. These are explained in detail in their separate pages.&lt;br /&gt;
&lt;br /&gt;
You will also find the minimum version requirements for properites on the pages.&lt;br /&gt;
Note, that due to the nature of Action 0 unknown properties cannot be ignored. Only a whole Action 0 can be skipped.&lt;br /&gt;
OpenTTD and TTDPatch will disable GRFs once they encounter an unknown property. So, if you use some properties for optional features, which you want to disable for older versions of OpenTTD or TTDPatch, you have to skip the Action 0 using [[Action9|Action 9]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data for Action 0 looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 00 &amp;lt;Feature&amp;gt; &amp;lt;Num-props&amp;gt; &amp;lt;Num-info&amp;gt; &amp;lt;Id&amp;gt; (&amp;lt;Property &amp;lt;New-info&amp;gt;)...&lt;br /&gt;
&lt;br /&gt;
Here is a short overview of what every term means:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt; ||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Length&amp;gt; ||dec||The total number of bytes in the action&lt;br /&gt;
|-&lt;br /&gt;
|00 ||B||Action type. In this case, 00&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Feature&amp;gt; ||B||Which type of feature you would like to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Num-props&amp;gt; ||B||How many properties you would like to change per vehicle or station&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Num-info&amp;gt; ||B||How many vehicles/stations you would like to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Id&amp;gt; ||B*||The ID of the first vehicle/station to change&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Property&amp;gt; ||B||What property to change for each vehicle/station&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;New-info&amp;gt; ||V||The new value of the property&lt;br /&gt;
|}&lt;br /&gt;
You can put an Action 0 anywhere after [[Action8|Action 8]] in the GRF file.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 61}} The &amp;lt;Id&amp;gt; is an extended byte since TTDPatch 2.0.1 alpha 61, to support the definition of &amp;gt;255 sound effects.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|ottdrev=r13482}} {{grf|7|&amp;lt;7}} In OpenTTD since r13482, extended IDs (up to 65535) can be used for vehicles as well. However there is currently a caveat that articulated parts must be below 128.&lt;br /&gt;
{{ottdp|1.2}} {{grf|8}} In OpenTTD 1.2, extended IDs (up to 65535) can be used for vehicles as well. The ID for articulated vehicles must be below 16384.&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
Action 0 can appear anywhere in the GRF file, so set it to the sprite number you are currently at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
The total number of bytes in Action 0. Start counting from &amp;lt;Action&amp;gt;, the bit that sets the pseudo-sprite to act as the specified action.&lt;br /&gt;
&lt;br /&gt;
=== Action ===&lt;br /&gt;
&lt;br /&gt;
The type of action this pseudo-sprites defines. It should be 00 here because we want this pseudo-sprite to act as Action 0.&lt;br /&gt;
&lt;br /&gt;
=== Feature ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of [[Features|feature]] that you wish to change. Set it to:&lt;br /&gt;
{|&lt;br /&gt;
!Value&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|[[Features|Feature]]&lt;br /&gt;
|-&lt;br /&gt;
|00 || [[Action0/Vehicles/Trains|Trains]]&lt;br /&gt;
|rowspan=&amp;quot;4&amp;quot;|[[Action0/Vehicles|Common vehicle properties]]&lt;br /&gt;
|-&lt;br /&gt;
|01 || [[Action0/Vehicles/RoadVehicles|Road Vehicles]]&lt;br /&gt;
|-&lt;br /&gt;
|02 || [[Action0/Vehicles/Ships|Ships]]&lt;br /&gt;
|-&lt;br /&gt;
|03 || [[Action0/Vehicles/Planes|Aircraft]]&lt;br /&gt;
|-&lt;br /&gt;
|04&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Stations|Stations]]&lt;br /&gt;
|-&lt;br /&gt;
|05 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Canals|Canals]]&lt;br /&gt;
|-&lt;br /&gt;
|06 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Bridges|Bridges]]&lt;br /&gt;
|-&lt;br /&gt;
|07 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Houses|Houses]] (see [[DefaultHouseProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|08 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Global Settings|Global Settings]]&lt;br /&gt;
|-&lt;br /&gt;
|09 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Industry Tiles|Industry Tiles]] (see [[IndustryTileDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0A &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Industries|Industries]] (see [[IndustryDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0B &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Cargos|Cargos]] (see [[CargoDefaultProps|defaults]])&lt;br /&gt;
|-&lt;br /&gt;
|0C &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Sound Effects|Sound Effects]]&lt;br /&gt;
|-&lt;br /&gt;
|0D &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Airports|Airports]]&lt;br /&gt;
|-&lt;br /&gt;
|0F &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| [[Action0/Objects|Objects]]&lt;br /&gt;
|-&lt;br /&gt;
|10 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.0|no|ottdrev=r18969}} [[Action0/Rail Types|Railtypes]]&lt;br /&gt;
|-&lt;br /&gt;
|11 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.1|no|ottdrev=r19204}} [[Action0/Airport Tiles|Airport Tiles]]&lt;br /&gt;
|-&lt;br /&gt;
|12 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.10|no|ottdrev=gc02ef3e456}} [[Action0/Road Types|Roadtypes]]&lt;br /&gt;
|-&lt;br /&gt;
|13 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|1.10|no|ottdrev=gc02ef3e456}} [[Action0/Tram Types|Tramtypes]]&lt;br /&gt;
|-&lt;br /&gt;
|14 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|14|no|ottdrev=g4c1406a4b5}} [[Action0/Road Stops|Road Stops]]&lt;br /&gt;
|-&lt;br /&gt;
|15 &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| {{ottdp|15|no|ottdrev=g8f14894024}} [[Action0/Badges|Badges]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Num-props ===&lt;br /&gt;
&lt;br /&gt;
This is the number of properties that you wish to change per vehicle or station. Note: even if you wish to set the same properties to the same value for different vehicles then you must still repeat the properties and their values for each vehicle.&lt;br /&gt;
&lt;br /&gt;
=== Num-info ===&lt;br /&gt;
&lt;br /&gt;
Simply the number of vehicles that you will change using this action 0.&lt;br /&gt;
&lt;br /&gt;
=== Id ===&lt;br /&gt;
The [[VehicleIDs|Vehicle ID]] of the first vehicle or station to change. If num-info is greater than one, this vehicle/station and the following vehicles/stations will be changed.&lt;br /&gt;
&lt;br /&gt;
=== Property ===&lt;br /&gt;
&lt;br /&gt;
The number of the property that will be changed. This and the New-info section are repeated as many times as there are properties to set; in total, there are &amp;lt;&lt;br /&gt;
num-props&amp;gt; property bytes.&lt;br /&gt;
&lt;br /&gt;
See relevant sub-section (links at the bottom) for more details.&lt;br /&gt;
&lt;br /&gt;
=== New-info ===&lt;br /&gt;
&lt;br /&gt;
The new information that will replace the previous information for the specified property. This is a variable size; dependent upon the property. Each property byte is followed by &amp;lt;num-info&amp;gt; new-info sections.&lt;br /&gt;
The appropriate \b, \w, and \d escape sequences can be quite useful for most &amp;lt;&lt;br /&gt;
new-info&amp;gt;s. See [[GRFActionsDetailed#Byte order|the discussion of escape sequences]] for further information.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5244</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5244"/>
		<updated>2026-04-19T21:49:08Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Introduction */ Update link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This page is dedicated for tracking registered badge labels.&lt;br /&gt;
If you write or publish a NewGRF which introduces a new badge label, please also add comment about it here.&lt;br /&gt;
However, before you introduces a new label reconsider if any of available labels fulfills the same purpose. Do not introduces two or more labels for same purpose.&lt;br /&gt;
If you introduce a new class, please also provide a table for badges that belong to it.&lt;br /&gt;
For ease of maintenance keep alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This page is maintained manually and some grf developers oppose to that despicable labor. Therefore you might also want to visit https://github.com/Rito13/BaNaNaS-get_badge_labels/blob/main/gen_docs%2Fbadges%2Fpublic_labels.md, which is updated automatically with content uploaded to BaNaNaS.&lt;br /&gt;
&lt;br /&gt;
== Classes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag || OpenTTD default badges || Country/Region&lt;br /&gt;
|-&lt;br /&gt;
| livery || OpenTTD default badges || Livery&lt;br /&gt;
|-&lt;br /&gt;
| power || OpenTTD default badges || Propulsion&lt;br /&gt;
|-&lt;br /&gt;
| region || OpenTTD default badges || Region&lt;br /&gt;
|-&lt;br /&gt;
| role || OpenTTD default badges || Role&lt;br /&gt;
|-&lt;br /&gt;
| zone || OpenTTD default badges || Zone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badges ==&lt;br /&gt;
&lt;br /&gt;
=== Flag ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag/AD || OpenTTD default badges || Andorra&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Livery ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| livery/2cc || OpenTTD default badges || Dual company colour (2CC)&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/1cc || OpenTTD default badges || Random based on first company colour&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/2cc || OpenTTD default badges || Random based on second company colour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| power/battery || OpenTTD default badges || Battery&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel || OpenTTD default badges || Diesel&lt;br /&gt;
|-&lt;br /&gt;
| power/electric || OpenTTD default badges || Electric&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac || OpenTTD default badges || Electric (AC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc || OpenTTD default badges || Electric (DC)&lt;br /&gt;
|-&lt;br /&gt;
| power/steam || OpenTTD default badges || Steam&lt;br /&gt;
|-&lt;br /&gt;
| power/turbine || OpenTTD default badges || Gas Turbine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| region/africa || OpenTTD default badges || Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/eastern || OpenTTD default badges || Eastern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/middle || OpenTTD default badges || Middle Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/northern || OpenTTD default badges || Northern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/southern || OpenTTD default badges || Southern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/western || OpenTTD default badges || Western Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/america || OpenTTD default badges || Americas&lt;br /&gt;
|-&lt;br /&gt;
| region/america/caribbean || OpenTTD default badges || Caribbean&lt;br /&gt;
|-&lt;br /&gt;
| region/america/central || OpenTTD default badges || Central America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/northern || OpenTTD default badges || Northern America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/south || OpenTTD default badges || South America&lt;br /&gt;
|-&lt;br /&gt;
| region/asia || OpenTTD default badges || Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/central || OpenTTD default badges || Central Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/eastern || OpenTTD default badges || Eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southeastern || OpenTTD default badges || South-eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southern || OpenTTD default badges || Southern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/western || OpenTTD default badges || Western Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/europe || OpenTTD default badges || Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/eastern || OpenTTD default badges || Eastern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/northern || OpenTTD default badges || Northern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/southern || OpenTTD default badges || Southern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/western || OpenTTD default badges || Western Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania || OpenTTD default badges || Oceania&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/australia_and_new_zealand || OpenTTD default badges || Australia and New Zealand&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/melanesia || OpenTTD default badges || Melanesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/micronesia || OpenTTD default badges || Micronesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/polynesia || OpenTTD default badges || Polynesia&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Role ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| role/banking || OpenTTD default badges || Banking&lt;br /&gt;
|-&lt;br /&gt;
| role/express_freight || OpenTTD default badges || Express freight&lt;br /&gt;
|-&lt;br /&gt;
| role/express_passenger || OpenTTD default badges || Express passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/freight || OpenTTD default badges || Freight&lt;br /&gt;
|-&lt;br /&gt;
| role/heavy_freight || OpenTTD default badges || Heavy freight&lt;br /&gt;
|-&lt;br /&gt;
| role/light_freight || OpenTTD default badges || Light freight&lt;br /&gt;
|-&lt;br /&gt;
| role/mail || OpenTTD default badges || Mail&lt;br /&gt;
|-&lt;br /&gt;
| role/mixed || OpenTTD default badges || Mixed&lt;br /&gt;
|-&lt;br /&gt;
| role/passenger || OpenTTD default badges || Passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/prototype || OpenTTD default badges || Prototype&lt;br /&gt;
|-&lt;br /&gt;
| role/restaurant_car || OpenTTD default badges || Restaurant car&lt;br /&gt;
|-&lt;br /&gt;
| role/shunting || OpenTTD default badges || Shunting&lt;br /&gt;
|-&lt;br /&gt;
| role/snowplough || OpenTTD default badges || Snowplough&lt;br /&gt;
|-&lt;br /&gt;
| role/utility || OpenTTD default badges || Utility&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Zone ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| zone/agricultural || OpenTTD default badges || Agricultural&lt;br /&gt;
|-&lt;br /&gt;
| zone/com || OpenTTD default badges || Commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/high || OpenTTD default badges || High density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/low || OpenTTD default badges || Low density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/medium || OpenTTD default badges || Medium density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/forestry || OpenTTD default badges || Forestry&lt;br /&gt;
|-&lt;br /&gt;
| zone/general || OpenTTD default badges || General&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind || OpenTTD default badges || Industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/high || OpenTTD default badges || High density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/low || OpenTTD default badges || Low density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/medium || OpenTTD default badges || Medium density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/leisure || OpenTTD default badges || Leisure&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed || OpenTTD default badges || Commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/high || OpenTTD default badges || High density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/low || OpenTTD default badges || Low density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/medium || OpenTTD default badges || Medium density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/other || OpenTTD default badges || Other&lt;br /&gt;
|-&lt;br /&gt;
| zone/public || OpenTTD default badges || Public&lt;br /&gt;
|-&lt;br /&gt;
| zone/res || OpenTTD default badges || Residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/high || OpenTTD default badges || High density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/low || OpenTTD default badges || Low density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/medium || OpenTTD default badges || Medium density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/transport || OpenTTD default badges || Transport&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5243</id>
		<title>NML:Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5243"/>
		<updated>2026-04-15T14:34:13Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Add nml since.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since&#039;&#039;&#039; {{ottd|15.0}} {{nml|0.9.0}}&lt;br /&gt;
&lt;br /&gt;
  item (FEAT_BADGES, item_name) { ... }&lt;br /&gt;
&lt;br /&gt;
==Badge properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| string with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; as delimiter&lt;br /&gt;
| &#039;&#039;&#039; For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.&#039;&#039;&#039;&lt;br /&gt;
Badges with label without &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; are considered to be classes.&lt;br /&gt;
Labels for other badges should match following syntax:&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;&amp;quot;label_of_class_they_belong_to/label_for_the_badge&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| bitmask(BADGE_FLAG_XXX, ...);&lt;br /&gt;
|&lt;br /&gt;
; COPY_TO_RELATED_ENTITY&lt;br /&gt;
: Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
; NAME_LIST_STOP&lt;br /&gt;
: Stops adding more names to the visible name list.&lt;br /&gt;
; NAME_LIST_FIRST_ONLY&lt;br /&gt;
: Add this name to the visible name list only if this is the first name.&lt;br /&gt;
; USE_COMPANY_COLOUR&lt;br /&gt;
: Recolour badge depending on company that player currently controls.&lt;br /&gt;
; NAME_SKIP&lt;br /&gt;
: Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| intro_date&lt;br /&gt;
| date(yyyy, mm, dd)&lt;br /&gt;
| Introduction date of entity (or current date if entity type does not have an introduction date). See &amp;lt;code style=&amp;quot;color: green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt; in [[NML:Vehicles#Properties common to all vehicle types|vehicle properties]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge callbacks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: By design badges are meant to only be up to 12 pixels tall.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
aircraft&amp;lt;br&amp;gt;&lt;br /&gt;
airports&amp;lt;br&amp;gt;&lt;br /&gt;
airporttiles&amp;lt;br&amp;gt;&lt;br /&gt;
houses&amp;lt;br&amp;gt;&lt;br /&gt;
industries&amp;lt;br&amp;gt;&lt;br /&gt;
industrytiles&amp;lt;br&amp;gt;&lt;br /&gt;
objects&amp;lt;br&amp;gt;&lt;br /&gt;
railtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadstops&amp;lt;br&amp;gt;&lt;br /&gt;
roadtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadvehs&amp;lt;br&amp;gt;&lt;br /&gt;
ships&amp;lt;br&amp;gt;&lt;br /&gt;
stations&amp;lt;br&amp;gt;&lt;br /&gt;
trains&amp;lt;br&amp;gt;&lt;br /&gt;
tramtypes&amp;lt;br&amp;gt;&lt;br /&gt;
| spriteset&lt;br /&gt;
| Override default graphics when used by other specific feature.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Badges require a [[NML:Badgetable|badgetable]] to be defined for most common usage scenarios (eg to refer to a badge from an item block). This is not a hard requirement and can be omitted if you are, for example, creating badges that other newGRFs can later refer to&lt;br /&gt;
&lt;br /&gt;
Eg for &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt; to be used in the badges property for a vehicle, the badge table must contain entries for both &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 badgetable {&lt;br /&gt;
     &amp;quot;power&amp;quot;,&lt;br /&gt;
     &amp;quot;power/diesel&amp;quot;,&lt;br /&gt;
     &amp;quot;power/steam&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
item (FEAT_BADGES, power) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will not show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, diesel) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/diesel&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_DIESEL);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, steam) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/steam&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_STEAM);&lt;br /&gt;
    }&lt;br /&gt;
    graphics {&lt;br /&gt;
        default: sprite_steam;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=5242</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=5242"/>
		<updated>2026-04-15T14:31:53Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Station properties */ Litle tweaks.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Since {{ottd|15.0}} {{nml|0.7.6}} it is possible to register up to 256 tile types.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15.0}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles &amp;lt;br&amp;gt;&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated since &#039;&#039;&#039;{{nml|0.7.6}}&#039;&#039;&#039; , replaced by &#039;&#039;&#039;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_flags&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_ALL_TILES&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_PERIMETER {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;perimeter&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
:Since {{ottd|16.0}} if &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA&amp;lt;/code&amp;gt; is also set it does not do anything.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA {{ottd|16.0}} {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;area&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Deprecated since {{nml|0.9.0}}.&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(STAT_ANIM_XXX, ANIM_TRIGGER_STAT_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TILELOOP&lt;br /&gt;
:Tile is processed in the periodic processing loop&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TRAIN_RESERVES&lt;br /&gt;
:Train reserves platform (using PBS)&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| tile_flags&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(STAT_TILE_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.7.6}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
; PYLON&lt;br /&gt;
: Draw pylon on tile with that type.&lt;br /&gt;
; NOWIRE&lt;br /&gt;
: Hide wire on tile with that type.&lt;br /&gt;
; BLOCKED&lt;br /&gt;
: Do not allow trains to enter tile with that type.&lt;br /&gt;
|}&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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;wikitable sortable&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;wikitable sortable&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;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&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;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station 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;wikitable sortable&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_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&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_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&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 [[#Station_sections|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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the rail station has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
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 cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
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;wikitable sortable&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;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, even values up to FE can be returned as long as the tile is defined.&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 24, 8)&amp;lt;/code&amp;gt;: Original tile type in static layout.&lt;br /&gt;
&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=5241</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=5241"/>
		<updated>2026-04-15T14:30:43Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Station properties */ Update to nml #422.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Since {{ottd|15.0}} {{nml|0.7.6}} it is possible to register up to 256 tile types.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles &amp;lt;br&amp;gt;&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated since &#039;&#039;&#039;{{nml|0.7.6}}&#039;&#039;&#039; , replaced by &#039;&#039;&#039;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_flags&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_ALL_TILES&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_PERIMETER {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;perimeter&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
:Since {{ottd|16.0}} if STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA is also set it does not do anything.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO_BY_AREA {{ottd|16.0}} {{nml|0.9.0}}&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station &#039;&#039;&#039;area&#039;&#039;&#039; for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Deprecated since {{nml|0.9.0}}.&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(STAT_ANIM_XXX, ANIM_TRIGGER_STAT_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TILELOOP&lt;br /&gt;
:Tile is processed in the periodic processing loop&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TRAIN_RESERVES&lt;br /&gt;
:Train reserves platform (using PBS)&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| tile_flags&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(STAT_TILE_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.7.6}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
; PYLON&lt;br /&gt;
: Draw pylon on tile with that type.&lt;br /&gt;
; NOWIRE&lt;br /&gt;
: Hide wire on tile with that type.&lt;br /&gt;
; BLOCKED&lt;br /&gt;
: Do not allow trains to enter tile with that type.&lt;br /&gt;
|}&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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;wikitable sortable&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;wikitable sortable&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;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&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;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station 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;wikitable sortable&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_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&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_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&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 [[#Station_sections|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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the rail station has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
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 cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
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;wikitable sortable&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;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, even values up to FE can be returned as long as the tile is defined.&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 24, 8)&amp;lt;/code&amp;gt;: Original tile type in static layout.&lt;br /&gt;
&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Cargos&amp;diff=5234</id>
		<title>Action0/Cargos</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Cargos&amp;diff=5234"/>
		<updated>2026-04-07T10:34:54Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Properties */ COLOUR&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The [[ttwiki:NewCargos|NewCargos]] switch of TTDPatch allows modifying the existing 12 cargos per climate, and allows adding 20 new cargos per climate as well. These cargo slots are numbered from 0 to 31, where slots 0-11 are used by default TTD cargos and slots 12-31 contain uninitialized garbage by default (so you can&#039;t trust them having meaningful information, you must set all of their properties).&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.9|no|ottdrev=11ab3c4e}} OpenTTD 1.9 increases the number of cargos to 64.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|08||B||{{ottdp|0.6|2.5}}||Bit number for bitmasks&lt;br /&gt;
|-&lt;br /&gt;
|09||W||{{ottdp|0.6|2.5}}||TextID for the cargo type name&lt;br /&gt;
|-&lt;br /&gt;
|0A||W||{{ottdp|0.6|2.5}}||TextID for the name of one unit from the cargo type&lt;br /&gt;
|-&lt;br /&gt;
|0B||W||{{ottdp|0.6|2.5}}||TextID to be displayed for 1 unit of cargo&lt;br /&gt;
|-&lt;br /&gt;
|0C||W||{{ottdp|0.6|2.5}}||TextID to be displayed for multiple units of cargo&lt;br /&gt;
|-&lt;br /&gt;
|0D||W||{{ottdp|0.6|2.5}}||TextID for cargo type abbreviation&lt;br /&gt;
|-&lt;br /&gt;
|0E||W||{{ottdp|0.6|2.5}}||Sprite number for the icon of the cargo&lt;br /&gt;
|-&lt;br /&gt;
|0F||B||{{ottdp|0.6|2.5}}||Weight of one unit of the cargo&lt;br /&gt;
|-&lt;br /&gt;
|10,11||B||{{ottdp|0.6|2.5}}||Penalty times&lt;br /&gt;
|-&lt;br /&gt;
|12||D||{{ottdp|0.6|2.5}}||Base price&lt;br /&gt;
|-&lt;br /&gt;
|13||B||{{ottdp|0.6|2.5}}||Colour for the station list window&lt;br /&gt;
|-&lt;br /&gt;
|14||B||{{ottdp|0.6|2.5}}||Colour for the cargo payment list window&lt;br /&gt;
|-&lt;br /&gt;
|15||B||{{ottdp|0.6|2.5}}||Freight status (for freight-weight-multiplier setting); 0=not freight, 1=is freight&lt;br /&gt;
|-&lt;br /&gt;
|16||W||{{ottdp|0.6|2.5}}||Cargo classes&lt;br /&gt;
|-&lt;br /&gt;
|17||D||{{ottdp|0.6|2.5}}||Cargo label&lt;br /&gt;
|-&lt;br /&gt;
|18||B||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Substitute type for town growth&lt;br /&gt;
|-&lt;br /&gt;
|19||W||{{ottdp|no|2.5|ttdprev=alpha 72}}||Multiplier for town growth&lt;br /&gt;
|-&lt;br /&gt;
|1A||B||{{ottdp|0.6|2.5|ttdprev=alpha 72}}||Callback flags&lt;br /&gt;
|-&lt;br /&gt;
|1B||W||{{ottdp|1.1|no|ottdrev=r21224}}||TextID for displaying the units of a cargo&lt;br /&gt;
|-&lt;br /&gt;
|1C||W||{{ottdp|1.1|no|ottdrev=r21224}}||TextID for displaying the amount of cargo&lt;br /&gt;
|-&lt;br /&gt;
|1D||W||{{ottdp|1.2|no|ottdrev=r23860}}||Capacity mulitplier&lt;br /&gt;
|-&lt;br /&gt;
|1E||B||{{ottdp|14.0|no}}||Town Production effect&lt;br /&gt;
|-&lt;br /&gt;
|1F||W||{{ottdp|14.0|no}}||Town Production multiplier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Bit number for bitmasks (08) ===&lt;br /&gt;
&lt;br /&gt;
This value must be used in [[Action3]] and in cargo bit mask properties such as refit masks. Values 1C-1F should be safe to use (if they aren&#039;t already taken, of course) if you intend to maintain compatibility with GRFs unaware of the newcargos switch. Further assuming that no active GRFs support the toyland climate, you can use values 11-1A as well.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can use the value FFh to disable the given cargo slot. This way, it won&#039;t appear in cargo type lists, but it won&#039;t be removed from things already on the map. If you disable a cargo, you&#039;ll probably want to zero out the cargo label (property 17) as well.&lt;br /&gt;
&lt;br /&gt;
This property only affects GRFs which do not have a [[Action0/Global Settings#Cargo_translation_table_.2809.29 | cargo translation table]]. GRFs with such a table generally use the index of the cargo in the table instead of the value of this property to access a cargo. As such this property is more or less a default value for GRFs without cargo translation table. If you are unsure what value to assign to this property, set it to the same value as the cargo slot ID.&lt;br /&gt;
&lt;br /&gt;
=== TextID for the cargo type name (09) ===&lt;br /&gt;
&lt;br /&gt;
This textID should refer to the name of the cargo, capitalized, to match the TTD style (e.g. &amp;quot;Passengers&amp;quot;, &amp;quot;Coal&amp;quot;, &amp;quot;Gold Ore&amp;quot;, &amp;quot;Milk&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
You can reuse existing [[TextIDs]] or create custom strings using [[Action4]] with an offset in the DCxx range. Note that you need to set language-id bit 7 as well in the Action4 for a custom string. (Also applies to properties 0A to 0D)&lt;br /&gt;
&lt;br /&gt;
=== TextID for one unit of the type (0A) ===&lt;br /&gt;
&lt;br /&gt;
This textID should refer to the cargo type name in the singular. Currently, this ID is used only in subsidy messages (&amp;quot;First Passenger service...&amp;quot; instead of &amp;quot;First Passengers service...&amp;quot;, for example)&lt;br /&gt;
&lt;br /&gt;
=== TextID for 1 unit of cargo (0B) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used to display the amount of the cargo if there&#039;s exactly 1 unit waiting. Although there&#039;s only one unit waiting, you&#039;ll still have to use either the special character 7C (print signed word) or 87 (print amount in litres and add suffix &amp;quot; litres&amp;quot;) so TTD removes the amount from its internal reference stack. For example, if you have a new cargo named &amp;quot;gold ore&amp;quot;, this should be &amp;quot;\7C ton of gold ore&amp;quot;, which will expand to &amp;quot;1 ton of gold ore&amp;quot;. On the other hand, a liquid cargo named &amp;quot;milk&amp;quot; should be something like &amp;quot;\87 of milk&amp;quot;, which will expand to either &amp;quot;100 litres of milk&amp;quot; or &amp;quot;1,000 litres of milk&amp;quot; (The multiplier for liquid cargos depends on miscmods.dontfixlitres. If it&#039;s on, the multiplier is 100, otherwise it&#039;s 1000)&lt;br /&gt;
&lt;br /&gt;
=== TextID for multiple units of cargo (0C) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used to display the amount of cargo if the amount waiting isn&#039;t exactly 1. You&#039;ll need the same special characters as above, but now they will be expanded according to the actual cargo waiting. Sticking to the example above, you&#039;ll need &amp;quot;\7C tons of gold ore&amp;quot; and &amp;quot;\87 of milk&amp;quot;, which can expand to &amp;quot;42 tons of gold ore&amp;quot; and &amp;quot;42,000 litres of milk&amp;quot;, accordingly. You will note that liquid cargos can have the same textID for both property 0B and 0C since they always use the plural form.&lt;br /&gt;
&lt;br /&gt;
=== TextID for cargo type abbreviation (0D) ===&lt;br /&gt;
&lt;br /&gt;
This textID will be used in the station list window to represent the cargo waiting. It should be a two-letter abbreviation prefixed by the special character 0E to switch to the microscopic font. The microscopic font has every letter capitalized, so capitalization isn&#039;t important here. Continuing the above example, gold ore could have this as &amp;quot;GO&amp;quot; and milk as &amp;quot;MK&amp;quot; (&amp;quot;ML&amp;quot; is already taken by mail).&lt;br /&gt;
&lt;br /&gt;
=== Sprite number for icon (0E) ===&lt;br /&gt;
&lt;br /&gt;
This is a sprite number of an old TTD sprite to be displayed in the station window for this cargo, or FFFFh if the icon should be found by following the action 3 associated with this cargo. The icon must not be bigger than 10x10 pixels. One icon will be shown for every 10 units of the cargo waiting, up to 23 icons, which is the maximum.&lt;br /&gt;
&lt;br /&gt;
=== Weight of one unit of the cargo (0F) ===&lt;br /&gt;
&lt;br /&gt;
This property defines the weight of 1 unit from the cargo, which will be used to calculate the weight of the vehicles when loaded. The unit is 1/16 ton (which is 62.5 kg). With the examples above, gold ore should have this as 16 (since 1 ton of gold ore should weigh exactly 1 ton), while milk should have this slightly above 16 (milk is denser than water).&lt;br /&gt;
&lt;br /&gt;
=== Penalty times and price factor (10,11,12) ===&lt;br /&gt;
&lt;br /&gt;
These three values define how much is paid for the delivery of the cargo type. The price factor is subject to inflation, but GRFs needn&#039;t care about this, the programme will adjust the price for them.&lt;br /&gt;
&lt;br /&gt;
The income generated from cargo delivery is calculated as:&lt;br /&gt;
&lt;br /&gt;
income=((((distance/2) * timefactor * amount_moved) &amp;gt;&amp;gt; 7) * cargopricefactor) &amp;gt;&amp;gt; 13&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
; a &amp;gt;&amp;gt; b : means a is arithmetically shifted right by b bits&lt;br /&gt;
; distance : is the Manhattan distance between the two station signs&lt;br /&gt;
; amount_moved : is the number of cargo units moved&lt;br /&gt;
; cargopricefactor : is the value you set in property 12. Inflation will be applied automatically on it.&lt;br /&gt;
; timefactor : is a multiplier in the range 0..255, calculated in the following way: (T1 is the value of property 10, T2 is the value of property 11, t is the time the delivery took, the unit is 185 game ticks (roughly 2.5 game days) )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if t&amp;lt;=T1 then timefactor=255&lt;br /&gt;
    else if t&amp;lt;=(T1+T2) then timefactor=255-(t-T1)&lt;br /&gt;
    else timefactor=255-(t-T1)-(t-T1-T2)&lt;br /&gt;
    if the above rules result in a timefactor less than 31, 31 is used instead. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Color for the station list window (13) ===&lt;br /&gt;
&lt;br /&gt;
This color index will be used to draw the rectangle representing the amount waiting from the current cargo type in the station list window. The index should be given for the DOS palette. OpenTTD and TTDPatch will automatically translate the index for the Windows palette, if they use the windows base graphics.&lt;br /&gt;
&lt;br /&gt;
=== Color for the cargo payment list window (14) ===&lt;br /&gt;
&lt;br /&gt;
The graph of the current cargo will be drawn using this color in the cargo payment rates graph. The index should be given for the DOS palette, the Windows version of TTDPatch will automatically translate the index for the Windows palette.&lt;br /&gt;
&lt;br /&gt;
=== CargoClasses (16) ===&lt;br /&gt;
&lt;br /&gt;
See [[Action0Trains#Cargo classes .2828.2C_29.29|train prop. 28/29]] for a description of the utility of this property.&lt;br /&gt;
&lt;br /&gt;
The history of cargo classes is complex, and the meanings here may not be consistent with how classes are actually used by some grfs.&lt;br /&gt;
&lt;br /&gt;
FIRS and Iron Horse do not conform to the classes here, and use the FRAX Cargo Class Scheme, please see: https://grf.farm/polar-fox/frax_latest.html&lt;br /&gt;
&lt;br /&gt;
This is a bit mask of all cargo classes to which this cargo could belong.&lt;br /&gt;
The following classes are available:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!bit&lt;br /&gt;
!value&lt;br /&gt;
!class name&lt;br /&gt;
!wagon type&amp;lt;ref name=vehicle&amp;gt;Suggestion for vehicle types which transport this cargo&amp;lt;/ref&amp;gt;&lt;br /&gt;
!usage&amp;lt;ref name=refitusage&amp;gt;Suggestion how to best make use of this class in the refit masks of vehicles&amp;lt;br&amp;gt;OR to be included in the &#039;allowed classes&#039; (train prop. 28), AND NOT in the &#039;disallowed classes&#039; (train prop. 29)&amp;lt;/ref&amp;gt;&lt;br /&gt;
!vehicle tips&amp;lt;ref name=vehicleuse&amp;gt;Suggestions this class should be used in the property which excludes a class of cargos from a vehicle. One specific type of cargo could appear both as liquid or as piece goods (e.g. milk), which depends on the actual representation. Thus excluding the other would disallow refit to that cargo.&amp;lt;/ref&amp;gt;&lt;br /&gt;
!industry tips&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Passengers&lt;br /&gt;
|passenger wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|do not combine with other flags&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|Mail&lt;br /&gt;
|closed or mail wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|do not combine with other flags&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|Express&lt;br /&gt;
|closed or mail wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude, suitable for airplane or maglev&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|Armored&lt;br /&gt;
|armored or mail wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|do not combine with other flags&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|10&lt;br /&gt;
|Bulk (Uncountable)&lt;br /&gt;
|open or hopper wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|may be combined with Piece Goods or Liquid to simulate multiple modes of transport&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|20&lt;br /&gt;
|Piece Goods (Countable)&lt;br /&gt;
|closed or open wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|may be combined with Bulk or Liquid to simulate multiple modes of transport&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|40&lt;br /&gt;
|Liquid&lt;br /&gt;
|tank wagon&lt;br /&gt;
|OR&lt;br /&gt;
|never exclude&lt;br /&gt;
|may be combined with Piece Goods or Bulk to simulate multiple modes of transport&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|80&lt;br /&gt;
|Refrigerated&lt;br /&gt;
|refrigerated wagon&lt;br /&gt;
|OR/AND NOT&lt;br /&gt;
|only exclude, when Piece Goods included&lt;br /&gt;
|also set Piece Goods&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|100&lt;br /&gt;
|Hazardous&lt;br /&gt;
|unknown&lt;br /&gt;
|OR/AND NOT&lt;br /&gt;
|only exclude, when special wagons are provided.&lt;br /&gt;
|combine with Piece Goods, Liquid, Bulk or Express&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|200&lt;br /&gt;
|Covered (weather protected)&lt;br /&gt;
|closed wagon, any other wagon with tarpaulin or weather cover&lt;br /&gt;
|OR/AND NOT&lt;br /&gt;
|do not exclude for Liquid&lt;br /&gt;
|combine with Piece Goods or Bulk&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|400&lt;br /&gt;
|Oversized&lt;br /&gt;
|stake/flatbed wagon&lt;br /&gt;
|OR/AND NOT&lt;br /&gt;
|only exclude, when Piece Goods included&lt;br /&gt;
|combine with Piece Goods&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|800&lt;br /&gt;
|Powderized (dry powdered materials that flow under air pressure)&lt;br /&gt;
|powder/silo vehicle equipped for compressed air unloading&lt;br /&gt;
|OR/AND NOT&lt;br /&gt;
|only exclude, when Bulk included&lt;br /&gt;
|combine with Bulk&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|1000&lt;br /&gt;
|Non-pourable&lt;br /&gt;
|open wagon, but not hopper wagon&lt;br /&gt;
|AND NOT&lt;br /&gt;
|only exclude, when Bulk included&lt;br /&gt;
|combine with Bulk&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|2000&lt;br /&gt;
|Potable&lt;br /&gt;
| exclude from non-food-grade vehicles&lt;br /&gt;
| AND NOT&lt;br /&gt;
| exclude&lt;br /&gt;
| set for all food-grade freight cargos&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|4000&lt;br /&gt;
|Non-potable.&lt;br /&gt;
| exclude from food-grade vehicles&lt;br /&gt;
| AND NOT&lt;br /&gt;
| exclude&lt;br /&gt;
| set for all non-food-grade freight cargos&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|8000&lt;br /&gt;
|special&lt;br /&gt;
|and not&lt;br /&gt;
|none&lt;br /&gt;
|special use&lt;br /&gt;
|do not set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only cargos which are in class 0 (passengers) will appear in bus stations. Only cargos which are &#039;&#039;not&#039;&#039; in class 0 will appear in truck stations.&lt;br /&gt;
&lt;br /&gt;
Disclaimer: there is no guarantee that classes won&#039;t vary over time or between sets.  The classes of a cargo may change between different versions of a specific industry/cargo newgrf, or different classes may be set for the same cargo label by different industry/cargo newgrfs.   Feel free to use classes in your set for conveniently refitting to cargos, but if you - the vehicle author - care about specific cargos being transported in specific vehicles, use label based refits (changing labels without a very good reason is considered to be bad practice).&lt;br /&gt;
&lt;br /&gt;
=== Cargo label (17) ===&lt;br /&gt;
&lt;br /&gt;
Cargo labels are globally [[CargoTypes#Cargo Labels|unique identifiers]] for a cargo type. They are used to allow vehicle grfs to easily support many cargo types, whether they are active or not and no matter what slot or bit they are using.&lt;br /&gt;
&lt;br /&gt;
Read about the [[Action0/Global Settings#Cargo translation table 09|cargo translation table]] for further info.&lt;br /&gt;
&lt;br /&gt;
=== Substitute type and multiplier for town growth (18, 19) ===&lt;br /&gt;
&lt;br /&gt;
These properties allow you to modify how a cargo type affects town growth. Property 18 can contain one of the following values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Value!!Meaning!!{{ottdp|0.7|no}} Details&amp;lt;ref&amp;gt;This is the interpretation of OpenTTD. For TTDPatch see [http://www.tt-wiki.net/wiki/NewTownGrowthSwitches NewTownGrowthMechanism], which is quite different/unrelated.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|00||Affect towns as passengers do||Cargo produced by houses is added to the statistics in the town GUI.&lt;br /&gt;
|-&lt;br /&gt;
|02||Affect towns as mail does||Cargo produced by houses is added to the statistics in the town GUI.&lt;br /&gt;
|-&lt;br /&gt;
|05||Affect towns as goods/candy does||See note about subsidies below.&lt;br /&gt;
|-&lt;br /&gt;
|09||Affect towns as water does||Second required cargo for towngrowth in the desert&lt;br /&gt;
|-&lt;br /&gt;
|0B||Affect towns as food/fizzy drinks do||First required cargo for towngrowth in desert/above snowline. Alse see note about subsidies below.&lt;br /&gt;
|-&lt;br /&gt;
|FF||Don&#039;t affect town growth (default)|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no|2.5|ttdprev=alpha 72}} The incoming cargo amount is multiplied by property 19, then divided by 256 before it is added to the town statistics. This allows you to have smaller or bigger impact than original cargoes do. &lt;br /&gt;
&lt;br /&gt;
If no cargos in the game are defined as food (0B), towns above the snowline will not require food to grow. If no cargos in the game are defined as food (0B) or water (09), towns in desert will not require food or water to grow.  This can be used positively for gameplay purposes, and is otherwise worth being aware of as an unintended side effect when designing cargos.&lt;br /&gt;
&lt;br /&gt;
Please note that cargoes accepted by industries affect the closest town as well; for example, if you have an industry that accepts passengers, every passenger brought to the industry affects the town just like if they were transported to the town directly. Usually, it&#039;s not a good idea to have industries that process such cargoes; they should be accepted by towns only.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6-1.1|no}} In OpenTTD up to 1.1 (not 1.2) property 18 also affects the creation of subsidies. Usually subsidies apply to cargo transportation between two industries. For cargos with substitution-type 05 or 0B the destination will be a town instead. Independent of property 18 subsidies from town to town are only created for cargo slot 0 (Passengers).&lt;br /&gt;
&lt;br /&gt;
=== Callback flags (1A) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Var. 0C!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||39||Custom profit calculation&lt;br /&gt;
|-&lt;br /&gt;
|1||2||145||Custom station rating calculation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== TextID for displaying the units of a cargo (1B) ===&lt;br /&gt;
&lt;br /&gt;
This textID is used by OpenTTD to show the &amp;quot;short cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 litres&amp;quot; or &amp;quot;10 tonnes&amp;quot;. This textID must be set after property 0B. The text this textID refers to should properly handle plurals, e.g. &amp;quot;\7B item\9A\15\80\9A\10\9A\11s\9A\12&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The default for this textID depends on the default for property 0B; if the default 0B string has &amp;quot;litre&amp;quot;, then the default for this textID will be the unit for litres. OpenTTD maps the following textIDs so you don&#039;t need to provide translations:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!textID!!String&lt;br /&gt;
|-&lt;br /&gt;
|004f||&amp;lt;num&amp;gt; passenger(s)&lt;br /&gt;
|-&lt;br /&gt;
|0050||&amp;lt;num&amp;gt; tonne(s)&lt;br /&gt;
|-&lt;br /&gt;
|0051||&amp;lt;num&amp;gt; bag(s)&lt;br /&gt;
|-&lt;br /&gt;
|0052||&amp;lt;num&amp;gt; litre(s)&lt;br /&gt;
|-&lt;br /&gt;
|0053||&amp;lt;num&amp;gt; item(s)&lt;br /&gt;
|-&lt;br /&gt;
|0054||&amp;lt;num&amp;gt; crate(s)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;tonne&amp;quot; and &amp;quot;litre&amp;quot; strings (textID 0050 and 0052) are automatically updated based on the user settings of unit display, e.g. they &amp;quot;tonne&amp;quot; might become &amp;quot;kg&amp;quot;. The &amp;quot;(s)&amp;quot; is for display purposes; in reality that is a choice list.&lt;br /&gt;
&lt;br /&gt;
=== TextID for displaying the amount of cargo (1C) ===&lt;br /&gt;
&lt;br /&gt;
This textID is used by OpenTTD to show the &amp;quot;long cargo&amp;quot; form for cargo units, e.g. &amp;quot;10 litres of water&amp;quot; or &amp;quot;10 tonnes of coal&amp;quot;. This textID must be set after property 0c. The text this textID refers to should properly handle plurals, e.g. &amp;quot;\7B item\9A\15\80\9A\10\9A\11s\9A\12 of livestock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The default for this textID depends on the default for property 0C, but with support for plurals. For &amp;quot;X litre(s)&amp;quot; or &amp;quot;X tonne(s)&amp;quot; you should respectively use string codes 87 and 9A 0D.&lt;br /&gt;
&lt;br /&gt;
=== Capacity multiplier (1D) ===&lt;br /&gt;
&lt;br /&gt;
This defines the capacity (and indirectly loading speed) of vehicles carrying this cargo type, if the vehicle sets no specific capacity to this specific cargo type.&lt;br /&gt;
&lt;br /&gt;
Set this property to the amount of cargo a vehicle shall carry, which can carry 0x100 (256) tons of coal or 0x100 (256) 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.&lt;br /&gt;
&lt;br /&gt;
The default value of this property is:&lt;br /&gt;
{| |-&lt;br /&gt;
! Cargo slot !! Default cargo in this slot !! Property 1D !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || PASS || 0x400 || A vehicle carrying 1 ton of coal, can carry 4 passengers.&lt;br /&gt;
|-&lt;br /&gt;
| 02 || MAIL || 0x200 || A vehicle carrying 1 ton of coal, can carry 2 bags of mail.&lt;br /&gt;
|-&lt;br /&gt;
| 05 || GOOD, SWET || 0x200 || A vehicle carrying 1 ton of coal, can carry 2 crates of goods/sweets.&lt;br /&gt;
|-&lt;br /&gt;
| xx || (everything else) || 0x100 || All other slots default to 0x100, i.e. 1 unit of cargo equals 1 ton of coal.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Town Production effect (1E) ===&lt;br /&gt;
&lt;br /&gt;
This properties allow you to directly modify how a town produces cargo. Property 1E can contain one of the following values:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|00||Towns produce cargo as passengers&lt;br /&gt;
|-&lt;br /&gt;
|02||Towns produce cargo as mail&lt;br /&gt;
|-&lt;br /&gt;
|FF||Towns don&#039;t produce cargo (default)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Town Production multiplier (1F) ===&lt;br /&gt;
&lt;br /&gt;
Set this property to the amount of cargo a town will produce, relative to the normal amount for that town production effect (passengers or mail.) The default value is 0x100 (256), use a lower value to produce less cargo, or a higher value to produce more cargo.&lt;br /&gt;
&lt;br /&gt;
Properties 1E and 1F are an alternative to the cargo production callback of houses, and allow for cargo to be set up to be produced by towns without having to redefine any houses, although it is not as flexible.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5233</id>
		<title>NML:Roadstops</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Roadstops&amp;diff=5233"/>
		<updated>2026-03-19T18:39:14Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Animation triggers */  Add missing flag.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Road stops can only be defined in OpenTTD {{ottd|14.0}} or later. &lt;br /&gt;
&lt;br /&gt;
==Road stop IDs==&lt;br /&gt;
OpenTTD supports 64000 road stop types per game.&lt;br /&gt;
&lt;br /&gt;
Rpad stop IDs are NewGRF-local and can therefore freely be chosen within the ID ranges. &lt;br /&gt;
&lt;br /&gt;
A road stop is allocated by setting the &#039;class&#039;-property, which should therefore be set first.&lt;br /&gt;
&lt;br /&gt;
Road stop sprite layouts should always set a suitable ground tile sprite, and should not assume that a road type GRF will provide suitable overlay sprites.&lt;br /&gt;
Suggested ground sprite IDs include: GROUNDSPRITE_ROAD_X/GROUNDSPRITE_ROAD_Y (straight road on grass), 1314/1313 (straight road with pavement), 2692 - 2695 (bay road stop ground).&lt;br /&gt;
&lt;br /&gt;
==Road stop properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Road stops belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: {{ottdp|15.0|no}} The road stop type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one road stop in every class.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| availability_type&lt;br /&gt;
| RST_AVAILABILITY_TYPE_XXX&lt;br /&gt;
| XXX = [PASSENGER &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; FREIGHT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ALL]&lt;br /&gt;
The default value is RST_AVAILABILITY_TYPE_ALL&lt;br /&gt;
|-&lt;br /&gt;
| draw_mode&lt;br /&gt;
| bitmask(RST_DRAW_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of draw mode flags|list of draw mode flags]]&lt;br /&gt;
The default value is bitmask(RST_DRAW_FLAG_BAY_ROAD, RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY)&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&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;
See [[#Animation_triggers|list of animation triggers]]&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(RST_GENERAL_FLAG_XXX, ...)&lt;br /&gt;
| See [[#List of general flags|list of general flags]]&lt;br /&gt;
|-&lt;br /&gt;
| cost_multipliers&lt;br /&gt;
| [build_cost, clear_cost]&lt;br /&gt;
| Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of draw mode flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_BAY_ROAD&lt;br /&gt;
| Draw road type ground sprite for bay stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY&lt;br /&gt;
| Draw road overlays for drive-through stops.&lt;br /&gt;
|-&lt;br /&gt;
| RST_DRAW_FLAG_WAYPOINT_GROUND&lt;br /&gt;
| {{ottdp|15.0|no}} Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of general flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_RANDOM_ANIMATION&lt;br /&gt;
| Animation callback requires random bits in variable extra_callback_info1.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_CATENARY&lt;br /&gt;
| Do not show catenary graphics.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY&lt;br /&gt;
| Only allow drive-through stops (not bay stops).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_NO_AUTO_ROAD_CONNECTION&lt;br /&gt;
| Do not automatically build connecting road pieces.&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_ROAD_ONLY&lt;br /&gt;
| Only show in the road build menu (not tram).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY&lt;br /&gt;
| Only show in the tram build menu (not road).&lt;br /&gt;
|-&lt;br /&gt;
| RST_GENERAL_FLAG_DRAW_MODE_REGISTER&lt;br /&gt;
| {{ottdp|15.0|no}} Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between road stops, [[NML:Stations|stations]] and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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:Stations|stations]] and [[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;wikitable sortable&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| view&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of the road stop. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| stop_type&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| XXX = [BUS &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; TRUCK &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; {{ottdp|15}}WAYPOINT]&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;
| has_road&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has road&lt;br /&gt;
|-&lt;br /&gt;
| has_tram&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this road stop has tram&lt;br /&gt;
|-&lt;br /&gt;
| road_type&lt;br /&gt;
| [Road type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|roadtype translation table]], or 0xFF if there is no road&lt;br /&gt;
|-&lt;br /&gt;
| tram_type&lt;br /&gt;
| [Tram type &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xFF]&lt;br /&gt;
| Entry from [[NML:Railtypetable|tramtype translation table]], or 0xFF if there is no tram&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0 .. (frame_count - 1)&lt;br /&gt;
| Current animation frame, with the maximum defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_info&amp;lt;/code&amp;gt; property.&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;
| 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;
| random_bits_tile&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, specific to this road stop tile.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
| 0..255&lt;br /&gt;
| Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| drawn_in_gui&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottdp|15}} 1 if this road stop is being drawn in the build window&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;wikitable sortable&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, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| See tile_slope&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. Only valid for tiles of the same object.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_road_stop&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the given tile a road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_road_stop_id&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
|&lt;br /&gt;
| Is nearby_tile_same_grf is true, ID of a road stop on a nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by the same GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile defined by another GRF?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile using original graphics?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is a road stop on a nearby tile the same station as this?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_VIEW_XXX&lt;br /&gt;
| The view/rotation of a nearby road stop tile. See [[#List of road stop views|list of road stop views]]&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_different_view&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the view/rotation of a road stop on a nearby tile different to that of this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_drive_through&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is nearby road stop tile a drive-through road stop?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| RST_TYPE_XXX&lt;br /&gt;
| Road stop type of a nearby tile. See stop_type&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_stop_type&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| 0 .. 1&lt;br /&gt;
| Is the stop type of a nearby road stop tile the same as this tile?&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| x, y offset (-8..7)&lt;br /&gt;
| [0xFFFFFFFF &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; GRFID]&lt;br /&gt;
| 0xFFFFFFFF if the nearby tile is not a road stop, 0 if the nearby tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop on the nearby tile&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the road stop has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===List of road stop views===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Type&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-east&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SE&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-east&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_SW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing south-west&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_BAY_NW&lt;br /&gt;
| Bay&lt;br /&gt;
| Facing north-west&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_X&lt;br /&gt;
| Drive-through&lt;br /&gt;
| X-axis: north-east to south-west&lt;br /&gt;
|-&lt;br /&gt;
| RST_VIEW_DRIVE_THROUGH_Y&lt;br /&gt;
| Drive-through&lt;br /&gt;
| Y-axis: north-west to south-east&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road stop callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 a road stop placed on the map&lt;br /&gt;
|-&lt;br /&gt;
| purchase &amp;lt;ref name=&amp;quot;notyetbuilt&amp;quot;&amp;gt;These callbacks are called when the road stop is not yet built&amp;lt;/ref&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics shown in the build menu&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| 0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1&lt;br /&gt;
| Whether this road stop type is available in the build menu, 1 is available, 0 is unavailable&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. 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if the object flag OBJ_FLAG_RANDOM_ANIMATION is set.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger, see the [[#Animation triggers| table]] below.&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;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
! Happens on&lt;br /&gt;
! extra_callback_info2&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_BUILT&lt;br /&gt;
| Road stop is built&lt;br /&gt;
| Newly built tile&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_NEW_CARGO&lt;br /&gt;
| New cargo arrives at station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_CARGO_TAKEN&lt;br /&gt;
| CRGO removed from station&lt;br /&gt;
| All tiles&lt;br /&gt;
| Bits 8..15 contain the triggering cargo type&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_ENTER&lt;br /&gt;
| Road vehicle enters stop (starts loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LEAVE&lt;br /&gt;
| Road vehicle leaves stop (done loading/unloading)&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_VEH_LOAD&lt;br /&gt;
| Road vehicle loads/unloads cargo&lt;br /&gt;
| Tile where the vehicle is	&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_ROAD_STOP_250_TICKS&lt;br /&gt;
| Every 250 ticks&lt;br /&gt;
| All tiles&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{ottd|15.0}} ANIM_TRIGGER_ROAD_STOP_TILELOOP&lt;br /&gt;
| Tile is processed in the periodic processing loop&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=5232</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=5232"/>
		<updated>2026-03-19T18:32:04Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Station properties */ Add missing flags.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Since {{ottd|15.0}} {{nml|0.7.6}} it is possible to register up to 256 tile types.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles &amp;lt;br&amp;gt;&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated since &#039;&#039;&#039;{{nml|0.7.6}}&#039;&#039;&#039; , replaced by &#039;&#039;&#039;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_flags&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_ALL_TILES&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station size for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&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(STAT_ANIM_XXX, ANIM_TRIGGER_STAT_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TILELOOP&lt;br /&gt;
:Tile is processed in the periodic processing loop&lt;br /&gt;
;{{ottd|15.0}} ANIM_TRIGGER_STAT_TRAIN_RESERVES&lt;br /&gt;
:Train reserves platform (using PBS)&lt;br /&gt;
|-&lt;br /&gt;
| badges&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| Since {{ottd|15.0}}&lt;br /&gt;
|-&lt;br /&gt;
| tile_flags&lt;br /&gt;
| Array of &amp;lt;code&amp;gt;bitmask(STAT_TILE_XXX, ...)&amp;lt;/code&amp;gt;&lt;br /&gt;
| Since {{ottd|15.0}} {{nml|0.7.6}} &amp;lt;br&amp;gt;&lt;br /&gt;
Each element of array corresponds to one tile type. Array should always have even number of elements. &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;XXX&#039;&#039;&#039; should be replaced by one of the following:&lt;br /&gt;
; PYLON&lt;br /&gt;
: Draw pylon on tile with that type.&lt;br /&gt;
; NOWIRE&lt;br /&gt;
: Hide wire on tile with that type.&lt;br /&gt;
; BLOCKED&lt;br /&gt;
: Do not allow trains to enter tile with that type.&lt;br /&gt;
|}&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;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&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;wikitable sortable&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;wikitable sortable&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;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&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;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station 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;wikitable sortable&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_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&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_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
; 0..255 {{ottd|15.0}}&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&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 [[#Station_sections|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;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| {{ottd|15.0}} Check if the rail station has that specific badge attached.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
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 cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
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;wikitable sortable&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;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, even values up to FE can be returned as long as the tile is defined.&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 24, 8)&amp;lt;/code&amp;gt;: Original tile type in static layout.&lt;br /&gt;
&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). 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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
Note: Every time the animation frame is changed the map tile will be refreshed, even if the selected graphics stay the same. Therefore using the animation frame as a timer should be avoided, and animation triggers should be preferred instead.&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;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5230</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5230"/>
		<updated>2026-03-16T08:09:01Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Introduction */  Add reference to BaNaNaS-get_badge_labels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This page is dedicated for tracking registered badge labels.&lt;br /&gt;
If you write or publish a NewGRF which introduces a new badge label, please also add comment about it here.&lt;br /&gt;
However, before you introduces a new label reconsider if any of available labels fulfills the same purpose. Do not introduces two or more labels for same purpose.&lt;br /&gt;
If you introduce a new class, please also provide a table for badges that belong to it.&lt;br /&gt;
For ease of maintenance keep alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This page is maintained manually and some grf developers oppose to that despicable labor. Therefore you might also want to visit https://github.com/Rito13/BaNaNaS-get_badge_labels/blob/main/gen_docs%2Fpublic_labels.md, which is updated automatically with content uploaded to BaNaNaS.&lt;br /&gt;
&lt;br /&gt;
== Classes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag || OpenTTD default badges || Country/Region&lt;br /&gt;
|-&lt;br /&gt;
| livery || OpenTTD default badges || Livery&lt;br /&gt;
|-&lt;br /&gt;
| power || OpenTTD default badges || Propulsion&lt;br /&gt;
|-&lt;br /&gt;
| region || OpenTTD default badges || Region&lt;br /&gt;
|-&lt;br /&gt;
| role || OpenTTD default badges || Role&lt;br /&gt;
|-&lt;br /&gt;
| zone || OpenTTD default badges || Zone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badges ==&lt;br /&gt;
&lt;br /&gt;
=== Flag ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag/AD || OpenTTD default badges || Andorra&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Livery ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| livery/2cc || OpenTTD default badges || Dual company colour (2CC)&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/1cc || OpenTTD default badges || Random based on first company colour&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/2cc || OpenTTD default badges || Random based on second company colour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| power/battery || OpenTTD default badges || Battery&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel || OpenTTD default badges || Diesel&lt;br /&gt;
|-&lt;br /&gt;
| power/electric || OpenTTD default badges || Electric&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac || OpenTTD default badges || Electric (AC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc || OpenTTD default badges || Electric (DC)&lt;br /&gt;
|-&lt;br /&gt;
| power/steam || OpenTTD default badges || Steam&lt;br /&gt;
|-&lt;br /&gt;
| power/turbine || OpenTTD default badges || Gas Turbine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| region/africa || OpenTTD default badges || Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/eastern || OpenTTD default badges || Eastern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/middle || OpenTTD default badges || Middle Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/northern || OpenTTD default badges || Northern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/southern || OpenTTD default badges || Southern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/western || OpenTTD default badges || Western Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/america || OpenTTD default badges || Americas&lt;br /&gt;
|-&lt;br /&gt;
| region/america/caribbean || OpenTTD default badges || Caribbean&lt;br /&gt;
|-&lt;br /&gt;
| region/america/central || OpenTTD default badges || Central America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/northern || OpenTTD default badges || Northern America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/south || OpenTTD default badges || South America&lt;br /&gt;
|-&lt;br /&gt;
| region/asia || OpenTTD default badges || Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/central || OpenTTD default badges || Central Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/eastern || OpenTTD default badges || Eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southeastern || OpenTTD default badges || South-eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southern || OpenTTD default badges || Southern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/western || OpenTTD default badges || Western Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/europe || OpenTTD default badges || Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/eastern || OpenTTD default badges || Eastern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/northern || OpenTTD default badges || Northern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/southern || OpenTTD default badges || Southern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/western || OpenTTD default badges || Western Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania || OpenTTD default badges || Oceania&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/australia_and_new_zealand || OpenTTD default badges || Australia and New Zealand&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/melanesia || OpenTTD default badges || Melanesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/micronesia || OpenTTD default badges || Micronesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/polynesia || OpenTTD default badges || Polynesia&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Role ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| role/banking || OpenTTD default badges || Banking&lt;br /&gt;
|-&lt;br /&gt;
| role/express_freight || OpenTTD default badges || Express freight&lt;br /&gt;
|-&lt;br /&gt;
| role/express_passenger || OpenTTD default badges || Express passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/freight || OpenTTD default badges || Freight&lt;br /&gt;
|-&lt;br /&gt;
| role/heavy_freight || OpenTTD default badges || Heavy freight&lt;br /&gt;
|-&lt;br /&gt;
| role/light_freight || OpenTTD default badges || Light freight&lt;br /&gt;
|-&lt;br /&gt;
| role/mail || OpenTTD default badges || Mail&lt;br /&gt;
|-&lt;br /&gt;
| role/mixed || OpenTTD default badges || Mixed&lt;br /&gt;
|-&lt;br /&gt;
| role/passenger || OpenTTD default badges || Passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/prototype || OpenTTD default badges || Prototype&lt;br /&gt;
|-&lt;br /&gt;
| role/restaurant_car || OpenTTD default badges || Restaurant car&lt;br /&gt;
|-&lt;br /&gt;
| role/shunting || OpenTTD default badges || Shunting&lt;br /&gt;
|-&lt;br /&gt;
| role/snowplough || OpenTTD default badges || Snowplough&lt;br /&gt;
|-&lt;br /&gt;
| role/utility || OpenTTD default badges || Utility&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Zone ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| zone/agricultural || OpenTTD default badges || Agricultural&lt;br /&gt;
|-&lt;br /&gt;
| zone/com || OpenTTD default badges || Commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/high || OpenTTD default badges || High density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/low || OpenTTD default badges || Low density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/medium || OpenTTD default badges || Medium density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/forestry || OpenTTD default badges || Forestry&lt;br /&gt;
|-&lt;br /&gt;
| zone/general || OpenTTD default badges || General&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind || OpenTTD default badges || Industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/high || OpenTTD default badges || High density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/low || OpenTTD default badges || Low density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/medium || OpenTTD default badges || Medium density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/leisure || OpenTTD default badges || Leisure&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed || OpenTTD default badges || Commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/high || OpenTTD default badges || High density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/low || OpenTTD default badges || Low density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/medium || OpenTTD default badges || Medium density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/other || OpenTTD default badges || Other&lt;br /&gt;
|-&lt;br /&gt;
| zone/public || OpenTTD default badges || Public&lt;br /&gt;
|-&lt;br /&gt;
| zone/res || OpenTTD default badges || Residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/high || OpenTTD default badges || High density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/low || OpenTTD default badges || Low density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/medium || OpenTTD default badges || Medium density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/transport || OpenTTD default badges || Transport&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Stations&amp;diff=5228</id>
		<title>Action0/Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Stations&amp;diff=5228"/>
		<updated>2026-02-15T16:22:54Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* General Flags (13) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Defining properties of new stations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike vehicles, the new stations have no equivalent in TTD. The IDs are therefore free to be chosen and will in fact be allocated automatically. In action 0, you only specify IDs relative to the set, i.e. the ID of the first station type is 00, the second station type is 01 and so on.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} In TTDPatch each game can only have 255 station IDs for all active grf files.&lt;br /&gt;
&lt;br /&gt;
The only property you &#039;&#039;&#039;must&#039;&#039;&#039; set for each station ID is 08 (in addition to defining an [[Action3|action 3]] for it), anything else can be left at the default. It must be the first property you set for each station ID, because the station ID is actually undefined until it has been assigned a class through property 08. Also, all station IDs must get their classes in the right order, starting from ID 00 onwards.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|08||D||{{ottdp|0.6|2.5|ttdprev=alpha 19}}||Class ID, see below&lt;br /&gt;
|-&lt;br /&gt;
|09||V||{{ottdp|0.6|2.5|ttdprev=alpha 20}}||Sprite layout, see below&lt;br /&gt;
|-&lt;br /&gt;
|0A||B/B*||{{ottdp|0.6|2.5|ttdprev=alpha 20}}/{{ottdp|14.0}}||Copy sprite layout&lt;br /&gt;
|-&lt;br /&gt;
|0B||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Callback flags&lt;br /&gt;
|-&lt;br /&gt;
|0C||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Bit mask of disabled numbers of platforms&lt;br /&gt;
|-&lt;br /&gt;
|0D||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Bit mask of disabled platform lengths&lt;br /&gt;
|-&lt;br /&gt;
|0E||V||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Define custom layout, see below&lt;br /&gt;
|-&lt;br /&gt;
|0F||B/B*||{{ottdp|0.6|2.5|ttdprev=alpha 22}}/{{ottdp|14.0}}||Copy custom layout from stationid given by argument&lt;br /&gt;
|-&lt;br /&gt;
|10||W||{{ottdp|0.6|2.5|ttdprev=alpha 25}}||Little/lots threshold&lt;br /&gt;
|-&lt;br /&gt;
|11||B||{{ottdp|0.6|2.5|ttdprev=alpha 27}}||Pylon placement&lt;br /&gt;
|-&lt;br /&gt;
|12||D||{{ottdp|0.6|2.5|ttdprev=alpha 30}}||Bit mask of cargo type triggers for random sprites&lt;br /&gt;
|-&lt;br /&gt;
|13||B||{{ottdp|0.6|2.5|ttdprev=alpha 30}}||General flags&lt;br /&gt;
|-&lt;br /&gt;
|14||B||{{ottdp|0.6|2.5|ttdprev=alpha 47}}||Overhead wire placement&lt;br /&gt;
|-&lt;br /&gt;
|15||B||{{ottdp|0.6|2.5|ttdprev=alpha 51}}||Can train enter tile&lt;br /&gt;
|-&lt;br /&gt;
|16||W||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation information&lt;br /&gt;
|-&lt;br /&gt;
|17||B||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation speed&lt;br /&gt;
|-&lt;br /&gt;
|18||W||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation triggers&lt;br /&gt;
|-&lt;br /&gt;
|1A||V||{{ottdp|1.2|no|ottdrev=r22518}}||Advanced sprite layout with register modifiers&lt;br /&gt;
|-&lt;br /&gt;
|1B|| || ||Reserved&lt;br /&gt;
|-&lt;br /&gt;
|1C||W||{{ottdp|14}}||Station name&lt;br /&gt;
|-&lt;br /&gt;
|1D||W||{{ottdp|14}}||Station class name&lt;br /&gt;
|-&lt;br /&gt;
|1E||V||{{ottdp|15}}||Station sprite layout flags&lt;br /&gt;
|-&lt;br /&gt;
|1F||W n*W||{{ottdp|15}}||List of badges&lt;br /&gt;
|-&lt;br /&gt;
|20||B* n*B||{{ottdp|15}}||Minimum height list.&lt;br /&gt;
|-&lt;br /&gt;
|21||B* n*B||{{ottdp|15}}||Blocked bridge pillars list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unofficial additions and changes. Don&#039;t rely on them to ever work this way in OpenTTD or TTDPatch:&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|1B||8*B||whatever-PP||Minimum bridge height for bridges over stations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Station class (08) ===&lt;br /&gt;
TTDPatch groups sets of new station graphics into various classes. &amp;amp;nbsp;The classes can be selected by the top dropdown list in the construction window, and the individual stations within the class from the bottom dropdown list. &amp;amp;nbsp;In addition, each station can alter its appearance using [[VariationalAction2|variational]] and/or [[RandomAction2|random]] action 2 entries.&lt;br /&gt;
&lt;br /&gt;
Only two classes are pre-defined:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Name!!Class ID!!Intended use for station&lt;br /&gt;
|-&lt;br /&gt;
|DFLT||44 46 4C 54||Default, no special station type&lt;br /&gt;
|-&lt;br /&gt;
|WAYP||57 41 59 50||Non-cargo stations, waypoints, signal boxes etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You may simply use other classes than the above, as long as no more than (at the moment) 16 classes are used among all active .grf files at any time.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
&lt;br /&gt;
When a waypoint station is built, it will not accept cargo nor will any cargo appear from nearby industries or towns. &amp;amp;nbsp;Trains will not stop at waypoint stations, regardless of the non-stop order and/or the nonstop switch.&lt;br /&gt;
&lt;br /&gt;
=== Sprite layout (09) ===&lt;br /&gt;
This controls what sprites are displayed, where they are displayed, and in what order. &amp;amp;nbsp;The property is variable sized, and contains the data for all 8 possible station tile types. &amp;amp;nbsp;If this property is set, the num-ent in the corresponding [[Action1|action 1]] need not be equal to 12 (hex), it can in fact be any number, and any number of sprites can be displayed in any order.&lt;br /&gt;
&lt;br /&gt;
The data is specified as data for all eight tiles in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;data1&amp;amp;gt; &amp;amp;lt;data2&amp;amp;gt; ... &amp;amp;lt;datan&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|V||data1...||The variable size data for each of the &amp;amp;lt;num&amp;amp;gt; tiles, as specified below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Number of tiles supported =====&lt;br /&gt;
* Normally this is 8, but you can specify fewer as well&lt;br /&gt;
* Using callback flags bit 1, specifying more makes sense too&lt;br /&gt;
* This value must be the same for all stations set by this action 0, even though it must be repeated for the prop. 09 definition of each station ID as well&lt;br /&gt;
&lt;br /&gt;
(Note that num is an extended byte, see [[GRFActionsDetailed]].)&lt;br /&gt;
&lt;br /&gt;
The content of each of the (usually eight) data sets is either a new sprite layout:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|D||groundsprite||the sprite to draw for the rails; this is by default a TTD sprite, but with bit 31 set an [[Action1|action 1]] sprite (42D+X) may be specified&lt;br /&gt;
|-&lt;br /&gt;
|V||spritedata||the data for station sprites, see below; each has a size of 10 bytes, and there may be several&lt;br /&gt;
|-&lt;br /&gt;
|B||80||a literal 80 ends the list of sprites for this tile&lt;br /&gt;
|}&lt;br /&gt;
or, alternatively, the instruction to use TTD&#039;s layout by using four zero bytes 00 00 00 00 instead of the groundsprite bytes. You can use [http://www.bytetransfer.de/projects/ttdpatch/docs/spriteidmapping.php the online sprite ID converter] to look up the sprite IDs you can use for all the climates.&lt;br /&gt;
&lt;br /&gt;
One can draw two types of sprites. &amp;amp;nbsp;One type is one that establishes a new 3D bounding box for use by the sprite sorter. &amp;amp;nbsp;The other type shares the 3D bounding box of the previous sprite(s). &amp;amp;nbsp;It must not be larger than the sprite which established the bounding box, nor must any part of it be outside this box. &amp;amp;nbsp;For simplicity, it should have the exact same dimensions as the sprite it shares the bounding box with. &amp;amp;nbsp;The latter type is supported in the station construction window display only since TTDPatch 2.6 r1684.&lt;br /&gt;
&lt;br /&gt;
The spritedata of sprites with their own bounding box has this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||xofs||x-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||yofs||y-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||zofs||z-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||xextent||size of sprite in x direction&lt;br /&gt;
|-&lt;br /&gt;
|B||yextent||size of sprite in y direction&lt;br /&gt;
|-&lt;br /&gt;
|B||zextent||size of sprite in z direction&lt;br /&gt;
|-&lt;br /&gt;
|D||sprite||sprite number to draw&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The spritedata of sprites sharing the bounding box has this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||xofs||x-offset relative to previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|B||yofs||y-offset relative to previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|B||80||a literal 80&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|D||sprite||sprite number to draw&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since OpenTTD r18959 you can draw multiple ground sprites for a tile, which is useful if you want to use the usual rail/grass/concrete groundtile, but still need to add features to it without using a new bounding box. To do so use the syntax of sprites sharing the previous bounding box, but use it before the first bounding box definition. xpixeloffset and ypixeloffset refer to the usual spot of groundtiles. The same feature is also partially supported in TTDPatch since TTDPatch 2.6 r2312: TTDPatch ignores the xofs and yofs fields and always uses (0,0) for the offset. If you are developing a GRF that needs to be compatible with both OpenTTD and TTDPatch, you should always keep xofs and yofs zero to get the same effect in both games.&lt;br /&gt;
Note however that both implementations do not consider the [[Action0/Stations#General_Flags_.2813.29|setting of prop13 bit 0]], hence these &amp;quot;multiple ground sprites&amp;quot; have to be always part of the building sprites set and cannot be part of the different sprite set for ground sprites.&lt;br /&gt;
&lt;br /&gt;
The sprite number can have the following values (remember to use little endian, i.e. reversed byte order):&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!!Sprite&lt;br /&gt;
|-&lt;br /&gt;
|0000042D+X||use sprite X from the corresponding [[Action1|action 1]] block (i.e. 0000042D for the first, 0000042E for the second, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|0000842D+X||same, but draw it using company colour translation&lt;br /&gt;
|-&lt;br /&gt;
|0322442D+X||same, but draw in transparent mode (actual colours of the sprite are disregarded entirely); supported in station construction window display since TTDPatch 2.6 r1683&lt;br /&gt;
|-&lt;br /&gt;
|RRRR842D+X||draw sprite with colour translation defined in sprite RRRR; available since TTDPatch 2.6 r1683&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With bit 31 set, this sprite will refer to a TTD sprite, not the action 1 sprite. For the first ground sprite the reverse meaning applies.&lt;br /&gt;
&lt;br /&gt;
Depending on the railtype the sprites may get additional offsets:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! !! Normal/electrified rail !! Monorail !! Maglev&lt;br /&gt;
|-&lt;br /&gt;
|TTD sprites || 0 || 82 || 164&lt;br /&gt;
|-&lt;br /&gt;
|Action 1 sprite (first ground sprite) || 0 || 1 || 2&lt;br /&gt;
|-&lt;br /&gt;
|Action 1 sprite (other sprites in the layout) || 0 || 0 || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, TTD sprites and the first ground sprite are affected by the railtype, while other action 1 sprites in the layout are not. The offset &amp;quot;82&amp;quot; refers to the offset between the default TTD track sprites; if you are using non-track ground sprites which are not from an action 1, you need to supply fake spritenumbers which preemptively reverse the offsets (that is, you need different sprite layouts for every railtype your station is available for).&lt;br /&gt;
&lt;br /&gt;
Setting bit 30 forces this sprite to be displayed normally even in &amp;quot;transparent buildings&amp;quot; mode (supported only in TTDPatch 2.6 r1695 and later).&lt;br /&gt;
&lt;br /&gt;
See below for an example of linked sprites as well as transparent sprites (e.g. for a station roof).&lt;br /&gt;
&lt;br /&gt;
Note that the coordinates here are 3D coordinates with x running from top-right to bottom-left and y running from top-left to bottom-right, with the tile dimensions being 16x16 (and 8 for one height level). This means the x and y values should always be within 0-15 (decimal).&lt;br /&gt;
&lt;br /&gt;
This is different to and independent from the x/y offsets used in the actual .NFO file. &amp;amp;nbsp;The 3D bounding box is used by TTD&#039;s sprite sorter to figure out the order in which to draw the sprites, as well as telling it which sprites to draw, because those whose bounding box falls outside the currently updated screen rectangle will not be drawn. &amp;amp;nbsp;Make sure the 3D bounding box is large enough to contain the entire sprite, but not so large that the sprite sorter can&#039;t determine which sprites should be in front.&lt;br /&gt;
&lt;br /&gt;
This means that the order in which you specify sprites is irrelevant. &amp;amp;nbsp;Sprites will get drawn from back to front, in the order which the sprite sorter determines as correct, from their bounding boxes. &amp;amp;nbsp;There are two exceptions, however:&lt;br /&gt;
* Sprites sharing the same bounding box will always be drawn in the given order.&lt;br /&gt;
* The station construction window display doesn&#039;t use the sprite sorter. Tiles that may be displayed in that window need to be specified in the correct drawing order, back to front.&lt;br /&gt;
&lt;br /&gt;
=== Copy sprite layout (0A) ===&lt;br /&gt;
&lt;br /&gt;
This is not a property as such, but an action. &amp;amp;nbsp;It takes as argument a byte which is interpreted as station-ID to copy the custom sprite layout from.&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|14.0}} this property is now an extended byte.&lt;br /&gt;
&lt;br /&gt;
=== Callback flags (0B) ===&lt;br /&gt;
For stations, the following [[callbacks]] can be defined by setting the corresponding bit in property 0B:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Variable 0C value!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||13||Whether to make station available in construction window (non-zero callback return) or not (callback returns zero)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||14||Use callback to select sprite layout&lt;br /&gt;
|-&lt;br /&gt;
|2||4||141||Decide next animation frame&lt;br /&gt;
|-&lt;br /&gt;
|3||8||142||Decide animation speed&lt;br /&gt;
|-&lt;br /&gt;
|4||10||149||Custom slope check&lt;br /&gt;
|}&lt;br /&gt;
Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the [[VariationalAction2|VarAction2]] for callbacks.&lt;br /&gt;
&lt;br /&gt;
=== Selection of numbers of platforms and length (0C, 0D) ===&lt;br /&gt;
&lt;br /&gt;
By default all platform lengths and any number of platforms is available for the new stations. &amp;amp;nbsp;Using these properties, you can choose which ones should be unavailable by setting the corresponding bit in the property.&lt;br /&gt;
&lt;br /&gt;
The values are a byte, used as a bit mask. &amp;amp;nbsp;Bits 0 to 6 control the availability of number or length 1 to 7, and bit 7 controls the availability of the &amp;quot;+7&amp;quot; button. &amp;amp;nbsp;Each bit that is set disables the corresponding length or number of platforms.&lt;br /&gt;
&lt;br /&gt;
For compatibility with &amp;quot;largestations off&amp;quot;, at least one length between 1 and 5 (bits 0 to 4) and one number of platforms between 1 and 4 (bits 0 to 3) must be available, i.e. at least one of these bits must be unset.&lt;br /&gt;
&lt;br /&gt;
=== Define custom layout (0E) ===&lt;br /&gt;
&lt;br /&gt;
This allows choosing which tile type is built at which tile of a newly built station. &amp;amp;nbsp;There are four different types, which TTD normally defines as&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Tile type!!Appearance&lt;br /&gt;
|-&lt;br /&gt;
|00||plain platform&lt;br /&gt;
|-&lt;br /&gt;
|02||platform with building&lt;br /&gt;
|-&lt;br /&gt;
|04||platform with roof, left side&lt;br /&gt;
|-&lt;br /&gt;
|06||platform with roof, right side&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, all even values up to FE are supported if the sprite layout is defined via property 09/0A.&lt;br /&gt;
&lt;br /&gt;
These numbers are used for stations in NE-SW direction, or these numbers plus one for stations in the NW-SE direction. &amp;amp;nbsp;To define a custom layout, use this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||length||length of platforms for this layout&lt;br /&gt;
|-&lt;br /&gt;
|B||number||number of platforms for this layout&lt;br /&gt;
|-&lt;br /&gt;
|V||tiles||length*number bytes of tile types, one platform after another, only 00, 02, 04 or 06 are allowed as values&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Repeat this as often as necessary to define the layouts for all supported combinations of length and number. &amp;amp;nbsp;End the definitions with a 00 00 (zero length and zero number). &amp;amp;nbsp;Any combinations that are not defined will be built using TTD&#039;s default layout.&lt;br /&gt;
Note that it may be easier to draw different sprite sets using a [[VariationalAction2|VarAction2]] based on [[VarAction2Stations#Platform info 40 41 46 47 49|station variable 40]], rather than redefining the layout. &amp;amp;nbsp;In addition, [[Callbacks#Custom station layout 24|callback 24]] will be used to further customize the layout as defined by this property (or by TTD if no prop 0E layout is available). This may also be easier than defining a prop 0E layout for every combination of length and number of platforms.&lt;br /&gt;
&lt;br /&gt;
=== Copy custom layout (0F) ===&lt;br /&gt;
&lt;br /&gt;
Similar to property 0A, this copies the custom layout from the station-ID given by the argument.&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|14.0}} this property is now an extended byte.&lt;br /&gt;
&lt;br /&gt;
=== Little/lots threshold (10) ===&lt;br /&gt;
Amount of cargo for switching from &amp;quot;little&amp;quot; to &amp;quot;lots&amp;quot; of cargo. &amp;amp;nbsp;TTDPatch separates the full range of cargo amounts (0 to 4095) into two separate subranges, &amp;quot;little&amp;quot; and &amp;quot;lots&amp;quot; of cargo. &amp;amp;nbsp;This allows better control of cargo amount based graphics (if needed). &amp;amp;nbsp;Property 10 specifies at what amount of cargo the patch is to switch from one to the other subrange. &amp;amp;nbsp;See [[Action2Stations|Action 2 for stations]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Pylon placement (11) and wire placement (14) ===&lt;br /&gt;
Prop. 11 sets which tile types should have pylons when used with electrified tracks. By default, tiles 0-3 (default stations without roof) have pylons, and tiles 4-7 (default stations with roof) don&#039;t. This is a bit mask of tile types, with a bit set meaning that a pylon should be drawn. The tile types here do not consider [[Callbacks#Station sprite layout 14|callback 14]], but rather the type as it was built, i.e. from prop. 0E.&lt;br /&gt;
&lt;br /&gt;
Prop. 14 works in a similar way, except that it sets the tile types on which there should be &#039;&#039;no&#039;&#039; wires displayed. With the default value of &amp;quot;00&amp;quot;, wires are displayed everywhere, and for each bit set, the wire is omitted on that tile type.&lt;br /&gt;
&lt;br /&gt;
This property should only be used when the wires cause problems with the sprite sorter, because even when the wire is obscured by a station hall or similar, it should still show up in transparent mode so that each tile can easily be verified as being electrified.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Note: This property only allows setting the flags of the first 8 sprite layouts. Use Property 1E instead to set flags when more sprite layouts are used via prop. 0E or [[Callbacks#Custom_station_layout_.2824.29|callback 24]].&lt;br /&gt;
&lt;br /&gt;
=== Cargo types for random triggers (12) ===&lt;br /&gt;
&lt;br /&gt;
This sets which cargo types should trigger re-randomizing. The cargo types are given as a bitmask of the bits from column 3 (type B) in CargoTypes. &amp;amp;nbsp;If nothing is set (the default), the no random triggers will happen, to conserve CPU time.&lt;br /&gt;
&lt;br /&gt;
With GRF version 7 and above, the interpretation of bits changes. Instead of climate-dependent cargo slot numbers (type B), you have to set the bits of climate-independent cargo ID (type A).&lt;br /&gt;
&lt;br /&gt;
{{ottd|15.0}} Since 15.0, a default cargo translation table corresponding to the climate is used if one is not provided.&lt;br /&gt;
&lt;br /&gt;
=== General Flags (13) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.7|2.5}}||use different sprite set for ground sprites ([[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|var. 10]] is 1 for ground sprites, 0 otherwise)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.6|2.5}}||When calculating the cargo amount to display, divide the amount by half of the station perimeter (to simulate cargo distributed over the station)&lt;br /&gt;
&#039;&#039;&#039;Depricated&#039;&#039;&#039; since {{ottd|16.0}}, use bit 5 instead.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.7|2.5}}||[[Callbacks#Next animation frame (1A/26/141/153/158)|callback 141]] needs random bits in var. 10&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|1.0|2.6}}||Use custom foundations on sloped tiles (the lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|var. 10]] is 2 for foundation sprites)&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|1.0|2.6}}||When bit 3 is set, use extended foundation block instead of the simple one&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|16.0}}||When calculating the cargo amount to display, divide the amount by the station area (to simulate cargo distributed over the area of the station)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit 3 works somewhat similarly to bit 0: your sprite selection will be called again, with 2 in the lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]]. If the chain ends on a callback result, the program will assume the foundation selection has failed and will use the default foundaton sprites. The low word of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]] will contain the tile type of the current tile; if you have [[Callbacks#Station sprite layout (14)|callback 14]] enabled, this will be the its return value - otherwise, the default TTD types (platform with building, platform with left roof etc.) are used. In either case, one is added for the NW-SE orientation, in case your station needs different foundations depending on its orientation. Bits 16 and 17 are set if the NW and and NE foundations are to merged with the corresponding neighbour tile, so you shouldn&#039;t draw the corresponding edge in the foundation sprite. Other bits of variable 10 and variable 18 are reserved for future use.&lt;br /&gt;
&lt;br /&gt;
Your sprite selection code should select a foundation sprite block. The contents of this block depends on whether bit 4 is set or not.&lt;br /&gt;
* Bit 4 clear (simple foundations):&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The programme will combine the needed foundation from these 8 sprites depending on the current slope. You don&#039;t need to care about the merge data in bits 16..17 of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]]; it will be taken care of that automatically by adding the 7th and 8th sprite only when necessary.&lt;br /&gt;
* Bit 4 set (extended foundations):&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
You need to have one sprite for every slope that&#039;s possible below a rail station. The correct one will be automatically selected depending on the current slope. It can&#039;t handle the merging itself, however, so you need four foundation blocks: one with no edges removed, one with the NW edge removed, one with the NE edge removed and one with both north edges removed. Your sprite selection code is responsible for selecting the correct of those blocks according to the merge info in [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]].&lt;br /&gt;
&lt;br /&gt;
In both cases, you can put an additional value into register 100h, which will serve as an offset into the selected block. If you don&#039;t modify register 100h during the chain, it will default to 0. It is important that the dimensions of these sprites remain the same - thus bit 6 in the real sprites must be set to prevent GRFCodec from trimming the empty blue areas. The offset of these foundations must be -31 to the X direction and -9 to the Y direction.&lt;br /&gt;
&lt;br /&gt;
=== Can train enter tile (15) ===&lt;br /&gt;
&lt;br /&gt;
Like props. 11 and 14, this value contains eight bits relating to the eight possible tile types. If a bit is set, trains are prevented from routing through or entering any tile of this type.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Note: This property only allows setting the flags of the first 8 sprite layouts. Use Property 1E instead to set flags when more sprite layouts are used via prop. 0E or [[Callbacks#Custom_station_layout_.2824.29|callback 24]].&lt;br /&gt;
&lt;br /&gt;
=== Animation information (16) ===&lt;br /&gt;
&lt;br /&gt;
The low byte specifies the number of animation frames minus one, so 00 means 1 frame, 01 means 2 frames etc. The maximum number of frames is 256, although you can have some problems if your animation exceeds FD (253) frames. The high byte must be 0 for non-looping animations and 01 for looping animations. Every other value is reserved for future use. In addition, if the whole word contains FFFF, animation is turned off for this station (this is the default value).&lt;br /&gt;
Since you can&#039;t have properties for individual station tiles, this property applies for every tile of the station. If you don&#039;t want to animate some tiles, you should check the current position during [[Callbacks#Animation control (1B/25/140/152/159)|callback 140]] and return FD if the current tile doesn&#039;t need to be animated. If you also need animations of different length per tile, you&#039;ll have to use [[Callbacks#Next animation frame (1A/26/141/153/158)|callback 141]] for that.&lt;br /&gt;
&lt;br /&gt;
=== Animation speed (17) ===&lt;br /&gt;
The meaning is the same as for [[Action0Houses#Animation Speed 1B|house property 1B]], but the lower limit is 0 instead of 2, so the fastest possible animation changes frames every game tick (27ms). The default value is 2.&lt;br /&gt;
&lt;br /&gt;
=== Animation triggers (18) ===&lt;br /&gt;
This is a bit mask of events that should trigger [[Callbacks#Animation control (1B/25/140/152/159)|callback 140]], allowing to change the animation state&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Property bit, var18 byte 0!!Property value!!Version!!Meaning!!Happens on!!Var 18 byte 1&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.7|2.5}}||Station part is built||the newly built tiles||&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.7|2.5}}||New cargo arrives to station||whole station||Cargo type &amp;lt;ref name=&amp;quot;cargotype&amp;quot;&amp;gt;Bits 8..15 of var 18 contain the triggering cargo type. If your GRF has a cargo translation table, the cargo type will be an index in that table, or FFh if the cargo isn&#039;t in the table. If you don&#039;t have a cargo translation table, the cargo type will simply be the climate-dependent cargo type number.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.7|2.5}}||A cargo type gets removed from station||whole station||Cargo type &amp;lt;ref name=&amp;quot;cargotype&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|0.7|2.5}}||Train enters station (starts loading/unloading)||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|0.7|2.5}}||Train leaves station (done loading/unloading)||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|1.2|2.5|ottdrev=r22746}}||Train loads/unloads cargo||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|6||40||{{ottdp|0.7|2.5}}||Every 250 ticks||whole station||&lt;br /&gt;
|-&lt;br /&gt;
|7||80||{{ottdp|15|no}}||Tile is processed in the periodic processing loop||single tile||&lt;br /&gt;
|-&lt;br /&gt;
|8||100||{{ottdp|15|no}}||Train reserves platform (using PBS)||platform where the train reserved||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bits are reserved for future triggers, they must be zero for now.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;happens on&amp;quot; column tells which tiles will [[Callbacks#Animation control (1B/25/140/152/159) |callback 140]] be called on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced sprite layout with register modifiers (1A) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r22518}}&lt;br /&gt;
Format:&lt;br /&gt;
 1A &amp;lt;num-layouts&amp;gt; &amp;lt;0x40 + num-sprites&amp;gt;&lt;br /&gt;
                  &amp;lt;groundsprite&amp;gt; &amp;lt;flags&amp;gt; [&amp;lt;register/value&amp;gt;]...&lt;br /&gt;
                  [ &amp;lt;buildingsprite&amp;gt; &amp;lt;flags&amp;gt;&lt;br /&gt;
                      ( &amp;lt;xoffset&amp;gt; &amp;lt;yoffset&amp;gt; &amp;lt;zoffset&amp;gt; &amp;lt;xextent&amp;gt; &amp;lt;yextent&amp;gt; &amp;lt;zextent&amp;gt; &lt;br /&gt;
                      | &amp;lt;xpixeloffset&amp;gt; &amp;lt;ypixeloffset&amp;gt; 80)&lt;br /&gt;
                    [&amp;lt;register/value&amp;gt;]...&lt;br /&gt;
                  ]...&lt;br /&gt;
&lt;br /&gt;
For further details see [https://wiki.openttd.org/en/Archive/Development/Advanced%20Sprite%20Layout#stations here] for now.&lt;br /&gt;
&lt;br /&gt;
=== Minimum bridge height (1B) ===&lt;br /&gt;
&lt;br /&gt;
This property allows building bridges over stations.&lt;br /&gt;
&lt;br /&gt;
The bridge height property defines minimum clearances required for a bridge for each of the four [[Action0/Stations#Define_custom_layout_.280E.29|tile types]] of this station (or zero to not allow any bridge). Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; |-&lt;br /&gt;
!Height (1)!!Appearance&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x1 y1 ||plain platform&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x2 y2 ||platform with building&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x3 y3 ||platform with roof, left side&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x4 y4 ||platform with roof, right side&lt;br /&gt;
|}&lt;br /&gt;
(1) where the values are one byte pairs (x-direction, y-direction) expressed in hexadecimal notation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
1B &amp;lt;1st pair&amp;gt; &amp;lt;2nd pair&amp;gt; &amp;lt;3rd pair&amp;gt; &amp;lt;4th pair&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
1B x1 y1 x2 y2 x3 y3 x4 y4&amp;lt;br /&amp;gt;&lt;br /&gt;
1B 01 01 02 02 03 03 03 03 // 8px 16px 24px 24px&lt;br /&gt;
&lt;br /&gt;
This property is currently only available for JGR&#039;s Patch Pack (v0.26.0 and later) and the developmental &amp;quot;New Map Features&amp;quot; (NMF) fork of OpenTTD.&lt;br /&gt;
&lt;br /&gt;
=== Station name (1C) ===&lt;br /&gt;
&lt;br /&gt;
=== Station class name (1D) ===&lt;br /&gt;
&lt;br /&gt;
=== Station sprite layout flags (1E) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Since OpenTTD supports more than 8 sprite layouts to be used, props. 11, 14 and 15 are not sufficient to set the flags for all usable sprite layouts. This property is variable length and allows these flags to be set for each tile beyond the original limit of 8.&lt;br /&gt;
&lt;br /&gt;
The data is specified as flags for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;flags1&amp;amp;gt; &amp;amp;lt;flags2&amp;amp;gt; ... &amp;amp;lt;flagsn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||flags1...||The flags for each of the &amp;amp;lt;num&amp;amp;gt; tiles, as specified below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
|Bit||Value||Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||01||Tile should contain catenary pylons.&lt;br /&gt;
|-&lt;br /&gt;
|1||02||Tile should NOT contain catenary wires.&lt;br /&gt;
|-&lt;br /&gt;
|2||04||Tile is blocked to vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These should be combined as needed.&lt;br /&gt;
&lt;br /&gt;
===Minimum Bridge Height (20)===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} This property allows building bridges over stations.&lt;br /&gt;
&lt;br /&gt;
The bridge height property defines minimum clearances required for a bridge for the sprite layouts of this station (or zero to not allow any bridge). Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px). &lt;br /&gt;
&lt;br /&gt;
The data is specified as minimum height for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;height1&amp;amp;gt; &amp;amp;lt;height2&amp;amp;gt; ... &amp;amp;lt;heightn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||height...||The minimum heights for each of the &amp;amp;lt;num&amp;amp;gt; tiles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocked Pillar Information (21)===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the station tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the station being bridgeable.&lt;br /&gt;
&lt;br /&gt;
The data is specified as blocked pillar flags for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;flags1&amp;amp;gt; &amp;amp;lt;flags2&amp;amp;gt; ... &amp;amp;lt;flagsn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||flags...||The blocked pillar flags for each of the &amp;amp;lt;num&amp;amp;gt; tiles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag bits are as follows:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
|Bit||Value||Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||01||Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|1||02||Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||04||Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||08||Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|4||10||Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|5||20||Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|6||40||Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|7||80||Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These should be combined as needed.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Using TTD&#039;s sprite layouts for certain tiles ===&lt;br /&gt;
&lt;br /&gt;
To use TTD&#039;s layout, you use &amp;lt;code&amp;gt;00 00 00 00&amp;lt;/code&amp;gt; for the ground sprite number and leave off everything else.&lt;br /&gt;
&lt;br /&gt;
So instead of for example&lt;br /&gt;
&lt;br /&gt;
 F4 03 00 00&lt;br /&gt;
    00 00 00    10 05 02    2E 84 00 00&lt;br /&gt;
    00 0B 00    10 05 02    30 84 00 00&lt;br /&gt;
    80&lt;br /&gt;
&lt;br /&gt;
you just put&lt;br /&gt;
&lt;br /&gt;
 00 00 00 00&lt;br /&gt;
&lt;br /&gt;
=== Using transparent sprites ===&lt;br /&gt;
&lt;br /&gt;
You can use transparent sprites to make for example the roof translucent like in TTD&#039;s stations. The roof of TTD&#039;s stations is made like this:&lt;br /&gt;
&lt;br /&gt;
 00 00 10    10 10 0A    37 84 00 00&lt;br /&gt;
 00 00 80    00 00 00    3B 44 22 03&lt;br /&gt;
&lt;br /&gt;
The first sprite here is the non-transparent frame of the roof, drawn in company colours (it has bit 15 set). The second part is a special &amp;quot;linked&amp;quot; sprite without its own bounding box, it shares that of the previous sprite. That&#039;s done by setting the z offset to 80.&lt;br /&gt;
&lt;br /&gt;
To make that second sprite transparent, bit 14 is set in the sprite number, and the upper word is set to 322 (*), so 0322443B means to take sprite 43B and draw it in transparent mode. The colours of that sprite are ignored entirely, every pixel in colour 0 is fully transparent, and all other pixels are semi-transparent (essentially just causing what they are drawn over to become darker).&lt;br /&gt;
&lt;br /&gt;
(*) This is the [[RecolorSprites#Default_recolour_sprites | recolour sprite]] for the glass effect.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Stations&amp;diff=5227</id>
		<title>Action0/Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Stations&amp;diff=5227"/>
		<updated>2026-02-15T16:21:41Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* General Flags (13) */  DivByStationArea flag.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Defining properties of new stations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike vehicles, the new stations have no equivalent in TTD. The IDs are therefore free to be chosen and will in fact be allocated automatically. In action 0, you only specify IDs relative to the set, i.e. the ID of the first station type is 00, the second station type is 01 and so on.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} In TTDPatch each game can only have 255 station IDs for all active grf files.&lt;br /&gt;
&lt;br /&gt;
The only property you &#039;&#039;&#039;must&#039;&#039;&#039; set for each station ID is 08 (in addition to defining an [[Action3|action 3]] for it), anything else can be left at the default. It must be the first property you set for each station ID, because the station ID is actually undefined until it has been assigned a class through property 08. Also, all station IDs must get their classes in the right order, starting from ID 00 onwards.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|08||D||{{ottdp|0.6|2.5|ttdprev=alpha 19}}||Class ID, see below&lt;br /&gt;
|-&lt;br /&gt;
|09||V||{{ottdp|0.6|2.5|ttdprev=alpha 20}}||Sprite layout, see below&lt;br /&gt;
|-&lt;br /&gt;
|0A||B/B*||{{ottdp|0.6|2.5|ttdprev=alpha 20}}/{{ottdp|14.0}}||Copy sprite layout&lt;br /&gt;
|-&lt;br /&gt;
|0B||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Callback flags&lt;br /&gt;
|-&lt;br /&gt;
|0C||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Bit mask of disabled numbers of platforms&lt;br /&gt;
|-&lt;br /&gt;
|0D||B||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Bit mask of disabled platform lengths&lt;br /&gt;
|-&lt;br /&gt;
|0E||V||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||Define custom layout, see below&lt;br /&gt;
|-&lt;br /&gt;
|0F||B/B*||{{ottdp|0.6|2.5|ttdprev=alpha 22}}/{{ottdp|14.0}}||Copy custom layout from stationid given by argument&lt;br /&gt;
|-&lt;br /&gt;
|10||W||{{ottdp|0.6|2.5|ttdprev=alpha 25}}||Little/lots threshold&lt;br /&gt;
|-&lt;br /&gt;
|11||B||{{ottdp|0.6|2.5|ttdprev=alpha 27}}||Pylon placement&lt;br /&gt;
|-&lt;br /&gt;
|12||D||{{ottdp|0.6|2.5|ttdprev=alpha 30}}||Bit mask of cargo type triggers for random sprites&lt;br /&gt;
|-&lt;br /&gt;
|13||B||{{ottdp|0.6|2.5|ttdprev=alpha 30}}||General flags&lt;br /&gt;
|-&lt;br /&gt;
|14||B||{{ottdp|0.6|2.5|ttdprev=alpha 47}}||Overhead wire placement&lt;br /&gt;
|-&lt;br /&gt;
|15||B||{{ottdp|0.6|2.5|ttdprev=alpha 51}}||Can train enter tile&lt;br /&gt;
|-&lt;br /&gt;
|16||W||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation information&lt;br /&gt;
|-&lt;br /&gt;
|17||B||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation speed&lt;br /&gt;
|-&lt;br /&gt;
|18||W||{{ottdp|0.7|2.5|ttdprev=beta 9}}||Animation triggers&lt;br /&gt;
|-&lt;br /&gt;
|1A||V||{{ottdp|1.2|no|ottdrev=r22518}}||Advanced sprite layout with register modifiers&lt;br /&gt;
|-&lt;br /&gt;
|1B|| || ||Reserved&lt;br /&gt;
|-&lt;br /&gt;
|1C||W||{{ottdp|14}}||Station name&lt;br /&gt;
|-&lt;br /&gt;
|1D||W||{{ottdp|14}}||Station class name&lt;br /&gt;
|-&lt;br /&gt;
|1E||V||{{ottdp|15}}||Station sprite layout flags&lt;br /&gt;
|-&lt;br /&gt;
|1F||W n*W||{{ottdp|15}}||List of badges&lt;br /&gt;
|-&lt;br /&gt;
|20||B* n*B||{{ottdp|15}}||Minimum height list.&lt;br /&gt;
|-&lt;br /&gt;
|21||B* n*B||{{ottdp|15}}||Blocked bridge pillars list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unofficial additions and changes. Don&#039;t rely on them to ever work this way in OpenTTD or TTDPatch:&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|1B||8*B||whatever-PP||Minimum bridge height for bridges over stations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Station class (08) ===&lt;br /&gt;
TTDPatch groups sets of new station graphics into various classes. &amp;amp;nbsp;The classes can be selected by the top dropdown list in the construction window, and the individual stations within the class from the bottom dropdown list. &amp;amp;nbsp;In addition, each station can alter its appearance using [[VariationalAction2|variational]] and/or [[RandomAction2|random]] action 2 entries.&lt;br /&gt;
&lt;br /&gt;
Only two classes are pre-defined:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Name!!Class ID!!Intended use for station&lt;br /&gt;
|-&lt;br /&gt;
|DFLT||44 46 4C 54||Default, no special station type&lt;br /&gt;
|-&lt;br /&gt;
|WAYP||57 41 59 50||Non-cargo stations, waypoints, signal boxes etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You may simply use other classes than the above, as long as no more than (at the moment) 16 classes are used among all active .grf files at any time.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Station classes which start with the byte FF are considered waypoint classes, and will appear in the waypoint construction window instead of the station construction window.&lt;br /&gt;
&lt;br /&gt;
When a waypoint station is built, it will not accept cargo nor will any cargo appear from nearby industries or towns. &amp;amp;nbsp;Trains will not stop at waypoint stations, regardless of the non-stop order and/or the nonstop switch.&lt;br /&gt;
&lt;br /&gt;
=== Sprite layout (09) ===&lt;br /&gt;
This controls what sprites are displayed, where they are displayed, and in what order. &amp;amp;nbsp;The property is variable sized, and contains the data for all 8 possible station tile types. &amp;amp;nbsp;If this property is set, the num-ent in the corresponding [[Action1|action 1]] need not be equal to 12 (hex), it can in fact be any number, and any number of sprites can be displayed in any order.&lt;br /&gt;
&lt;br /&gt;
The data is specified as data for all eight tiles in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;data1&amp;amp;gt; &amp;amp;lt;data2&amp;amp;gt; ... &amp;amp;lt;datan&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|V||data1...||The variable size data for each of the &amp;amp;lt;num&amp;amp;gt; tiles, as specified below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Number of tiles supported =====&lt;br /&gt;
* Normally this is 8, but you can specify fewer as well&lt;br /&gt;
* Using callback flags bit 1, specifying more makes sense too&lt;br /&gt;
* This value must be the same for all stations set by this action 0, even though it must be repeated for the prop. 09 definition of each station ID as well&lt;br /&gt;
&lt;br /&gt;
(Note that num is an extended byte, see [[GRFActionsDetailed]].)&lt;br /&gt;
&lt;br /&gt;
The content of each of the (usually eight) data sets is either a new sprite layout:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|D||groundsprite||the sprite to draw for the rails; this is by default a TTD sprite, but with bit 31 set an [[Action1|action 1]] sprite (42D+X) may be specified&lt;br /&gt;
|-&lt;br /&gt;
|V||spritedata||the data for station sprites, see below; each has a size of 10 bytes, and there may be several&lt;br /&gt;
|-&lt;br /&gt;
|B||80||a literal 80 ends the list of sprites for this tile&lt;br /&gt;
|}&lt;br /&gt;
or, alternatively, the instruction to use TTD&#039;s layout by using four zero bytes 00 00 00 00 instead of the groundsprite bytes. You can use [http://www.bytetransfer.de/projects/ttdpatch/docs/spriteidmapping.php the online sprite ID converter] to look up the sprite IDs you can use for all the climates.&lt;br /&gt;
&lt;br /&gt;
One can draw two types of sprites. &amp;amp;nbsp;One type is one that establishes a new 3D bounding box for use by the sprite sorter. &amp;amp;nbsp;The other type shares the 3D bounding box of the previous sprite(s). &amp;amp;nbsp;It must not be larger than the sprite which established the bounding box, nor must any part of it be outside this box. &amp;amp;nbsp;For simplicity, it should have the exact same dimensions as the sprite it shares the bounding box with. &amp;amp;nbsp;The latter type is supported in the station construction window display only since TTDPatch 2.6 r1684.&lt;br /&gt;
&lt;br /&gt;
The spritedata of sprites with their own bounding box has this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||xofs||x-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||yofs||y-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||zofs||z-offset from northern tile corner&lt;br /&gt;
|-&lt;br /&gt;
|B||xextent||size of sprite in x direction&lt;br /&gt;
|-&lt;br /&gt;
|B||yextent||size of sprite in y direction&lt;br /&gt;
|-&lt;br /&gt;
|B||zextent||size of sprite in z direction&lt;br /&gt;
|-&lt;br /&gt;
|D||sprite||sprite number to draw&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The spritedata of sprites sharing the bounding box has this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||xofs||x-offset relative to previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|B||yofs||y-offset relative to previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|B||80||a literal 80&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|B||00||(ignored)&lt;br /&gt;
|-&lt;br /&gt;
|D||sprite||sprite number to draw&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since OpenTTD r18959 you can draw multiple ground sprites for a tile, which is useful if you want to use the usual rail/grass/concrete groundtile, but still need to add features to it without using a new bounding box. To do so use the syntax of sprites sharing the previous bounding box, but use it before the first bounding box definition. xpixeloffset and ypixeloffset refer to the usual spot of groundtiles. The same feature is also partially supported in TTDPatch since TTDPatch 2.6 r2312: TTDPatch ignores the xofs and yofs fields and always uses (0,0) for the offset. If you are developing a GRF that needs to be compatible with both OpenTTD and TTDPatch, you should always keep xofs and yofs zero to get the same effect in both games.&lt;br /&gt;
Note however that both implementations do not consider the [[Action0/Stations#General_Flags_.2813.29|setting of prop13 bit 0]], hence these &amp;quot;multiple ground sprites&amp;quot; have to be always part of the building sprites set and cannot be part of the different sprite set for ground sprites.&lt;br /&gt;
&lt;br /&gt;
The sprite number can have the following values (remember to use little endian, i.e. reversed byte order):&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!!Sprite&lt;br /&gt;
|-&lt;br /&gt;
|0000042D+X||use sprite X from the corresponding [[Action1|action 1]] block (i.e. 0000042D for the first, 0000042E for the second, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|0000842D+X||same, but draw it using company colour translation&lt;br /&gt;
|-&lt;br /&gt;
|0322442D+X||same, but draw in transparent mode (actual colours of the sprite are disregarded entirely); supported in station construction window display since TTDPatch 2.6 r1683&lt;br /&gt;
|-&lt;br /&gt;
|RRRR842D+X||draw sprite with colour translation defined in sprite RRRR; available since TTDPatch 2.6 r1683&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With bit 31 set, this sprite will refer to a TTD sprite, not the action 1 sprite. For the first ground sprite the reverse meaning applies.&lt;br /&gt;
&lt;br /&gt;
Depending on the railtype the sprites may get additional offsets:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
! !! Normal/electrified rail !! Monorail !! Maglev&lt;br /&gt;
|-&lt;br /&gt;
|TTD sprites || 0 || 82 || 164&lt;br /&gt;
|-&lt;br /&gt;
|Action 1 sprite (first ground sprite) || 0 || 1 || 2&lt;br /&gt;
|-&lt;br /&gt;
|Action 1 sprite (other sprites in the layout) || 0 || 0 || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, TTD sprites and the first ground sprite are affected by the railtype, while other action 1 sprites in the layout are not. The offset &amp;quot;82&amp;quot; refers to the offset between the default TTD track sprites; if you are using non-track ground sprites which are not from an action 1, you need to supply fake spritenumbers which preemptively reverse the offsets (that is, you need different sprite layouts for every railtype your station is available for).&lt;br /&gt;
&lt;br /&gt;
Setting bit 30 forces this sprite to be displayed normally even in &amp;quot;transparent buildings&amp;quot; mode (supported only in TTDPatch 2.6 r1695 and later).&lt;br /&gt;
&lt;br /&gt;
See below for an example of linked sprites as well as transparent sprites (e.g. for a station roof).&lt;br /&gt;
&lt;br /&gt;
Note that the coordinates here are 3D coordinates with x running from top-right to bottom-left and y running from top-left to bottom-right, with the tile dimensions being 16x16 (and 8 for one height level). This means the x and y values should always be within 0-15 (decimal).&lt;br /&gt;
&lt;br /&gt;
This is different to and independent from the x/y offsets used in the actual .NFO file. &amp;amp;nbsp;The 3D bounding box is used by TTD&#039;s sprite sorter to figure out the order in which to draw the sprites, as well as telling it which sprites to draw, because those whose bounding box falls outside the currently updated screen rectangle will not be drawn. &amp;amp;nbsp;Make sure the 3D bounding box is large enough to contain the entire sprite, but not so large that the sprite sorter can&#039;t determine which sprites should be in front.&lt;br /&gt;
&lt;br /&gt;
This means that the order in which you specify sprites is irrelevant. &amp;amp;nbsp;Sprites will get drawn from back to front, in the order which the sprite sorter determines as correct, from their bounding boxes. &amp;amp;nbsp;There are two exceptions, however:&lt;br /&gt;
* Sprites sharing the same bounding box will always be drawn in the given order.&lt;br /&gt;
* The station construction window display doesn&#039;t use the sprite sorter. Tiles that may be displayed in that window need to be specified in the correct drawing order, back to front.&lt;br /&gt;
&lt;br /&gt;
=== Copy sprite layout (0A) ===&lt;br /&gt;
&lt;br /&gt;
This is not a property as such, but an action. &amp;amp;nbsp;It takes as argument a byte which is interpreted as station-ID to copy the custom sprite layout from.&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|14.0}} this property is now an extended byte.&lt;br /&gt;
&lt;br /&gt;
=== Callback flags (0B) ===&lt;br /&gt;
For stations, the following [[callbacks]] can be defined by setting the corresponding bit in property 0B:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Variable 0C value!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||13||Whether to make station available in construction window (non-zero callback return) or not (callback returns zero)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||14||Use callback to select sprite layout&lt;br /&gt;
|-&lt;br /&gt;
|2||4||141||Decide next animation frame&lt;br /&gt;
|-&lt;br /&gt;
|3||8||142||Decide animation speed&lt;br /&gt;
|-&lt;br /&gt;
|4||10||149||Custom slope check&lt;br /&gt;
|}&lt;br /&gt;
Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the [[VariationalAction2|VarAction2]] for callbacks.&lt;br /&gt;
&lt;br /&gt;
=== Selection of numbers of platforms and length (0C, 0D) ===&lt;br /&gt;
&lt;br /&gt;
By default all platform lengths and any number of platforms is available for the new stations. &amp;amp;nbsp;Using these properties, you can choose which ones should be unavailable by setting the corresponding bit in the property.&lt;br /&gt;
&lt;br /&gt;
The values are a byte, used as a bit mask. &amp;amp;nbsp;Bits 0 to 6 control the availability of number or length 1 to 7, and bit 7 controls the availability of the &amp;quot;+7&amp;quot; button. &amp;amp;nbsp;Each bit that is set disables the corresponding length or number of platforms.&lt;br /&gt;
&lt;br /&gt;
For compatibility with &amp;quot;largestations off&amp;quot;, at least one length between 1 and 5 (bits 0 to 4) and one number of platforms between 1 and 4 (bits 0 to 3) must be available, i.e. at least one of these bits must be unset.&lt;br /&gt;
&lt;br /&gt;
=== Define custom layout (0E) ===&lt;br /&gt;
&lt;br /&gt;
This allows choosing which tile type is built at which tile of a newly built station. &amp;amp;nbsp;There are four different types, which TTD normally defines as&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Tile type!!Appearance&lt;br /&gt;
|-&lt;br /&gt;
|00||plain platform&lt;br /&gt;
|-&lt;br /&gt;
|02||platform with building&lt;br /&gt;
|-&lt;br /&gt;
|04||platform with roof, left side&lt;br /&gt;
|-&lt;br /&gt;
|06||platform with roof, right side&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15}}, all even values up to FE are supported if the sprite layout is defined via property 09/0A.&lt;br /&gt;
&lt;br /&gt;
These numbers are used for stations in NE-SW direction, or these numbers plus one for stations in the NW-SE direction. &amp;amp;nbsp;To define a custom layout, use this format:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||length||length of platforms for this layout&lt;br /&gt;
|-&lt;br /&gt;
|B||number||number of platforms for this layout&lt;br /&gt;
|-&lt;br /&gt;
|V||tiles||length*number bytes of tile types, one platform after another, only 00, 02, 04 or 06 are allowed as values&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Repeat this as often as necessary to define the layouts for all supported combinations of length and number. &amp;amp;nbsp;End the definitions with a 00 00 (zero length and zero number). &amp;amp;nbsp;Any combinations that are not defined will be built using TTD&#039;s default layout.&lt;br /&gt;
Note that it may be easier to draw different sprite sets using a [[VariationalAction2|VarAction2]] based on [[VarAction2Stations#Platform info 40 41 46 47 49|station variable 40]], rather than redefining the layout. &amp;amp;nbsp;In addition, [[Callbacks#Custom station layout 24|callback 24]] will be used to further customize the layout as defined by this property (or by TTD if no prop 0E layout is available). This may also be easier than defining a prop 0E layout for every combination of length and number of platforms.&lt;br /&gt;
&lt;br /&gt;
=== Copy custom layout (0F) ===&lt;br /&gt;
&lt;br /&gt;
Similar to property 0A, this copies the custom layout from the station-ID given by the argument.&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|14.0}} this property is now an extended byte.&lt;br /&gt;
&lt;br /&gt;
=== Little/lots threshold (10) ===&lt;br /&gt;
Amount of cargo for switching from &amp;quot;little&amp;quot; to &amp;quot;lots&amp;quot; of cargo. &amp;amp;nbsp;TTDPatch separates the full range of cargo amounts (0 to 4095) into two separate subranges, &amp;quot;little&amp;quot; and &amp;quot;lots&amp;quot; of cargo. &amp;amp;nbsp;This allows better control of cargo amount based graphics (if needed). &amp;amp;nbsp;Property 10 specifies at what amount of cargo the patch is to switch from one to the other subrange. &amp;amp;nbsp;See [[Action2Stations|Action 2 for stations]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Pylon placement (11) and wire placement (14) ===&lt;br /&gt;
Prop. 11 sets which tile types should have pylons when used with electrified tracks. By default, tiles 0-3 (default stations without roof) have pylons, and tiles 4-7 (default stations with roof) don&#039;t. This is a bit mask of tile types, with a bit set meaning that a pylon should be drawn. The tile types here do not consider [[Callbacks#Station sprite layout 14|callback 14]], but rather the type as it was built, i.e. from prop. 0E.&lt;br /&gt;
&lt;br /&gt;
Prop. 14 works in a similar way, except that it sets the tile types on which there should be &#039;&#039;no&#039;&#039; wires displayed. With the default value of &amp;quot;00&amp;quot;, wires are displayed everywhere, and for each bit set, the wire is omitted on that tile type.&lt;br /&gt;
&lt;br /&gt;
This property should only be used when the wires cause problems with the sprite sorter, because even when the wire is obscured by a station hall or similar, it should still show up in transparent mode so that each tile can easily be verified as being electrified.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Note: This property only allows setting the flags of the first 8 sprite layouts. Use Property 1E instead to set flags when more sprite layouts are used via prop. 0E or [[Callbacks#Custom_station_layout_.2824.29|callback 24]].&lt;br /&gt;
&lt;br /&gt;
=== Cargo types for random triggers (12) ===&lt;br /&gt;
&lt;br /&gt;
This sets which cargo types should trigger re-randomizing. The cargo types are given as a bitmask of the bits from column 3 (type B) in CargoTypes. &amp;amp;nbsp;If nothing is set (the default), the no random triggers will happen, to conserve CPU time.&lt;br /&gt;
&lt;br /&gt;
With GRF version 7 and above, the interpretation of bits changes. Instead of climate-dependent cargo slot numbers (type B), you have to set the bits of climate-independent cargo ID (type A).&lt;br /&gt;
&lt;br /&gt;
{{ottd|15.0}} Since 15.0, a default cargo translation table corresponding to the climate is used if one is not provided.&lt;br /&gt;
&lt;br /&gt;
=== General Flags (13) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.7|2.5}}||use different sprite set for ground sprites ([[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|var. 10]] is 1 for ground sprites, 0 otherwise)&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.6|2.5}}||When calculating the cargo amount to display, divide the amount by half of the station perimeter (to simulate cargo distributed over the station)&lt;br /&gt;
&#039;&#039;&#039;Depricated&#039;&#039;&#039; since {{ottd|16.0}}, use bit 5 instead.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.7|2.5}}||[[Callbacks#Next animation frame (1A/26/141/153/158)|callback 141]] needs random bits in var. 10&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|1.0|2.6}}||Use custom foundations on sloped tiles (the lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|var. 10]] is 2 for foundation sprites)&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|1.0|2.6}}||When bit 3 is set, use extended foundation block instead of the simple one&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|16.0|-}}||When calculating the cargo amount to display, divide the amount by the station area (to simulate cargo distributed over the area of the station)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit 3 works somewhat similarly to bit 0: your sprite selection will be called again, with 2 in the lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]]. If the chain ends on a callback result, the program will assume the foundation selection has failed and will use the default foundaton sprites. The low word of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]] will contain the tile type of the current tile; if you have [[Callbacks#Station sprite layout (14)|callback 14]] enabled, this will be the its return value - otherwise, the default TTD types (platform with building, platform with left roof etc.) are used. In either case, one is added for the NW-SE orientation, in case your station needs different foundations depending on its orientation. Bits 16 and 17 are set if the NW and and NE foundations are to merged with the corresponding neighbour tile, so you shouldn&#039;t draw the corresponding edge in the foundation sprite. Other bits of variable 10 and variable 18 are reserved for future use.&lt;br /&gt;
&lt;br /&gt;
Your sprite selection code should select a foundation sprite block. The contents of this block depends on whether bit 4 is set or not.&lt;br /&gt;
* Bit 4 clear (simple foundations):&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The programme will combine the needed foundation from these 8 sprites depending on the current slope. You don&#039;t need to care about the merge data in bits 16..17 of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]]; it will be taken care of that automatically by adding the 7th and 8th sprite only when necessary.&lt;br /&gt;
* Bit 4 set (extended foundations):&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
You need to have one sprite for every slope that&#039;s possible below a rail station. The correct one will be automatically selected depending on the current slope. It can&#039;t handle the merging itself, however, so you need four foundation blocks: one with no edges removed, one with the NW edge removed, one with the NE edge removed and one with both north edges removed. Your sprite selection code is responsible for selecting the correct of those blocks according to the merge info in [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 18]].&lt;br /&gt;
&lt;br /&gt;
In both cases, you can put an additional value into register 100h, which will serve as an offset into the selected block. If you don&#039;t modify register 100h during the chain, it will default to 0. It is important that the dimensions of these sprites remain the same - thus bit 6 in the real sprites must be set to prevent GRFCodec from trimming the empty blue areas. The offset of these foundations must be -31 to the X direction and -9 to the Y direction.&lt;br /&gt;
&lt;br /&gt;
=== Can train enter tile (15) ===&lt;br /&gt;
&lt;br /&gt;
Like props. 11 and 14, this value contains eight bits relating to the eight possible tile types. If a bit is set, trains are prevented from routing through or entering any tile of this type.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Note: This property only allows setting the flags of the first 8 sprite layouts. Use Property 1E instead to set flags when more sprite layouts are used via prop. 0E or [[Callbacks#Custom_station_layout_.2824.29|callback 24]].&lt;br /&gt;
&lt;br /&gt;
=== Animation information (16) ===&lt;br /&gt;
&lt;br /&gt;
The low byte specifies the number of animation frames minus one, so 00 means 1 frame, 01 means 2 frames etc. The maximum number of frames is 256, although you can have some problems if your animation exceeds FD (253) frames. The high byte must be 0 for non-looping animations and 01 for looping animations. Every other value is reserved for future use. In addition, if the whole word contains FFFF, animation is turned off for this station (this is the default value).&lt;br /&gt;
Since you can&#039;t have properties for individual station tiles, this property applies for every tile of the station. If you don&#039;t want to animate some tiles, you should check the current position during [[Callbacks#Animation control (1B/25/140/152/159)|callback 140]] and return FD if the current tile doesn&#039;t need to be animated. If you also need animations of different length per tile, you&#039;ll have to use [[Callbacks#Next animation frame (1A/26/141/153/158)|callback 141]] for that.&lt;br /&gt;
&lt;br /&gt;
=== Animation speed (17) ===&lt;br /&gt;
The meaning is the same as for [[Action0Houses#Animation Speed 1B|house property 1B]], but the lower limit is 0 instead of 2, so the fastest possible animation changes frames every game tick (27ms). The default value is 2.&lt;br /&gt;
&lt;br /&gt;
=== Animation triggers (18) ===&lt;br /&gt;
This is a bit mask of events that should trigger [[Callbacks#Animation control (1B/25/140/152/159)|callback 140]], allowing to change the animation state&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Property bit, var18 byte 0!!Property value!!Version!!Meaning!!Happens on!!Var 18 byte 1&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.7|2.5}}||Station part is built||the newly built tiles||&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.7|2.5}}||New cargo arrives to station||whole station||Cargo type &amp;lt;ref name=&amp;quot;cargotype&amp;quot;&amp;gt;Bits 8..15 of var 18 contain the triggering cargo type. If your GRF has a cargo translation table, the cargo type will be an index in that table, or FFh if the cargo isn&#039;t in the table. If you don&#039;t have a cargo translation table, the cargo type will simply be the climate-dependent cargo type number.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.7|2.5}}||A cargo type gets removed from station||whole station||Cargo type &amp;lt;ref name=&amp;quot;cargotype&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|0.7|2.5}}||Train enters station (starts loading/unloading)||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|0.7|2.5}}||Train leaves station (done loading/unloading)||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|1.2|2.5|ottdrev=r22746}}||Train loads/unloads cargo||platform where the train is||&lt;br /&gt;
|-&lt;br /&gt;
|6||40||{{ottdp|0.7|2.5}}||Every 250 ticks||whole station||&lt;br /&gt;
|-&lt;br /&gt;
|7||80||{{ottdp|15|no}}||Tile is processed in the periodic processing loop||single tile||&lt;br /&gt;
|-&lt;br /&gt;
|8||100||{{ottdp|15|no}}||Train reserves platform (using PBS)||platform where the train reserved||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining bits are reserved for future triggers, they must be zero for now.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;happens on&amp;quot; column tells which tiles will [[Callbacks#Animation control (1B/25/140/152/159) |callback 140]] be called on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced sprite layout with register modifiers (1A) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.2|no|ottdrev=r22518}}&lt;br /&gt;
Format:&lt;br /&gt;
 1A &amp;lt;num-layouts&amp;gt; &amp;lt;0x40 + num-sprites&amp;gt;&lt;br /&gt;
                  &amp;lt;groundsprite&amp;gt; &amp;lt;flags&amp;gt; [&amp;lt;register/value&amp;gt;]...&lt;br /&gt;
                  [ &amp;lt;buildingsprite&amp;gt; &amp;lt;flags&amp;gt;&lt;br /&gt;
                      ( &amp;lt;xoffset&amp;gt; &amp;lt;yoffset&amp;gt; &amp;lt;zoffset&amp;gt; &amp;lt;xextent&amp;gt; &amp;lt;yextent&amp;gt; &amp;lt;zextent&amp;gt; &lt;br /&gt;
                      | &amp;lt;xpixeloffset&amp;gt; &amp;lt;ypixeloffset&amp;gt; 80)&lt;br /&gt;
                    [&amp;lt;register/value&amp;gt;]...&lt;br /&gt;
                  ]...&lt;br /&gt;
&lt;br /&gt;
For further details see [https://wiki.openttd.org/en/Archive/Development/Advanced%20Sprite%20Layout#stations here] for now.&lt;br /&gt;
&lt;br /&gt;
=== Minimum bridge height (1B) ===&lt;br /&gt;
&lt;br /&gt;
This property allows building bridges over stations.&lt;br /&gt;
&lt;br /&gt;
The bridge height property defines minimum clearances required for a bridge for each of the four [[Action0/Stations#Define_custom_layout_.280E.29|tile types]] of this station (or zero to not allow any bridge). Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; |-&lt;br /&gt;
!Height (1)!!Appearance&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x1 y1 ||plain platform&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x2 y2 ||platform with building&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x3 y3 ||platform with roof, left side&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |x4 y4 ||platform with roof, right side&lt;br /&gt;
|}&lt;br /&gt;
(1) where the values are one byte pairs (x-direction, y-direction) expressed in hexadecimal notation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
1B &amp;lt;1st pair&amp;gt; &amp;lt;2nd pair&amp;gt; &amp;lt;3rd pair&amp;gt; &amp;lt;4th pair&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
1B x1 y1 x2 y2 x3 y3 x4 y4&amp;lt;br /&amp;gt;&lt;br /&gt;
1B 01 01 02 02 03 03 03 03 // 8px 16px 24px 24px&lt;br /&gt;
&lt;br /&gt;
This property is currently only available for JGR&#039;s Patch Pack (v0.26.0 and later) and the developmental &amp;quot;New Map Features&amp;quot; (NMF) fork of OpenTTD.&lt;br /&gt;
&lt;br /&gt;
=== Station name (1C) ===&lt;br /&gt;
&lt;br /&gt;
=== Station class name (1D) ===&lt;br /&gt;
&lt;br /&gt;
=== Station sprite layout flags (1E) ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Since OpenTTD supports more than 8 sprite layouts to be used, props. 11, 14 and 15 are not sufficient to set the flags for all usable sprite layouts. This property is variable length and allows these flags to be set for each tile beyond the original limit of 8.&lt;br /&gt;
&lt;br /&gt;
The data is specified as flags for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;flags1&amp;amp;gt; &amp;amp;lt;flags2&amp;amp;gt; ... &amp;amp;lt;flagsn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||flags1...||The flags for each of the &amp;amp;lt;num&amp;amp;gt; tiles, as specified below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag values are as follows:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
|Bit||Value||Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||01||Tile should contain catenary pylons.&lt;br /&gt;
|-&lt;br /&gt;
|1||02||Tile should NOT contain catenary wires.&lt;br /&gt;
|-&lt;br /&gt;
|2||04||Tile is blocked to vehicles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These should be combined as needed.&lt;br /&gt;
&lt;br /&gt;
===Minimum Bridge Height (20)===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} This property allows building bridges over stations.&lt;br /&gt;
&lt;br /&gt;
The bridge height property defines minimum clearances required for a bridge for the sprite layouts of this station (or zero to not allow any bridge). Values are given in &amp;quot;height level&amp;quot; units (1 level == 8px). &lt;br /&gt;
&lt;br /&gt;
The data is specified as minimum height for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;height1&amp;amp;gt; &amp;amp;lt;height2&amp;amp;gt; ... &amp;amp;lt;heightn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||height...||The minimum heights for each of the &amp;amp;lt;num&amp;amp;gt; tiles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Blocked Pillar Information (21)===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|15}} Allows information to provided about blocked bridge pillars to assist the game in hiding pillars if necessary depending on what is above the station tile. Blocking a pillar prevents the pillar from being drawn. It does not prevent the station being bridgeable.&lt;br /&gt;
&lt;br /&gt;
The data is specified as blocked pillar flags for all sprite layouts in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;num&amp;amp;gt; &amp;amp;lt;flags1&amp;amp;gt; &amp;amp;lt;flags2&amp;amp;gt; ... &amp;amp;lt;flagsn&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Name!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B*||num||Number of different tiles supported (see below)&lt;br /&gt;
|-&lt;br /&gt;
|B||flags...||The blocked pillar flags for each of the &amp;amp;lt;num&amp;amp;gt; tiles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag bits are as follows:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
|Bit||Value||Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||01||Tile layout blocks a pillar on the west corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|1||02||Tile layout blocks a pillar on the south corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|2||04||Tile layout blocks a pillar on the east corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|3||08||Tile layout blocks a pillar on the north corner of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|4||10||Tile layout blocks a wall on the north east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|5||20||Tile layout blocks a wall on the south east side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|6||40||Tile layout blocks a wall on the south west side of the tile.&lt;br /&gt;
|-&lt;br /&gt;
|7||80||Tile layout blocks a wall on the north west side of the tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These should be combined as needed.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Using TTD&#039;s sprite layouts for certain tiles ===&lt;br /&gt;
&lt;br /&gt;
To use TTD&#039;s layout, you use &amp;lt;code&amp;gt;00 00 00 00&amp;lt;/code&amp;gt; for the ground sprite number and leave off everything else.&lt;br /&gt;
&lt;br /&gt;
So instead of for example&lt;br /&gt;
&lt;br /&gt;
 F4 03 00 00&lt;br /&gt;
    00 00 00    10 05 02    2E 84 00 00&lt;br /&gt;
    00 0B 00    10 05 02    30 84 00 00&lt;br /&gt;
    80&lt;br /&gt;
&lt;br /&gt;
you just put&lt;br /&gt;
&lt;br /&gt;
 00 00 00 00&lt;br /&gt;
&lt;br /&gt;
=== Using transparent sprites ===&lt;br /&gt;
&lt;br /&gt;
You can use transparent sprites to make for example the roof translucent like in TTD&#039;s stations. The roof of TTD&#039;s stations is made like this:&lt;br /&gt;
&lt;br /&gt;
 00 00 10    10 10 0A    37 84 00 00&lt;br /&gt;
 00 00 80    00 00 00    3B 44 22 03&lt;br /&gt;
&lt;br /&gt;
The first sprite here is the non-transparent frame of the roof, drawn in company colours (it has bit 15 set). The second part is a special &amp;quot;linked&amp;quot; sprite without its own bounding box, it shares that of the previous sprite. That&#039;s done by setting the z offset to 80.&lt;br /&gt;
&lt;br /&gt;
To make that second sprite transparent, bit 14 is set in the sprite number, and the upper word is set to 322 (*), so 0322443B means to take sprite 43B and draw it in transparent mode. The colours of that sprite are ignored entirely, every pixel in colour 0 is fully transparent, and all other pixels are semi-transparent (essentially just causing what they are drawn over to become darker).&lt;br /&gt;
&lt;br /&gt;
(*) This is the [[RecolorSprites#Default_recolour_sprites | recolour sprite]] for the glass effect.&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5226</id>
		<title>NML:Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5226"/>
		<updated>2026-02-12T13:58:59Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Badge callbacks */ By the way, by design badges are meant to only be up to 12 pixels tall. That&amp;#039;s why these look bad in lists. (Probably didn&amp;#039;t mention it in the specs.)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since&#039;&#039;&#039; {{ottd|15.0}}&lt;br /&gt;
&lt;br /&gt;
  item (FEAT_BADGES, item_name) { ... }&lt;br /&gt;
&lt;br /&gt;
==Badge properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| string with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; as delimiter&lt;br /&gt;
| &#039;&#039;&#039; For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.&#039;&#039;&#039;&lt;br /&gt;
Badges with label without &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; are considered to be classes.&lt;br /&gt;
Labels for other badges should match following syntax:&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;&amp;quot;label_of_class_they_belong_to/label_for_the_badge&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| bitmask(BADGE_FLAG_XXX, ...);&lt;br /&gt;
|&lt;br /&gt;
; COPY_TO_RELATED_ENTITY&lt;br /&gt;
: Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
; NAME_LIST_STOP&lt;br /&gt;
: Stops adding more names to the visible name list.&lt;br /&gt;
; NAME_LIST_FIRST_ONLY&lt;br /&gt;
: Add this name to the visible name list only if this is the first name.&lt;br /&gt;
; USE_COMPANY_COLOUR&lt;br /&gt;
: Recolour badge depending on company that player currently controls.&lt;br /&gt;
; NAME_SKIP&lt;br /&gt;
: Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| intro_date&lt;br /&gt;
| date(yyyy, mm, dd)&lt;br /&gt;
| Introduction date of entity (or current date if entity type does not have an introduction date). See &amp;lt;code style=&amp;quot;color: green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt; in [[NML:Vehicles#Properties common to all vehicle types|vehicle properties]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge callbacks ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: By design badges are meant to only be up to 12 pixels tall.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
aircraft&amp;lt;br&amp;gt;&lt;br /&gt;
airports&amp;lt;br&amp;gt;&lt;br /&gt;
airporttiles&amp;lt;br&amp;gt;&lt;br /&gt;
houses&amp;lt;br&amp;gt;&lt;br /&gt;
industries&amp;lt;br&amp;gt;&lt;br /&gt;
industrytiles&amp;lt;br&amp;gt;&lt;br /&gt;
objects&amp;lt;br&amp;gt;&lt;br /&gt;
railtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadstops&amp;lt;br&amp;gt;&lt;br /&gt;
roadtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadvehs&amp;lt;br&amp;gt;&lt;br /&gt;
ships&amp;lt;br&amp;gt;&lt;br /&gt;
stations&amp;lt;br&amp;gt;&lt;br /&gt;
trains&amp;lt;br&amp;gt;&lt;br /&gt;
tramtypes&amp;lt;br&amp;gt;&lt;br /&gt;
| spriteset&lt;br /&gt;
| Override default graphics when used by other specific feature.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Badges require a [[NML:Badgetable|badgetable]] to be defined for most common usage scenarios (eg to refer to a badge from an item block). This is not a hard requirement and can be omitted if you are, for example, creating badges that other newGRFs can later refer to&lt;br /&gt;
&lt;br /&gt;
Eg for &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt; to be used in the badges property for a vehicle, the badge table must contain entries for both &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 badgetable {&lt;br /&gt;
     &amp;quot;power&amp;quot;,&lt;br /&gt;
     &amp;quot;power/diesel&amp;quot;,&lt;br /&gt;
     &amp;quot;power/steam&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
item (FEAT_BADGES, power) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will not show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, diesel) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/diesel&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_DIESEL);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, steam) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/steam&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_STEAM);&lt;br /&gt;
    }&lt;br /&gt;
    graphics {&lt;br /&gt;
        default: sprite_steam;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Badges&amp;diff=5225</id>
		<title>Action0/Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Badges&amp;diff=5225"/>
		<updated>2026-02-12T13:37:20Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Badge label (08) */ Use &amp;lt;code&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;&#039;Action 0 properties for badges&#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for badges =&lt;br /&gt;
&lt;br /&gt;
Defining properties of badges.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;[[GRFActionsDetailed|Size]]&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|S&lt;br /&gt;
|{{ottdp|15}}&lt;br /&gt;
|Badge label. A zero-terminated string.&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|D&lt;br /&gt;
|{{ottdp|15}}&lt;br /&gt;
|Flags.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Badge label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique strings.&lt;br /&gt;
&lt;br /&gt;
Badge labels comprise a badge class, for grouping similar badges, and badge name, separated by a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Classes and names are arbitrary, but to be useful must follow a standard scheme. For instance, the badge label power/steam will define a badge for steam powered vehicles within the power class.&lt;br /&gt;
&lt;br /&gt;
Proposed initial classes are:&lt;br /&gt;
&lt;br /&gt;
* flag&lt;br /&gt;
* role&lt;br /&gt;
* manufacturer&lt;br /&gt;
* operator&lt;br /&gt;
* power&lt;br /&gt;
* livery&lt;br /&gt;
&lt;br /&gt;
It is also possible to assign a badge to everything within a NewGRF by defining the badge label &amp;lt;code&amp;gt;newgrf/&amp;lt;GRFID&amp;gt;&amp;lt;/code&amp;gt;, with the GRFID in full hexadecimal form. This will work even if the badge is defined outside of the NewGRF it is for.&lt;br /&gt;
&lt;br /&gt;
=== Naming Proposal ===&lt;br /&gt;
&lt;br /&gt;
To work consistently, a naming standard needs to be agreed on, e.g.:&lt;br /&gt;
&lt;br /&gt;
 /role/passenger&lt;br /&gt;
 /role/freight&lt;br /&gt;
&lt;br /&gt;
 /livery/&amp;lt;country&amp;gt;/&amp;lt;operator&amp;gt;/&amp;lt;name&amp;gt;&lt;br /&gt;
 /livery/uk/british_rail/blue&lt;br /&gt;
 /livery/uk/british_rail/swallow&lt;br /&gt;
 /livery/fr/sncf/tgv&lt;br /&gt;
&lt;br /&gt;
The game could then present these as a filterable list, e.g.:&lt;br /&gt;
&lt;br /&gt;
 Role&lt;br /&gt;
   Passenger&lt;br /&gt;
   Freight&lt;br /&gt;
&lt;br /&gt;
 Livery&lt;br /&gt;
   UK&lt;br /&gt;
     British Rail - Blue&lt;br /&gt;
     British Rail - Swallow&lt;br /&gt;
   France&lt;br /&gt;
     SNCF - TGV&lt;br /&gt;
&lt;br /&gt;
== Flags (09) ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Copy. Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|NameListStop. Stops adding more names to the visible name list.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|NameListFirstOnly. Add this name to the visible name list only if this is the first name.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|UseCompanyColour. Apply appropriate company colour palette to the icon. If the icon is applied to a vehicle with 2CC support, then the 2CC palette will be used.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|NameListSkip. Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Badges&amp;diff=5224</id>
		<title>Action0/Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Badges&amp;diff=5224"/>
		<updated>2026-02-12T13:36:10Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Badge label (08) */  Use &amp;lt;code&amp;gt; instead of &amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;&#039;Action 0 properties for badges&#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Action 0 - Properties for badges =&lt;br /&gt;
&lt;br /&gt;
Defining properties of badges.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Number&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;[[GRFActionsDetailed|Size]]&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|S&lt;br /&gt;
|{{ottdp|15}}&lt;br /&gt;
|Badge label. A zero-terminated string.&lt;br /&gt;
|-&lt;br /&gt;
|09&lt;br /&gt;
|D&lt;br /&gt;
|{{ottdp|15}}&lt;br /&gt;
|Flags.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Badge label (08) ==&lt;br /&gt;
&lt;br /&gt;
These are globally unique strings.&lt;br /&gt;
&lt;br /&gt;
Badge labels comprise a badge class, for grouping similar badges, and badge name, separated by a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Classes and names are arbitrary, but to be useful must follow a standard scheme. For instance, the badge label power/steam will define a badge for steam powered vehicles within the power class.&lt;br /&gt;
&lt;br /&gt;
Proposed initial classes are:&lt;br /&gt;
&lt;br /&gt;
* flag&lt;br /&gt;
* role&lt;br /&gt;
* manufacturer&lt;br /&gt;
* operator&lt;br /&gt;
* power&lt;br /&gt;
* livery&lt;br /&gt;
&lt;br /&gt;
It is also possible to assign a badge to everything within a NewGRF by defining the badge label `newgrf/&amp;lt;GRFID&amp;gt;`, with the GRFID in full hexadecimal form. This will work even if the badge is defined outside of the NewGRF it is for.&lt;br /&gt;
&lt;br /&gt;
=== Naming Proposal ===&lt;br /&gt;
&lt;br /&gt;
To work consistently, a naming standard needs to be agreed on, e.g.:&lt;br /&gt;
&lt;br /&gt;
 /role/passenger&lt;br /&gt;
 /role/freight&lt;br /&gt;
&lt;br /&gt;
 /livery/&amp;lt;country&amp;gt;/&amp;lt;operator&amp;gt;/&amp;lt;name&amp;gt;&lt;br /&gt;
 /livery/uk/british_rail/blue&lt;br /&gt;
 /livery/uk/british_rail/swallow&lt;br /&gt;
 /livery/fr/sncf/tgv&lt;br /&gt;
&lt;br /&gt;
The game could then present these as a filterable list, e.g.:&lt;br /&gt;
&lt;br /&gt;
 Role&lt;br /&gt;
   Passenger&lt;br /&gt;
   Freight&lt;br /&gt;
&lt;br /&gt;
 Livery&lt;br /&gt;
   UK&lt;br /&gt;
     British Rail - Blue&lt;br /&gt;
     British Rail - Swallow&lt;br /&gt;
   France&lt;br /&gt;
     SNCF - TGV&lt;br /&gt;
&lt;br /&gt;
== Flags (09) ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Value&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|Copy. Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|NameListStop. Stops adding more names to the visible name list.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|NameListFirstOnly. Add this name to the visible name list only if this is the first name.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|UseCompanyColour. Apply appropriate company colour palette to the icon. If the icon is applied to a vehicle with 2CC support, then the 2CC palette will be used.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|16&lt;br /&gt;
|NameListSkip. Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5221</id>
		<title>NML:Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5221"/>
		<updated>2026-01-14T15:26:32Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Prerequisites */ Use &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since&#039;&#039;&#039; {{ottd|15.0}}&lt;br /&gt;
&lt;br /&gt;
  item (FEAT_BADGES, item_name) { ... }&lt;br /&gt;
&lt;br /&gt;
==Badge properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| string with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; as delimiter&lt;br /&gt;
| &#039;&#039;&#039; For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.&#039;&#039;&#039;&lt;br /&gt;
Badges with label without &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; are considered to be classes.&lt;br /&gt;
Labels for other badges should match following syntax:&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;&amp;quot;label_of_class_they_belong_to/label_for_the_badge&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| bitmask(BADGE_FLAG_XXX, ...);&lt;br /&gt;
|&lt;br /&gt;
; COPY_TO_RELATED_ENTITY&lt;br /&gt;
: Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
; NAME_LIST_STOP&lt;br /&gt;
: Stops adding more names to the visible name list.&lt;br /&gt;
; NAME_LIST_FIRST_ONLY&lt;br /&gt;
: Add this name to the visible name list only if this is the first name.&lt;br /&gt;
; USE_COMPANY_COLOUR&lt;br /&gt;
: Recolour badge depending on company that player currently controls.&lt;br /&gt;
; NAME_SKIP&lt;br /&gt;
: Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| intro_date&lt;br /&gt;
| date(yyyy, mm, dd)&lt;br /&gt;
| Introduction date of entity (or current date if entity type does not have an introduction date). See &amp;lt;code style=&amp;quot;color: green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt; in [[NML:Vehicles#Properties common to all vehicle types|vehicle properties]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge callbacks ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
aircraft&amp;lt;br&amp;gt;&lt;br /&gt;
airports&amp;lt;br&amp;gt;&lt;br /&gt;
airporttiles&amp;lt;br&amp;gt;&lt;br /&gt;
houses&amp;lt;br&amp;gt;&lt;br /&gt;
industries&amp;lt;br&amp;gt;&lt;br /&gt;
industrytiles&amp;lt;br&amp;gt;&lt;br /&gt;
objects&amp;lt;br&amp;gt;&lt;br /&gt;
railtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadstops&amp;lt;br&amp;gt;&lt;br /&gt;
roadtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadvehs&amp;lt;br&amp;gt;&lt;br /&gt;
ships&amp;lt;br&amp;gt;&lt;br /&gt;
stations&amp;lt;br&amp;gt;&lt;br /&gt;
trains&amp;lt;br&amp;gt;&lt;br /&gt;
tramtypes&amp;lt;br&amp;gt;&lt;br /&gt;
| spriteset&lt;br /&gt;
| Override default graphics when used by other specific feature.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Badges require a [[NML:Badgetable|badgetable]] to be defined for most common usage scenarios (eg to refer to a badge from an item block). This is not a hard requirement and can be omitted if you are, for example, creating badges that other newGRFs can later refer to&lt;br /&gt;
&lt;br /&gt;
Eg for &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt; to be used in the badges property for a vehicle, the badge table must contain entries for both &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power/diesel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 badgetable {&lt;br /&gt;
     &amp;quot;power&amp;quot;,&lt;br /&gt;
     &amp;quot;power/diesel&amp;quot;,&lt;br /&gt;
     &amp;quot;power/steam&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
item (FEAT_BADGES, power) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will not show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, diesel) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/diesel&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_DIESEL);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This badge will show a sprite in the purchase menu&lt;br /&gt;
item (FEAT_BADGES, steam) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/steam&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_STEAM);&lt;br /&gt;
    }&lt;br /&gt;
    graphics {&lt;br /&gt;
        default: sprite_steam;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badge_labels&amp;diff=5213</id>
		<title>NML:Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badge_labels&amp;diff=5213"/>
		<updated>2026-01-05T22:03:40Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Rito12 moved page NML:Badge labels to Badge labels: &amp;quot;but page should be in general grf spec, not nml&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Badge labels]]&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5212</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5212"/>
		<updated>2026-01-05T22:03:40Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Rito12 moved page NML:Badge labels to Badge labels: &amp;quot;but page should be in general grf spec, not nml&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This page is dedicated for tracking registered badge labels.&lt;br /&gt;
If you write or publish a NewGRF which introduces a new badge label, please also add comment about it here.&lt;br /&gt;
However, before you introduces a new label reconsider if any of available labels fulfills the same purpose. Do not introduces two or more labels for same purpose.&lt;br /&gt;
If you introduce a new class, please also provide a table for badges that belong to it.&lt;br /&gt;
For ease of maintenance keep alphabetical order.&lt;br /&gt;
&lt;br /&gt;
== Classes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag || OpenTTD default badges || Country/Region&lt;br /&gt;
|-&lt;br /&gt;
| livery || OpenTTD default badges || Livery&lt;br /&gt;
|-&lt;br /&gt;
| power || OpenTTD default badges || Propulsion&lt;br /&gt;
|-&lt;br /&gt;
| region || OpenTTD default badges || Region&lt;br /&gt;
|-&lt;br /&gt;
| role || OpenTTD default badges || Role&lt;br /&gt;
|-&lt;br /&gt;
| zone || OpenTTD default badges || Zone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badges ==&lt;br /&gt;
&lt;br /&gt;
=== Flag ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag/AD || OpenTTD default badges || Andorra&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Livery ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| livery/2cc || OpenTTD default badges || Dual company colour (2CC)&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/1cc || OpenTTD default badges || Random based on first company colour&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/2cc || OpenTTD default badges || Random based on second company colour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| power/battery || OpenTTD default badges || Battery&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel || OpenTTD default badges || Diesel&lt;br /&gt;
|-&lt;br /&gt;
| power/electric || OpenTTD default badges || Electric&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac || OpenTTD default badges || Electric (AC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc || OpenTTD default badges || Electric (DC)&lt;br /&gt;
|-&lt;br /&gt;
| power/steam || OpenTTD default badges || Steam&lt;br /&gt;
|-&lt;br /&gt;
| power/turbine || OpenTTD default badges || Gas Turbine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| region/africa || OpenTTD default badges || Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/eastern || OpenTTD default badges || Eastern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/middle || OpenTTD default badges || Middle Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/northern || OpenTTD default badges || Northern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/southern || OpenTTD default badges || Southern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/western || OpenTTD default badges || Western Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/america || OpenTTD default badges || Americas&lt;br /&gt;
|-&lt;br /&gt;
| region/america/caribbean || OpenTTD default badges || Caribbean&lt;br /&gt;
|-&lt;br /&gt;
| region/america/central || OpenTTD default badges || Central America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/northern || OpenTTD default badges || Northern America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/south || OpenTTD default badges || South America&lt;br /&gt;
|-&lt;br /&gt;
| region/asia || OpenTTD default badges || Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/central || OpenTTD default badges || Central Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/eastern || OpenTTD default badges || Eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southeastern || OpenTTD default badges || South-eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southern || OpenTTD default badges || Southern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/western || OpenTTD default badges || Western Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/europe || OpenTTD default badges || Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/eastern || OpenTTD default badges || Eastern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/northern || OpenTTD default badges || Northern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/southern || OpenTTD default badges || Southern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/western || OpenTTD default badges || Western Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania || OpenTTD default badges || Oceania&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/australia_and_new_zealand || OpenTTD default badges || Australia and New Zealand&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/melanesia || OpenTTD default badges || Melanesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/micronesia || OpenTTD default badges || Micronesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/polynesia || OpenTTD default badges || Polynesia&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Role ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| role/banking || OpenTTD default badges || Banking&lt;br /&gt;
|-&lt;br /&gt;
| role/express_freight || OpenTTD default badges || Express freight&lt;br /&gt;
|-&lt;br /&gt;
| role/express_passenger || OpenTTD default badges || Express passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/freight || OpenTTD default badges || Freight&lt;br /&gt;
|-&lt;br /&gt;
| role/heavy_freight || OpenTTD default badges || Heavy freight&lt;br /&gt;
|-&lt;br /&gt;
| role/light_freight || OpenTTD default badges || Light freight&lt;br /&gt;
|-&lt;br /&gt;
| role/mail || OpenTTD default badges || Mail&lt;br /&gt;
|-&lt;br /&gt;
| role/mixed || OpenTTD default badges || Mixed&lt;br /&gt;
|-&lt;br /&gt;
| role/passenger || OpenTTD default badges || Passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/prototype || OpenTTD default badges || Prototype&lt;br /&gt;
|-&lt;br /&gt;
| role/restaurant_car || OpenTTD default badges || Restaurant car&lt;br /&gt;
|-&lt;br /&gt;
| role/shunting || OpenTTD default badges || Shunting&lt;br /&gt;
|-&lt;br /&gt;
| role/snowplough || OpenTTD default badges || Snowplough&lt;br /&gt;
|-&lt;br /&gt;
| role/utility || OpenTTD default badges || Utility&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Zone ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| zone/agricultural || OpenTTD default badges || Agricultural&lt;br /&gt;
|-&lt;br /&gt;
| zone/com || OpenTTD default badges || Commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/high || OpenTTD default badges || High density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/low || OpenTTD default badges || Low density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/medium || OpenTTD default badges || Medium density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/forestry || OpenTTD default badges || Forestry&lt;br /&gt;
|-&lt;br /&gt;
| zone/general || OpenTTD default badges || General&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind || OpenTTD default badges || Industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/high || OpenTTD default badges || High density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/low || OpenTTD default badges || Low density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/medium || OpenTTD default badges || Medium density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/leisure || OpenTTD default badges || Leisure&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed || OpenTTD default badges || Commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/high || OpenTTD default badges || High density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/low || OpenTTD default badges || Low density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/medium || OpenTTD default badges || Medium density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/other || OpenTTD default badges || Other&lt;br /&gt;
|-&lt;br /&gt;
| zone/public || OpenTTD default badges || Public&lt;br /&gt;
|-&lt;br /&gt;
| zone/res || OpenTTD default badges || Residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/high || OpenTTD default badges || High density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/low || OpenTTD default badges || Low density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/medium || OpenTTD default badges || Medium density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/transport || OpenTTD default badges || Transport&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=5211</id>
		<title>Template:NMLNavMain</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=5211"/>
		<updated>2026-01-04T19:43:48Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Undo revision 5208 by Rito12 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is the main NML navigation template, it is designed to be included in subnavigation templates. These subnavigation templates in turn are included on each documentation page.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px; border:1px solid #2f6fab; background:#b1cff8; padding:5px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; font-size: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;[[NML:Main|NewGRF Meta Language]]&amp;lt;/font&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[NML:Preface |Preface]]&lt;br /&gt;
;[[NML:Getting started|Getting started]]&lt;br /&gt;
;[[NML:Graphic files|Graphics files]]&lt;br /&gt;
&amp;lt;!--;[[NML:Language structure|Language structure]]--&amp;gt;&lt;br /&gt;
;[[NML:Block syntax|Blocks]]&lt;br /&gt;
;[[NML:Units|Units]]&lt;br /&gt;
;[[NML:Expressions|Expressions]]&lt;br /&gt;
:[[NML:Elementary values|Elementary values]]&lt;br /&gt;
:[[NML:Builtin functions|Builtin functions]]&lt;br /&gt;
;[[NML:Language files|Language files]]&lt;br /&gt;
;[[NML:Properties and variables and callbacks|Lists of props, vars and CBs]]&lt;br /&gt;
;[[NML:Warnings|Warnings]]&lt;br /&gt;
;[[NML:Additional references|Additional references]]&lt;br /&gt;
;[[NML:NewGRF compatibility|NewGRF compatibility]]&lt;br /&gt;
;[[NML:Deprecated syntax|Deprecated syntax]]&lt;br /&gt;
;[[NML:changes 0.3|Changes from NML 0.2 to 0.3]]&lt;br /&gt;
;[[NML:changes 0.4|Changes from NML 0.3 to 0.4]]&lt;br /&gt;
;[[NML:changes 0.5|Changes from NML 0.4 to 0.5]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
[[NML:Vehicles|Vehicles]],&lt;br /&gt;
[[NML:Stations|Stations]],&lt;br /&gt;
[[NML:Roadstops|Roadstops]],&lt;br /&gt;
[[NML:Canals|Canals]],&lt;br /&gt;
[[NML:Towns|Towns]],&lt;br /&gt;
[[NML:Houses|Houses]],&lt;br /&gt;
[[NML:Industries|Industries]] ([[NML:IndustryTiles|Tiles]]),&lt;br /&gt;
[[NML:Cargos|Cargos]],&lt;br /&gt;
[[NML:Airports|Airports+Tiles]],&lt;br /&gt;
[[NML:Objects|Objects]],&lt;br /&gt;
[[NML:Railtypes|Railtypes]],&lt;br /&gt;
[[NML:Roadtypes|Roadtypes]],&lt;br /&gt;
[[NML:Tramtypes|Tramtypes]],&lt;br /&gt;
[[NML:Bridges|Bridges]],&lt;br /&gt;
[[NML:Badges|Badges]],&lt;br /&gt;
[[NML:Base_Graphics|Terrain]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[ttwiki:NMLTutorial|NML Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5210</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5210"/>
		<updated>2026-01-04T18:28:48Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Power */  remove unwanted labels&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This page is dedicated for tracking registered badge labels.&lt;br /&gt;
If you write or publish a NewGRF which introduces a new badge label, please also add comment about it here.&lt;br /&gt;
However, before you introduces a new label reconsider if any of available labels fulfills the same purpose. Do not introduces two or more labels for same purpose.&lt;br /&gt;
If you introduce a new class, please also provide a table for badges that belong to it.&lt;br /&gt;
For ease of maintenance keep alphabetical order.&lt;br /&gt;
&lt;br /&gt;
== Classes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag || OpenTTD default badges || Country/Region&lt;br /&gt;
|-&lt;br /&gt;
| livery || OpenTTD default badges || Livery&lt;br /&gt;
|-&lt;br /&gt;
| power || OpenTTD default badges || Propulsion&lt;br /&gt;
|-&lt;br /&gt;
| region || OpenTTD default badges || Region&lt;br /&gt;
|-&lt;br /&gt;
| role || OpenTTD default badges || Role&lt;br /&gt;
|-&lt;br /&gt;
| zone || OpenTTD default badges || Zone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badges ==&lt;br /&gt;
&lt;br /&gt;
=== Flag ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag/AD || OpenTTD default badges || Andorra&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Livery ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| livery/2cc || OpenTTD default badges || Dual company colour (2CC)&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/1cc || OpenTTD default badges || Random based on first company colour&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/2cc || OpenTTD default badges || Random based on second company colour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| power/battery || OpenTTD default badges || Battery&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel || OpenTTD default badges || Diesel&lt;br /&gt;
|-&lt;br /&gt;
| power/electric || OpenTTD default badges || Electric&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac || OpenTTD default badges || Electric (AC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc || OpenTTD default badges || Electric (DC)&lt;br /&gt;
|-&lt;br /&gt;
| power/steam || OpenTTD default badges || Steam&lt;br /&gt;
|-&lt;br /&gt;
| power/turbine || OpenTTD default badges || Gas Turbine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| region/africa || OpenTTD default badges || Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/eastern || OpenTTD default badges || Eastern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/middle || OpenTTD default badges || Middle Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/northern || OpenTTD default badges || Northern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/southern || OpenTTD default badges || Southern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/western || OpenTTD default badges || Western Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/america || OpenTTD default badges || Americas&lt;br /&gt;
|-&lt;br /&gt;
| region/america/caribbean || OpenTTD default badges || Caribbean&lt;br /&gt;
|-&lt;br /&gt;
| region/america/central || OpenTTD default badges || Central America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/northern || OpenTTD default badges || Northern America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/south || OpenTTD default badges || South America&lt;br /&gt;
|-&lt;br /&gt;
| region/asia || OpenTTD default badges || Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/central || OpenTTD default badges || Central Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/eastern || OpenTTD default badges || Eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southeastern || OpenTTD default badges || South-eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southern || OpenTTD default badges || Southern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/western || OpenTTD default badges || Western Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/europe || OpenTTD default badges || Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/eastern || OpenTTD default badges || Eastern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/northern || OpenTTD default badges || Northern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/southern || OpenTTD default badges || Southern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/western || OpenTTD default badges || Western Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania || OpenTTD default badges || Oceania&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/australia_and_new_zealand || OpenTTD default badges || Australia and New Zealand&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/melanesia || OpenTTD default badges || Melanesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/micronesia || OpenTTD default badges || Micronesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/polynesia || OpenTTD default badges || Polynesia&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Role ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| role/banking || OpenTTD default badges || Banking&lt;br /&gt;
|-&lt;br /&gt;
| role/express_freight || OpenTTD default badges || Express freight&lt;br /&gt;
|-&lt;br /&gt;
| role/express_passenger || OpenTTD default badges || Express passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/freight || OpenTTD default badges || Freight&lt;br /&gt;
|-&lt;br /&gt;
| role/heavy_freight || OpenTTD default badges || Heavy freight&lt;br /&gt;
|-&lt;br /&gt;
| role/light_freight || OpenTTD default badges || Light freight&lt;br /&gt;
|-&lt;br /&gt;
| role/mail || OpenTTD default badges || Mail&lt;br /&gt;
|-&lt;br /&gt;
| role/mixed || OpenTTD default badges || Mixed&lt;br /&gt;
|-&lt;br /&gt;
| role/passenger || OpenTTD default badges || Passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/prototype || OpenTTD default badges || Prototype&lt;br /&gt;
|-&lt;br /&gt;
| role/restaurant_car || OpenTTD default badges || Restaurant car&lt;br /&gt;
|-&lt;br /&gt;
| role/shunting || OpenTTD default badges || Shunting&lt;br /&gt;
|-&lt;br /&gt;
| role/snowplough || OpenTTD default badges || Snowplough&lt;br /&gt;
|-&lt;br /&gt;
| role/utility || OpenTTD default badges || Utility&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Zone ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| zone/agricultural || OpenTTD default badges || Agricultural&lt;br /&gt;
|-&lt;br /&gt;
| zone/com || OpenTTD default badges || Commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/high || OpenTTD default badges || High density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/low || OpenTTD default badges || Low density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/medium || OpenTTD default badges || Medium density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/forestry || OpenTTD default badges || Forestry&lt;br /&gt;
|-&lt;br /&gt;
| zone/general || OpenTTD default badges || General&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind || OpenTTD default badges || Industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/high || OpenTTD default badges || High density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/low || OpenTTD default badges || Low density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/medium || OpenTTD default badges || Medium density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/leisure || OpenTTD default badges || Leisure&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed || OpenTTD default badges || Commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/high || OpenTTD default badges || High density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/low || OpenTTD default badges || Low density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/medium || OpenTTD default badges || Medium density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/other || OpenTTD default badges || Other&lt;br /&gt;
|-&lt;br /&gt;
| zone/public || OpenTTD default badges || Public&lt;br /&gt;
|-&lt;br /&gt;
| zone/res || OpenTTD default badges || Residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/high || OpenTTD default badges || High density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/low || OpenTTD default badges || Low density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/medium || OpenTTD default badges || Medium density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/transport || OpenTTD default badges || Transport&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5209</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5209"/>
		<updated>2026-01-04T16:50:24Z</updated>

		<summary type="html">&lt;p&gt;Rito12: Add OpenTTD default badges without flags (a lot of work and can be done later on).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This page is dedicated for tracking registered badge labels.&lt;br /&gt;
If you write or publish a NewGRF which introduces a new badge label, please also add comment about it here.&lt;br /&gt;
However, before you introduces a new label reconsider if any of available labels fulfills the same purpose. Do not introduces two or more labels for same purpose.&lt;br /&gt;
If you introduce a new class, please also provide a table for badges that belong to it.&lt;br /&gt;
For ease of maintenance keep alphabetical order.&lt;br /&gt;
&lt;br /&gt;
== Classes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag || OpenTTD default badges || Country/Region&lt;br /&gt;
|-&lt;br /&gt;
| livery || OpenTTD default badges || Livery&lt;br /&gt;
|-&lt;br /&gt;
| power || OpenTTD default badges || Propulsion&lt;br /&gt;
|-&lt;br /&gt;
| region || OpenTTD default badges || Region&lt;br /&gt;
|-&lt;br /&gt;
| role || OpenTTD default badges || Role&lt;br /&gt;
|-&lt;br /&gt;
| zone || OpenTTD default badges || Zone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badges ==&lt;br /&gt;
&lt;br /&gt;
=== Flag ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| flag/AD || OpenTTD default badges || Andorra&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Livery ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| livery/2cc || OpenTTD default badges || Dual company colour (2CC)&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/1cc || OpenTTD default badges || Random based on first company colour&lt;br /&gt;
|-&lt;br /&gt;
| livery/random/2cc || OpenTTD default badges || Random based on second company colour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| power/battery || OpenTTD default badges || Battery&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel || OpenTTD default badges || Diesel&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel/diesel-electric || OpenTTD default badges || Diesel (Diesel-electric)&lt;br /&gt;
|-&lt;br /&gt;
| power/diesel/diesel-hydraulic || OpenTTD default badges || Diesel (Diesel-hydraulic)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric || OpenTTD default badges || Electric&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac || OpenTTD default badges || Electric (AC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac/15kv || OpenTTD default badges || Electric (AC 15kV)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/ac/25kv || OpenTTD default badges || Electric (AC 25kV)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc || OpenTTD default badges || Electric (DC)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc/1200v || OpenTTD default badges || Electric (DC 1200V)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc/1500v || OpenTTD default badges || Electric (DC 1500V)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc/3kv || OpenTTD default badges || Electric (DC 3kV)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc/600v || OpenTTD default badges || Electric (DC 600V)&lt;br /&gt;
|-&lt;br /&gt;
| power/electric/dc/750v || OpenTTD default badges || Electric (DC 750V)&lt;br /&gt;
|-&lt;br /&gt;
| power/steam || OpenTTD default badges || Steam&lt;br /&gt;
|-&lt;br /&gt;
| power/turbine || OpenTTD default badges || Gas Turbine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| region/africa || OpenTTD default badges || Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/eastern || OpenTTD default badges || Eastern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/middle || OpenTTD default badges || Middle Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/northern || OpenTTD default badges || Northern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/southern || OpenTTD default badges || Southern Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/africa/western || OpenTTD default badges || Western Africa&lt;br /&gt;
|-&lt;br /&gt;
| region/america || OpenTTD default badges || Americas&lt;br /&gt;
|-&lt;br /&gt;
| region/america/caribbean || OpenTTD default badges || Caribbean&lt;br /&gt;
|-&lt;br /&gt;
| region/america/central || OpenTTD default badges || Central America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/northern || OpenTTD default badges || Northern America&lt;br /&gt;
|-&lt;br /&gt;
| region/america/south || OpenTTD default badges || South America&lt;br /&gt;
|-&lt;br /&gt;
| region/asia || OpenTTD default badges || Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/central || OpenTTD default badges || Central Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/eastern || OpenTTD default badges || Eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southeastern || OpenTTD default badges || South-eastern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/southern || OpenTTD default badges || Southern Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/asia/western || OpenTTD default badges || Western Asia&lt;br /&gt;
|-&lt;br /&gt;
| region/europe || OpenTTD default badges || Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/eastern || OpenTTD default badges || Eastern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/northern || OpenTTD default badges || Northern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/southern || OpenTTD default badges || Southern Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/europe/western || OpenTTD default badges || Western Europe&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania || OpenTTD default badges || Oceania&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/australia_and_new_zealand || OpenTTD default badges || Australia and New Zealand&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/melanesia || OpenTTD default badges || Melanesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/micronesia || OpenTTD default badges || Micronesia&lt;br /&gt;
|-&lt;br /&gt;
| region/oceania/polynesia || OpenTTD default badges || Polynesia&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Role ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| role/banking || OpenTTD default badges || Banking&lt;br /&gt;
|-&lt;br /&gt;
| role/express_freight || OpenTTD default badges || Express freight&lt;br /&gt;
|-&lt;br /&gt;
| role/express_passenger || OpenTTD default badges || Express passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/freight || OpenTTD default badges || Freight&lt;br /&gt;
|-&lt;br /&gt;
| role/heavy_freight || OpenTTD default badges || Heavy freight&lt;br /&gt;
|-&lt;br /&gt;
| role/light_freight || OpenTTD default badges || Light freight&lt;br /&gt;
|-&lt;br /&gt;
| role/mail || OpenTTD default badges || Mail&lt;br /&gt;
|-&lt;br /&gt;
| role/mixed || OpenTTD default badges || Mixed&lt;br /&gt;
|-&lt;br /&gt;
| role/passenger || OpenTTD default badges || Passenger&lt;br /&gt;
|-&lt;br /&gt;
| role/prototype || OpenTTD default badges || Prototype&lt;br /&gt;
|-&lt;br /&gt;
| role/restaurant_car || OpenTTD default badges || Restaurant car&lt;br /&gt;
|-&lt;br /&gt;
| role/shunting || OpenTTD default badges || Shunting&lt;br /&gt;
|-&lt;br /&gt;
| role/snowplough || OpenTTD default badges || Snowplough&lt;br /&gt;
|-&lt;br /&gt;
| role/utility || OpenTTD default badges || Utility&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Zone ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Label !! Introduced by !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| zone/agricultural || OpenTTD default badges || Agricultural&lt;br /&gt;
|-&lt;br /&gt;
| zone/com || OpenTTD default badges || Commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/high || OpenTTD default badges || High density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/low || OpenTTD default badges || Low density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/com/medium || OpenTTD default badges || Medium density commercial&lt;br /&gt;
|-&lt;br /&gt;
| zone/forestry || OpenTTD default badges || Forestry&lt;br /&gt;
|-&lt;br /&gt;
| zone/general || OpenTTD default badges || General&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind || OpenTTD default badges || Industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/high || OpenTTD default badges || High density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/low || OpenTTD default badges || Low density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/ind/medium || OpenTTD default badges || Medium density industrial&lt;br /&gt;
|-&lt;br /&gt;
| zone/leisure || OpenTTD default badges || Leisure&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed || OpenTTD default badges || Commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/high || OpenTTD default badges || High density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/low || OpenTTD default badges || Low density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/mixed/medium || OpenTTD default badges || Medium density commercial &amp;amp; residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/other || OpenTTD default badges || Other&lt;br /&gt;
|-&lt;br /&gt;
| zone/public || OpenTTD default badges || Public&lt;br /&gt;
|-&lt;br /&gt;
| zone/res || OpenTTD default badges || Residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/high || OpenTTD default badges || High density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/low || OpenTTD default badges || Low density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/res/medium || OpenTTD default badges || Medium density residential&lt;br /&gt;
|-&lt;br /&gt;
| zone/transport || OpenTTD default badges || Transport&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=5208</id>
		<title>Template:NMLNavMain</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Template:NMLNavMain&amp;diff=5208"/>
		<updated>2026-01-04T15:55:18Z</updated>

		<summary type="html">&lt;p&gt;Rito12: For sake of compatibility and user experience.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is the main NML navigation template, it is designed to be included in subnavigation templates. These subnavigation templates in turn are included on each documentation page.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px; border:1px solid #2f6fab; background:#b1cff8; padding:5px; -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; font-size: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;[[NML:Main|NewGRF Meta Language]]&amp;lt;/font&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[NML:Preface |Preface]]&lt;br /&gt;
;[[NML:Getting started|Getting started]]&lt;br /&gt;
;[[NML:Graphic files|Graphics files]]&lt;br /&gt;
&amp;lt;!--;[[NML:Language structure|Language structure]]--&amp;gt;&lt;br /&gt;
;[[NML:Block syntax|Blocks]]&lt;br /&gt;
;[[NML:Units|Units]]&lt;br /&gt;
;[[NML:Expressions|Expressions]]&lt;br /&gt;
:[[NML:Elementary values|Elementary values]]&lt;br /&gt;
:[[NML:Builtin functions|Builtin functions]]&lt;br /&gt;
;[[NML:Language files|Language files]]&lt;br /&gt;
;[[NML:Properties and variables and callbacks|Lists of props, vars and CBs]]&lt;br /&gt;
;[[NML:Warnings|Warnings]]&lt;br /&gt;
;[[NML:Additional references|Additional references]]&lt;br /&gt;
;[[NML:NewGRF compatibility|NewGRF compatibility]]&lt;br /&gt;
;[[NML:Deprecated syntax|Deprecated syntax]]&lt;br /&gt;
;[[NML:changes 0.3|Changes from NML 0.2 to 0.3]]&lt;br /&gt;
;[[NML:changes 0.4|Changes from NML 0.3 to 0.4]]&lt;br /&gt;
;[[NML:changes 0.5|Changes from NML 0.4 to 0.5]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
[[NML:Vehicles|Vehicles]],&lt;br /&gt;
[[NML:Stations|Stations]],&lt;br /&gt;
[[NML:Roadstops|Roadstops]],&lt;br /&gt;
[[NML:Canals|Canals]],&lt;br /&gt;
[[NML:Towns|Towns]],&lt;br /&gt;
[[NML:Houses|Houses]],&lt;br /&gt;
[[NML:Industries|Industries]] ([[NML:IndustryTiles|Tiles]]),&lt;br /&gt;
[[NML:Cargos|Cargos]],&lt;br /&gt;
[[NML:Airports|Airports+Tiles]],&lt;br /&gt;
[[NML:Objects|Objects]],&lt;br /&gt;
[[NML:Railtypes|Railtypes]],&lt;br /&gt;
[[NML:Roadtypes|Roadtypes]],&lt;br /&gt;
[[NML:Tramtypes|Tramtypes]],&lt;br /&gt;
[[NML:Bridges|Bridges]],&lt;br /&gt;
[[NML:Badges|Badges]],&lt;br /&gt;
[[NML:Base_Graphics|Terrain]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
[[CargoTypes#Cargo Labels|Cargo labels]],&lt;br /&gt;
[[NML:Badge labels|Badge labels]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:200px;  border:1px solid #2f6fab; border-top-width: 0px; background:#eaf6f8; padding:5px; font-size: 8pt; line-height: 12pt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[ttwiki:NMLTutorial|NML Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5207</id>
		<title>NML:Badges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badges&amp;diff=5207"/>
		<updated>2026-01-04T15:52:15Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Badge properties */ For sake of compatibility and user experience.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since&#039;&#039;&#039; {{ottd|15.0}}&lt;br /&gt;
&lt;br /&gt;
  item (FEAT_BADGES, item_name) { ... }&lt;br /&gt;
&lt;br /&gt;
==Badge properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| string with &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; as delimiter&lt;br /&gt;
| &#039;&#039;&#039; For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.&#039;&#039;&#039;&lt;br /&gt;
Badges with label without &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;/&amp;lt;/code&amp;gt; are considered to be classes.&lt;br /&gt;
Labels for other badges should match following syntax:&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;&amp;quot;label_of_class_they_belong_to/label_for_the_badge&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| Name of this badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| bitmask(BADGE_FLAG_XXX, ...);&lt;br /&gt;
|&lt;br /&gt;
; COPY_TO_RELATED_ENTITY&lt;br /&gt;
: Badge can be copied to related entity (e.g. badge on a railtype can be copied to rail vehicles of that railtype.)&lt;br /&gt;
; NAME_LIST_STOP&lt;br /&gt;
: Stops adding more names to the visible name list.&lt;br /&gt;
; NAME_LIST_FIRST_ONLY&lt;br /&gt;
: Add this name to the visible name list only if this is the first name.&lt;br /&gt;
; USE_COMPANY_COLOUR&lt;br /&gt;
: Recolour badge depending on company that player currently controls.&lt;br /&gt;
; NAME_SKIP&lt;br /&gt;
: Allow the badge to be excluded from the badge name list.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| intro_date&lt;br /&gt;
| date(yyyy, mm, dd)&lt;br /&gt;
| Introduction date of entity (or current date if entity type does not have an introduction date). See &amp;lt;code style=&amp;quot;color: green&amp;quot;&amp;gt;introduction_date&amp;lt;/code&amp;gt; in [[NML:Vehicles#Properties common to all vehicle types|vehicle properties]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Badge callbacks ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 badge or badge class.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
aircraft&amp;lt;br&amp;gt;&lt;br /&gt;
airports&amp;lt;br&amp;gt;&lt;br /&gt;
airporttiles&amp;lt;br&amp;gt;&lt;br /&gt;
houses&amp;lt;br&amp;gt;&lt;br /&gt;
industries&amp;lt;br&amp;gt;&lt;br /&gt;
industrytiles&amp;lt;br&amp;gt;&lt;br /&gt;
objects&amp;lt;br&amp;gt;&lt;br /&gt;
railtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadstops&amp;lt;br&amp;gt;&lt;br /&gt;
roadtypes&amp;lt;br&amp;gt;&lt;br /&gt;
roadvehs&amp;lt;br&amp;gt;&lt;br /&gt;
ships&amp;lt;br&amp;gt;&lt;br /&gt;
stations&amp;lt;br&amp;gt;&lt;br /&gt;
trains&amp;lt;br&amp;gt;&lt;br /&gt;
tramtypes&amp;lt;br&amp;gt;&lt;br /&gt;
| spriteset&lt;br /&gt;
| Override default graphics when used by other specific feature.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
item (FEAT_BADGES, power) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
item (FEAT_BADGES, diesel) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/diesel&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_DIESEL);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
item (FEAT_BADGES, steam) {&lt;br /&gt;
    property {&lt;br /&gt;
        label: &amp;quot;power/steam&amp;quot;;&lt;br /&gt;
        name: string(STR_POWER_STEAM);&lt;br /&gt;
    }&lt;br /&gt;
    graphics {&lt;br /&gt;
        default: sprite_steam;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badgetable&amp;diff=5206</id>
		<title>NML:Badgetable</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Badgetable&amp;diff=5206"/>
		<updated>2026-01-04T15:49:33Z</updated>

		<summary type="html">&lt;p&gt;Rito12: For sake of compatibility and user experience&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp|15|no|ottdrev=8f14894}}&lt;br /&gt;
&lt;br /&gt;
Badgetable is a set of string entries separated by comma. It allows to use &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt; property of common items.&lt;br /&gt;
&lt;br /&gt;
 badgetable {&lt;br /&gt;
    &amp;quot;ENTRY&amp;quot; [, &amp;quot;ENTRY&amp;quot;]*&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ENTRY&amp;lt;/code&amp;gt; consist of labels separated with slash. Last label is considered to identify the badge, others refer to classes that the badge belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; For sake of compatibility and user experience, consider using [[NML:Badge labels|labels already introduced]] by other NewGRFs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Currently badge hierarchy in OpenTTD allows only for one level of nesting. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colours/blue/skyblue&amp;lt;/code&amp;gt; will end up as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;blue/skyblue&amp;lt;/code&amp;gt; in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colours&amp;lt;/code&amp;gt; class instead of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;skyblue&amp;lt;/code&amp;gt; in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;blue&amp;lt;/code&amp;gt; class witch would be a subclass of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colours&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 badgetable {&lt;br /&gt;
     &amp;quot;flag&amp;quot;,&lt;br /&gt;
     &amp;quot;flag/GB&amp;quot;,&lt;br /&gt;
     &amp;quot;flag/US&amp;quot;,&lt;br /&gt;
     &amp;quot;power&amp;quot;,&lt;br /&gt;
     &amp;quot;power/steam&amp;quot;,&lt;br /&gt;
     &amp;quot;power/diesel&amp;quot;,&lt;br /&gt;
     &amp;quot;power/electric&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A badge listed in a badgetable will automatically be created if it is not otherwise provided. However, it will not appear in the UI then (It still can be viewed in the NewGRF debug window).&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5205</id>
		<title>Badge labels</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Badge_labels&amp;diff=5205"/>
		<updated>2026-01-04T15:33:54Z</updated>

		<summary type="html">&lt;p&gt;Rito12: NML:Badge labels&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
Nothing yet&lt;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=5204</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=5204"/>
		<updated>2026-01-04T15:28:48Z</updated>

		<summary type="html">&lt;p&gt;Rito12: /* Variables that require an argument */ No var 0x64 in purchase list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==Properties common to all vehicle types==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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. If set to 0, cargo does not age. Repeated tests have shown that the gameplay effects of this property often do not match the expectations of grf authors. Explaining why requires a detailed understanding of the OpenTTD cargo aging algorithm, and how that works with e.g. different map sizes, vehicle speeds, multi-leg feeder systems, etc. TL;DR avoid using this property unless you absolutely understand the effect it will have.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;variant_group&amp;lt;/code&amp;gt;&lt;br /&gt;
| Vehicle ID or alternatively the vehicle numeric ID (0 ... 65535)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
{{ottd|13}} This property supports grouping vehicles in the purchase menu (also the autoreplace menu). The property value is the ID of another vehicle in the same GRF which will act as the parent for vehicles in the group.&lt;br /&gt;
&lt;br /&gt;
Groups can also be nested (this is experimental as of December 2022 and may change with testing).&lt;br /&gt;
&lt;br /&gt;
See also vehicle extra_flags which can influence the behaviour of vehicles in variant groups.&lt;br /&gt;
&lt;br /&gt;
See also https://github.com/OpenTTD/OpenTTD/pull/10220&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
| bitmask(VEHICLE_FLAG_XXX, ...)&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|13}} &lt;br /&gt;
;VEHICLE_FLAG_DISABLE_NEW_VEHICLE_MESSAGE&lt;br /&gt;
: Disable &amp;quot;New Vehicle&amp;quot; news message for this engine&lt;br /&gt;
;VEHICLE_FLAG_DISABLE_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Disable &amp;quot;Exclusive Preview&amp;quot; for this engine&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_EXCLUSIVE_PREVIEW&lt;br /&gt;
: Variants - Include this variant when primary engine has &amp;quot;Exclusive Preview&amp;quot;&lt;br /&gt;
;VEHICLE_FLAG_SYNC_VARIANT_RELIABILITY&lt;br /&gt;
: Variants - (Attempt to) Synchronize reliability the primary engine.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;badges&amp;lt;/code&amp;gt;&lt;br /&gt;
| Array of badge labels from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| yes&lt;br /&gt;
| Since {{ottd|15.0}}&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. The length of each phase and the starting, peak, and final reliabilities are randomized for each engine when starting a new game. Also note that phase 2 (the vehicle&#039;s peak performance) is actually about 8 years shorter than the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; parameter.&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 + (0 to 15 months)&lt;br /&gt;
| stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 to 20.6 years&lt;br /&gt;
| decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;model_life&amp;lt;/code&amp;gt; is set to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;VEHICLE_NEVER_EXPIRES&amp;lt;/code&amp;gt;, the engine remains in phase 2 forever.&lt;br /&gt;
&lt;br /&gt;
Normally, the vehicle is removed from the purchase menu at the and of phase 3. However if you set the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;retire_early&amp;lt;/code&amp;gt; property, it will be retired this many years before (or after, if the value is negative) the end of phase 2.&lt;br /&gt;
&lt;br /&gt;
==Train properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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).  See also curve_speed_mod property.&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. {{ottdp|13|no|no}} this flag is no longer required, flip is always allowed, except for multi-header or articulated vehicles which cannot be flipped.  For vehicles shorter than 8/8, see [[Action0/Vehicles/Trains#cite_note-6|this note about sprite offsets]]&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;
;TRAIN_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
|{{ottd|15.0.0}} array of items from railtypetable &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;15.0.0}} item from railtypetable&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Default railtype table: RAIL, MONO, MGLV. If you install a railtypetable yourself you&#039;ll always get the railtype you specified. If you want a vehicle to run on electric rail and you don&#039;t have a railtypetable, set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;track_type&amp;lt;/code&amp;gt; to RAIL and make sure that you set &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt; to &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENGINE_CLASS_ELECTRIC&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_special_flag&amp;lt;/code&amp;gt;&lt;br /&gt;
| [&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt; &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_CARGO&amp;lt;/code&amp;gt;]&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;AI_FLAG_PASSENGER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Tell computer players that it&#039;s an engine that should only be used for passenger service.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;power&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;running_cost_base&amp;lt;/code&amp;gt;&lt;br /&gt;
| RUNNING_COST_XXX&lt;br /&gt;
| Set to RUNNING_COST_NONE&lt;br /&gt;
| &lt;br /&gt;
;RUNNING_COST_STEAM&lt;br /&gt;
;RUNNING_COST_DIESEL&lt;br /&gt;
;RUNNING_COST_ELECTRIC&lt;br /&gt;
;RUNNING_COST_ROADVEH&lt;br /&gt;
;RUNNING_COST_NONE&lt;br /&gt;
:no running costs&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;dual_headed&amp;lt;/code&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Set to 0 for all parts of an articulated vehicle&lt;br /&gt;
| 1 = dual_headed, otherwise normal engine&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;default_cargo_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| An identifier from the [[NML:Cargotable|cargo table]], or DEFAULT_CARGO_FIRST_REFITTABLE&lt;br /&gt;
| Yes&lt;br /&gt;
| If the vehicle is refittable to at least one cargo, but the chosen default cargo is not available or is set to DEFAULT_CARGO_FIRST_REFITTABLE, then the first refittable cargo is used. The first refittable is chosen according to the order in your [[NML:Cargotable|cargo table]]. If this property is set to a valid cargo but the vehicle cannot refit to any cargo type, then the vehicle will be able to carry only this cargo, but it cannot be refitted (like e.g. the default train wagons).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 255&lt;br /&gt;
| yes&lt;br /&gt;
| By default, passenger capacity is 4x, and mail/goods capacity 2x larger than capacity for other cargoes. The capacity set here is used for the default (i.e. first refittable) cargo. Use the &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;cargo_capacity&amp;lt;/code&amp;gt; callback to avoid this effect.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;weight&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 .. 1279 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ai_engine_rank&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| no&lt;br /&gt;
| TTDPatch only: Higher values make the engine for the TTDPatch AI more attractive&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;engine_class&amp;lt;/code&amp;gt;&lt;br /&gt;
| ENGINE_CLASS_XXX&lt;br /&gt;
| no&lt;br /&gt;
| &lt;br /&gt;
Defines which livery colour settings apply to the vehicle.  It also sets the corresponding sound effect of the engine, and if visual_effect_and_powered is not set, the visual effect as well.&lt;br /&gt;
;ENGINE_CLASS_STEAM&lt;br /&gt;
;ENGINE_CLASS_DIESEL&lt;br /&gt;
;ENGINE_CLASS_ELECTRIC&lt;br /&gt;
;ENGINE_CLASS_MONORAIL&lt;br /&gt;
;ENGINE_CLASS_MAGLEV&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 65000 hp (float, power units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Only wagons with a livery override for this engine will add power&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tractive_effort_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Fraction of the vehicle weight that is available as tractive effort. Tractive effort (in kN) is calculated as (TE coefficient) * 9.8 * weight (in tons), with 9.8 being an approximation of the acceleration of gravity (9.81 m/s).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;air_drag_coefficient&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Coefficient of the relative air drag, in arbitrary units. The default value is approximately (8 / max_speed), with max_speed in km/h, clamped to the range 0.004 .. 0.75.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt; (VISUAL_EFFECT_XXX, offset, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ENABLE_WAGON_POWER&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;DISABLE_WAGON_POWER&amp;lt;/code&amp;gt;)&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ENABLE_WAGON_POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect_and_powered&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_weight_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
| 0 ... 255 ton (float, mass units)&lt;br /&gt;
| Set to 0&lt;br /&gt;
| Adds extra weight for powered wagons, see &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;extra_power_per_wagon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;span #id=&amp;quot;bitmask_vehicle_info&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_vehicle_info&amp;lt;/code&amp;gt;&lt;br /&gt;
| 8-bit bitmask&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
Used for obtaining [[#bitmask consist info|&amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;bitmask_consist_info&amp;lt;/code&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;curve_speed_mod&amp;lt;/code&amp;gt;&lt;br /&gt;
| -128 ... 127.996 (float)&lt;br /&gt;
| yes&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Maximum curve speed modifier.&lt;br /&gt;
&lt;br /&gt;
The modifier is applied after the normal curve speed calculation is done using the formula max_curve_speed * (1 + curve_speed_mod). This means that the default property value of 0 is equivalent to no change. Negative values are supported, but the resulting vehicle curve speed is clamped at 2 mph-ish to make sure vehicles don&#039;t become permanently stuck.&lt;br /&gt;
&lt;br /&gt;
If different vehicles in a train have different curve speed modifiers, the lowest value wins.&lt;br /&gt;
&lt;br /&gt;
See also TRAIN_FLAG_TILT, which is an older and less flexible way of managing vehicle curve speed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Road vehicle properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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 ... 511km/h (float, speed units)&lt;br /&gt;
| no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| road_type &#039;&#039;or&#039;&#039; tram_type &lt;br /&gt;
| item from [[NML:Railtypetable-Roadtypetable-Tramtypetable|roadtypetable]] or [[NML:Railtypetable-Roadtypetable-Tramtypetable|tramtypetable]]&lt;br /&gt;
| must be the same as front&lt;br /&gt;
| Only &#039;&#039;one&#039;&#039; of these properties may be set.  &lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;tram_type&amp;lt;/code&amp;gt; is set, &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;ROADVEH_FLAG_TRAM&amp;lt;/code&amp;gt; must also be set for the vehicle in &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If not set, road vehicles will default to ROAD and tram vehicles will default to RAIL (this does not overlap with railtype RAIL).&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;
;ROADVEH_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect( VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
| yes&lt;br /&gt;
| &lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
Set the type of visual effect for the vehicle and its positional offset with respect to the vehicle. An offset of 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
&lt;br /&gt;
;VISUAL_EFFECT_DEFAULT&lt;br /&gt;
:No effect, unless for the default vehicles&lt;br /&gt;
;VISUAL_EFFECT_STEAM&lt;br /&gt;
:Steam like from steam engine&lt;br /&gt;
;VISUAL_EFFECT_DIESEL&lt;br /&gt;
:Steam from internal combustion engine&lt;br /&gt;
;VISUAL_EFFECT_ELECTRIC&lt;br /&gt;
:Electric sparks&lt;br /&gt;
;VISUAL_EFFECT_DISABLE&lt;br /&gt;
:No effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| 1 ... 8&lt;br /&gt;
| yes&lt;br /&gt;
| Length of the vehicle in arbitrary units. Use a value of 8 (equal to the predefined constant VEHICLE_LENGTH) for a full-length vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ship properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
| {{ottd|14}}{{nml|7.5}} 0 .. 32767 km/h (float, speed units)&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;
;SHIP_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]].&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;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|-&lt;br /&gt;
| ocean_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on ocean tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| canal_speed_fraction&lt;br /&gt;
| 0 ... 1 (float)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r22639}} fraction of base speed on canal tiles (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| visual_effect(VISUAL_EFFECT_XXX, offset)&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
XXX=[DEFAULT &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STEAM &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DIESEL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ELECTRIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DISABLE], it is the type of the visual effect you want for this ship. Default means no effect. Offset is the position of the effect. 0 is default, negative values mean more to the front and positive values are backwards. Minimum offset is -8, maximum is 7.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;EFFECT_SPAWN_MODEL_XXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
There are two methods to set the visual effect of a vehicle:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;visual_effect&amp;lt;/code&amp;gt;: Easy method for simple effects.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; + callback &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;: {{ottdp|1.5|no|ottdrev=r26747}} Harder to use, but also more powerful.&lt;br /&gt;
For each vehicle you have to decide for the method. You cannot use them both for the same vehicle &#039;item&#039;.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.5|no|ottdrev=r26747}} Set the spawning model of visual effects for the vehicle, that is when the vehicle emits visual effects.&lt;br /&gt;
The visual appearance itself is defined by the callback &#039;create_effect&#039;.&lt;br /&gt;
&lt;br /&gt;
;EFFECT_SPAWN_MODEL_NONE&lt;br /&gt;
: Do not spawn any effects.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_STEAM&lt;br /&gt;
: Gradually less effects when approaching max speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_DIESEL&lt;br /&gt;
: Effect proportional to acceleration, no effect when idling at top speed.&lt;br /&gt;
;EFFECT_SPAWN_MODEL_ELECTRIC&lt;br /&gt;
: Random effect, gradually less likely when approaching max speed.&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| 1 ... 255&lt;br /&gt;
| {{ottd|14}} Acceleration in units of ~0.5 km/h per tick. 1 is the default and is the acceleration of default ships.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aircraft properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;
;AIRCRAFT_FLAG_SPRITE_STACK&lt;br /&gt;
:{{ottdp|1.7|no|ottdrev=r27668}} Enable [[NML:Vehicles#Composing_vehicles_from_multiple_sprites|composition from multiple sprites]]. This also affects custom rotor sprites.&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| in 1/32 of default refit cost base&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(VEH_CBF_XXX, ...)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| aircraft_type&lt;br /&gt;
| AIRCRAFT_TYPE_XXX&lt;br /&gt;
| &lt;br /&gt;
;AIRCRAFT_TYPE_HELICOPTER&lt;br /&gt;
:Can land on helipad&lt;br /&gt;
;AIRCRAFT_TYPE_SMALL&lt;br /&gt;
:Can land on all airports with runway&lt;br /&gt;
;AIRCRAFT_TYPE_LARGE&lt;br /&gt;
:Can land on all airports with runway. But have a high crash chance on small airports&lt;br /&gt;
|-&lt;br /&gt;
| acceleration&lt;br /&gt;
| {{ottd|1.3.1}} 0 ... 255 &amp;lt;br/&amp;gt; {{ottd|&amp;amp;lt;1.3.1}} 0 ... 19&lt;br /&gt;
| {{ottd|1.3.1}} Default aircraft use values in the range 18 to 50 (= 6.75 to 18.75 mph/tick = 499.5 to 1387.5 mph/day), which is generally considered quite fast.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ottd|&amp;amp;lt;1.3.1}} In older OpenTTD, aircraft provided by NewGRF accelerate 166% faster than intended.&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| 0 ... 65536&lt;br /&gt;
| Capacity for the passenger compartment. See also the notes at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; below.&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| Capacity for the mail compartment, if refitted to a cargo in the CC_PASSENGERS class. When refitted to other cargoes, this capacity is added to the passenger capacity to determine the base capacity. The actual capacity is set to this base capacity divided by 1 for mail, 2 for goods and 4 for all other cargoes. To override this effect, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;passenger_capacity&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mail_capacity&amp;lt;/code&amp;gt; callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| sound_effect&lt;br /&gt;
| SOUND_XXX&lt;br /&gt;
|&lt;br /&gt;
See available [[NML:List of sound effects|sound effects]].&lt;br /&gt;
&amp;lt;br/&amp;gt;{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;sound(&amp;quot;sound.wav&amp;quot;)&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;import_sound(grfid, number)&amp;lt;/code&amp;gt; are valid here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle variables==&lt;br /&gt;
&lt;br /&gt;
Below an overview of all vehicle-specific variables. Note that in the purchase list, the vehicle is not built yet and as such many variables are not available. All general variables are available, refer to the table for info on vehicle-specific variables. Trying to access a non-available variable invokes undefined behaviour. Please note that while all variables are available for all vehicles types, some of them only make sense for one or more vehicle types. For example checking current_railtype for a non-rail vehicle doesn&#039;t make sense at all, similarly checking current_roadtype for a tram won&#039;t return a useful result.&lt;br /&gt;
&lt;br /&gt;
===Variables without parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The position of the current vehicle-part from the start of the vehicle. The engine will get value 0, the first wagon (or second engine) gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_consist_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Same as position_in_consist but counted from the end. The last wagon will get value 0.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_consist&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| The total number of vehicles-parts in this vehicle. For aircraft this will include the shadow and the rotor.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_vehid_chain_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| See position_in_consist_from_end, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| num_vehs_in_vehid_chain&lt;br /&gt;
| 1 ... 256&lt;br /&gt;
| No&lt;br /&gt;
| See num_vehs_in_consist, but not of the complete vehicle but only all consecutive parts with the same id.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the start of the vehicle. The first will get value 0, the second one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| position_in_articulated_veh_from_end&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.4|no|ottdrev=r26157}} The position of the current articulated vehicle from the end of the vehicle. The last will get value 0, the second last one gets value 1, etc.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_classes_in_consist&lt;br /&gt;
| Bitmask of CC_XXX&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo classes|cargo classes]]&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_type&lt;br /&gt;
|&lt;br /&gt;
[[NML:Cargos#Cargo properties|Cargo label]]&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo type in the consist.  Prior to nml r2320 this was known as most_common_refit, and didn&#039;t work, and was also incorrectly documented :)&lt;br /&gt;
|-&lt;br /&gt;
| most_common_cargo_subtype&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| The most common cargo subtype for most_common_cargo_type&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;
| flight_state&lt;br /&gt;
| 0 ... 28&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.8.1}} Only for aircrafts.&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 ... 0xFFFFFF&lt;br /&gt;
| Yes, always 0&lt;br /&gt;
| Is increased every time the vehicle moves a single step on the map. Useful for driving animations.&lt;br /&gt;
For that, make the animation use a number of frames, which is a power of two, i.e. 2, 4, 8, 16, 32, ... frames, and then use the lower n bits of motion_counter.&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_flipped&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 sprite is reversed via flip-vehicle-in-depot (trains only), or if it&#039;s the rear-most part of a dual-head engine.&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;
| Entry from railtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| This variable is useless due to equivalent railtypes, use tile_xxx_railtype instead.  If you do use this variable, it will not work as expected 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.&lt;br /&gt;
|-&lt;br /&gt;
| current_roadtype&lt;br /&gt;
| Entry from current_roadtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent roadtypes, use tile_xxx_roadtype instead.  Don&#039;t use this variable unless you&#039;ve defined a roadtype translation table. If the road vehicle is running on a roadtype that is not listed in your roadtype translation table this variable will contain 0xFF. Checking this for a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| current_tramtype&lt;br /&gt;
| Entry from tramtype translation table or 0xFF&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.5}} {{ottdp|1.10|no}} This variable is useless due to equivalent tramtypes, use tile_xxx_tramtype instead. Don&#039;t use this variable unless you&#039;ve defined a tramtype translation table. If the road vehicle is running on a tramtype that is not listed in your tramtype translation table this variable will contain 0xFF. Checking this for a road vehicle that is not a tram is not supported and will not return a useful result.&lt;br /&gt;
|-&lt;br /&gt;
| tile_has_catenary&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} True if the track_type on the tile has catenary. This is a little simplified as it is intended for sprite changes (e.g. raise/lower pantograph) and only checks for &amp;quot;some catenary&amp;quot;. To distinguish different types of electric track, AC and DC voltages etc, ... use tile_xxx_railtype/tile_xxx_roadtype/tile_xxx_tramtype instead.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_triggers&lt;br /&gt;
|&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random triggers waiting to be matched. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
Random data that can be used to randomize certain descisions. (see [[NML:Random switch|Random switch]])&lt;br /&gt;
|-&lt;br /&gt;
| grfid&lt;br /&gt;
| 0 ... 0xFFFFFFFF&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
GRFID that defined the [[NML:Graphics|graphics]]-block for this vehicle. To compare this with other grfids, use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert the other GRFID to a number as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_type_id&lt;br /&gt;
| 0 ... 65535 or a name defined in item block&lt;br /&gt;
| No&lt;br /&gt;
| GRF-local ID of the vehicle, equal to the item ID. Note that vehicles from other NewGRFs may have the same ID, so you&#039;ll generally have to check the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;grfid&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_hidden&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is hidden in a depot or tunnel.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_stopped&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is stopped, or if it is braking for a stop (trains only).&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_crashed&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle has crashed.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_broken&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is broken down.&lt;br /&gt;
|-&lt;br /&gt;
| date_of_last_service&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| breakdowns_since_last_service&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| No&lt;br /&gt;
| Number of breakdowns since the last service&lt;br /&gt;
|-&lt;br /&gt;
| reliability&lt;br /&gt;
| 0 ... 100&lt;br /&gt;
| No&lt;br /&gt;
| Reliability (percentage)&lt;br /&gt;
|-&lt;br /&gt;
| age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| max_age_in_days&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| No&lt;br /&gt;
| Maximum vehicle age in days.&lt;br /&gt;
|-&lt;br /&gt;
| current_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The current speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| The maximum speed of the vehicle in m/s&lt;br /&gt;
|-&lt;br /&gt;
| current_max_speed&lt;br /&gt;
| (speed units)&lt;br /&gt;
| No&lt;br /&gt;
| {{nml|0.3}} {{ottdp|1.3|no|ottdrev=r24246}} Current maximum speed of the vehicle in m/s. This includes e.g. track or timetable limits. Only valid for front vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_in_depot&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| Value is 1 if the vehicle is inside a depot&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_is_unloading&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.5|2.5|ottdrev=r26430}} Value is 1 if the vehicle is unloading at a station and has not yet started loading new cargo.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Variables that require an argument===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! Argument&lt;br /&gt;
! value range&lt;br /&gt;
! available in&amp;lt;br /&amp;gt;purchase list?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| count_veh_id&lt;br /&gt;
| The vehicle ID to look for.&lt;br /&gt;
| 0..255&lt;br /&gt;
| No&lt;br /&gt;
| The number of vehicles in the current consist that have the given ID.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_curv_info&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Argument range is -128..127. Positive values are interpreted as towards the end, negative values as towards the front. If the offset is outside the vehicle chain, the result value will be 0.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| -4..4&lt;br /&gt;
| No&lt;br /&gt;
| Difference in direction between the other vehicle and this vehicle. Curvature to the right is positive. 1 unit is 45 degrees.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_is_hidden&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| 1 the other vehicle is hidden in a depot or tunnel, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_x_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in X-position (top-right to bottom-left) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_y_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Y-position (top-left to bottom-right) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| other_veh_z_offset&lt;br /&gt;
| Offset in the chain from the current vehicle.&amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| -128..127&lt;br /&gt;
| No&lt;br /&gt;
| Signed difference in Z-position (upwards) between the other vehicle and this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| tile_supports_railtype &amp;lt;br /&amp;gt; tile_supports_roadtype &amp;lt;br /&amp;gt; tile_supports_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are compatible with the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_supports_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_powers_railtype &amp;lt;br /&amp;gt; tile_powers_roadtype &amp;lt;br /&amp;gt;tile_powers_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} Vehicles of the track_type label used as parameter are powered on the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_powers_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tile_is_railtype &amp;lt;br /&amp;gt; tile_is_roadtype &amp;lt;br /&amp;gt; tile_is_tramtype&lt;br /&gt;
| Entry from rail/road/tram translation table&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| No&lt;br /&gt;
| {{ottdp|1.11|no}} The track_type label used as parameter is identical or equivalent (listed as alternate label in rail-/road-/tram-type property 1D) to the rail/road/tram track_type on the current tile. Example: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_is_railtype(ELRL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| yes&lt;br /&gt;
| {{ottd|15.0}} Check if the vehicle has that specific badge attached.&lt;br /&gt;
|-&lt;br /&gt;
| count_has_badge&lt;br /&gt;
| Label from the [[NML:Badgetable|badgetable]].&lt;br /&gt;
| 0..255&lt;br /&gt;
| no&lt;br /&gt;
| {{ottd|15.0}} The number of vehicles in the current consist that have that specific badge attached.&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;wikitable sortable&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;
| &amp;lt;b&amp;gt;NOTE: As of OpenTTD 13, this feature is considered deprecated for most uses. Use variants instead.&amp;lt;/b&amp;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 to select specific sprites for the vehicle&#039;s current cargo subtype.&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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; The sound event, see the [[#Sound events|table]] below.&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt; contains 1 during the first call, 2 during the second, etc.&lt;br /&gt;
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;
The vehicle ID for the articulated part must be in the range 0 .. 16383.&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;
|-&lt;br /&gt;
| can_attach_wagon&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
| String or CB_RESULT_ATTACH_XXX&lt;br /&gt;
| Called when a wagon is being attached, to allow or disallow attaching. If a wagon is inserted in the middle, all wagons are removed and attached one-by-one in the new order. This callback has to be defined at the engine. The scopes behave different than usual though:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt; refers to the wagon being attached. (despite the callback being defined at the engine)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;PARENT&amp;lt;/code&amp;gt; refers to the consist of the engine up to the wagon before &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;SELF&amp;lt;/code&amp;gt;, i.e. not (yet) including the wagon being attached.&lt;br /&gt;
Return a string to disallow with the string as error message. Return CB_RESULT_ATTACH_DISALLOW to disallow with standard message (&amp;quot;incompatible railtypes&amp;quot;), CB_RESULT_ATTACH_ALLOW to allow or CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES to allow if the railtypes match (default).&lt;br /&gt;
|-&lt;br /&gt;
| refit_cost&lt;br /&gt;
| {{ottdp|1.2|no|ottdrev=r23089}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| -8192 .. 8191 as refit cost. Add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt; if you want to allow autorefit.&lt;br /&gt;
| When returning a negative value, encode the cost as (cost &amp;amp; &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_REFIT_COST_MASK&amp;lt;/code&amp;gt;) before (possibly) adding &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_AUTOREFIT&amp;lt;/code&amp;gt;. To allow autorefitting, the corresponding bit in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; must be set as well.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 8)&amp;lt;/code&amp;gt;: The new cargo type.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;: 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).&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 16)&amp;lt;/code&amp;gt;: A bitmask of the [[NML:Cargos#Cargo_classes|cargo classes]] of the target cargo type. &lt;br /&gt;
Note that this callback may also be called when the vehicle does not exist yet, so the available variables are limited.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect&lt;br /&gt;
| {{ottdp|1.5|no|ottdrev=r26747}} Trains, Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
| 0 .. 3 for number of effects. Optionally add &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt; and/or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
| Called when a effect spawning model is defined via &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model&amp;lt;/code&amp;gt; resp. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The result specifies how many effects shall be created.&lt;br /&gt;
The position and appearance of the individual effects is returned via registers 0x100 to 0x103:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
switch (FEAT_XXX, SELF, switch_name, [&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_XXX, 8, -3, 10), 0x100), // first effect,&lt;br /&gt;
  STORE_TEMP(create_effect(EFFECT_SPRITE_YYY, 8,  3, 10), 0x101)  // second effect, ...&lt;br /&gt;
]) {&lt;br /&gt;
return 2; // number of effects&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The register values are created using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&amp;lt;/code&amp;gt; function:&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_&amp;lt;/code&amp;gt;[&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;NONE&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STEAM&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;DIESEL&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;ELECTRIC&amp;lt;/code&amp;gt;|&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;AIRCRAFT_BREAKDOWN_SMOKE&amp;lt;/code&amp;gt;].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
&lt;br /&gt;
Additional to the number of effects, the callback result may specify these flags:&lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_CENTER&amp;lt;/code&amp;gt;&lt;br /&gt;
:(Train and road vehicle only) If set, position effect relative to vehicle center instead of relative to vehicle sprite. (behaves the same for vehicles with length 8/8) &lt;br /&gt;
;&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;CB_RESULT_CREATE_EFFECT_NO_ROTATION&amp;lt;/code&amp;gt;&lt;br /&gt;
*If not set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe longitudinal/transversal positions, which are rotate wrt. vehicle orientation.&lt;br /&gt;
*If set, the parameters to &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_sprite&amp;lt;/code&amp;gt; describe X and Y positions, which are not automatically rotated.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_build_probability&lt;br /&gt;
| {{nml|0.7.5}} {{ottd|14.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
| 0 &lt;br /&gt;
| Probability of reversing rail vehicle, i.e. facing forward or backward, when purchased.&lt;br /&gt;
|-&lt;br /&gt;
| refit&lt;br /&gt;
| {{ottd|15.0}} All vehicle types&lt;br /&gt;
| Callback runs once, in purchase scope only &lt;br /&gt;
| &lt;br /&gt;
* 0 Don&#039;t change refittability (i.e. use whatever the evaluation of the various refittability vehicle props has determined).&lt;br /&gt;
* 1 Allow cargo type as a refit.&lt;br /&gt;
* 2 Disallow cargo type as a refit.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
The custom refit callback allows overriding the refittablity of each cargo as defined by the standard vehicle properties. It will be called for each defined cargo type once after the game has loaded all NewGRF files. The callback is run in purchase list scope, i.e. for cargotype FF. No variables of an actual vehicle are available. Information about the cargo type the callback is called for is available in variables 10 and 18:&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As this callback is not re-evaluated after game initialization, using any dynamic variables like e.g. game date will lead to undefined and faulty behaviour. &lt;br /&gt;
&lt;br /&gt;
This callback is available starting with {{ottdp|15|no|ottdrev=gd2496b6ec4}} OpenTTD 15.&lt;br /&gt;
&lt;br /&gt;
See https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29&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;wikitable sortable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Available for&lt;br /&gt;
! In purchase menu?&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| loading_speed&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| speed&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_speed&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| running_cost_factor&lt;br /&gt;
| All&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_running_cost_factor&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_age_period&lt;br /&gt;
| All&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| cargo_capacity&lt;br /&gt;
| All except aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_cargo_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| passenger_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_passenger_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mail_capacity&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_mail_capacity&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| range&lt;br /&gt;
| Aircraft&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_range&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model_and_powered&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| effect_spawn_model&lt;br /&gt;
| Road Vehicles, Ships&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| power&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_power&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| weight&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_weight&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Units are not (yet) available&lt;br /&gt;
|-&lt;br /&gt;
| length&lt;br /&gt;
| Trains, Road vehicles&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| tractive_effort_coefficient&lt;br /&gt;
| Trains, Road Vehicles&lt;br /&gt;
| Yes, unless &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase_tractive_effort_coefficient&amp;lt;/code&amp;gt; is set separately&lt;br /&gt;
| Value range is 0 .. 255 instead of 0 .. 1.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask_vehicle_info&lt;br /&gt;
| Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| curve_speed_mod&lt;br /&gt;
| {{nml|0.7}} {{ottd|12.0}} Trains&lt;br /&gt;
| No&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| {{nml|0.7.2}} {{ottd|14.0}} All&lt;br /&gt;
| Yes&lt;br /&gt;
| Can be used to display vehicle name differently depending on context (purchase menu, depot, nested variant depth etc). &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains detailed information about context - please see https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Engine_name_.28161.29&lt;br /&gt;
|}&lt;br /&gt;
&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;getbits(extra_callback_info1, 0, 8)&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;
! getbits(extra_callback_info1, 0, 8) !! 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 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;
===Composing vehicles from multiple sprites===&lt;br /&gt;
{{ottdp|1.7|no|ottdrev=r27668}} Since OpenTTD r27668 you can draw vehicles by drawing multiple sprites on top of each other.&lt;br /&gt;
* The sprites can use different recolouring.&lt;br /&gt;
* When using 32bpp sprites, the sprites can use the alpha channel to blend with the other sprites. In particular you can use this to alpha-blend company colours over other sprites.&lt;br /&gt;
&lt;br /&gt;
To enable this, you need to set &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;XXX_FLAG_SPRITE_STACK&amp;lt;/code&amp;gt; in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;misc_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
When enabled, sprites are resolved multiple times while incrementing an iteration number, that can be read via&lt;br /&gt;
&amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For OpenTTD 1.7 to 12.0, this is limited to at most 4 sprites per articulated part.&lt;br /&gt;
&lt;br /&gt;
Increased to 8 sprites per articulated part for OpenTTD 13.0 {{ottdp|13.0|no}}&lt;br /&gt;
&lt;br /&gt;
In addition you need to set register 100 as additional result:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(CB_FLAG_MORE_SPRITES | recolouring, 0x100)&amp;lt;/code&amp;gt; if there are more sprites to draw.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STORE_TEMP(recolouring, 0x100)&amp;lt;/code&amp;gt; if there are no more sprites to draw.&lt;br /&gt;
&amp;quot;recolouring&amp;quot; can be:&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_USE_DEFAULT&amp;lt;/code&amp;gt; to use the default vehicle recolouring.&lt;br /&gt;
* &amp;lt;code&amp;gt;PALETTE_IDENTITY&amp;lt;/code&amp;gt; to use no recolouring&lt;br /&gt;
* Any other default or custom recolouring sprite.&lt;br /&gt;
&lt;br /&gt;
===Sound events===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&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;br /&gt;
&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;
Note that while vehicle ID affects the order in which vehicles appear in the purchase menu, this can be overridden using the [[NML:Sorting vehicles in the purchase list|sort block]].&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;/div&gt;</summary>
		<author><name>Rito12</name></author>
	</entry>
</feed>