<?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=Planetmaker</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=Planetmaker"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Planetmaker"/>
	<updated>2026-05-07T04:16:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3975</id>
		<title>NML:General</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3975"/>
		<updated>2020-02-17T14:26:00Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: towns&amp;#039; feature is 0x12&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==List of features and feature-specific Actions==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Feature || [[Action0]] || [[Action1]] || [[Action2]] || [[VariationalAction2 | VarAction2]] || [[RandomAction2]] || [[Callbacks]] || [[Action3]] || [[Action4]]&lt;br /&gt;
|-&lt;br /&gt;
|00 || Trains || [[Action0/Vehicles/Trains | yes]] || [[Action1 | yes]] || [[Action2/Vehicles | yes]] || [[VariationalAction2/Vehicles | yes]] || [[RandomAction2#Vehicles | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|01 || Road Vehicles || [[Action0/Vehicles/RoadVehicles | yes]] || [[Action1 | yes]] || [[Action2/Vehicles | yes]] || [[VariationalAction2/Vehicles | yes]] || [[RandomAction2#Vehicles | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|02 || Ships || [[Action0/Vehicles/Ships | yes]] || [[Action1 | yes]] || [[Action2/Vehicles | yes]] || [[VariationalAction2/Vehicles | yes]] || [[RandomAction2#Vehicles | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|03 || Aircraft || [[Action0/Vehicles/Planes | yes]] || [[Action1 | yes]] || [[Action2/Vehicles | yes]] || [[VariationalAction2/Vehicles | yes]] || [[RandomAction2#Vehicles | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|04 || Stations || [[Action0/Stations | yes]] || [[Action1 | yes]] || [[Action2/Stations | yes]] || [[VariationalAction2/Stations | yes]] || [[RandomAction2#Stations | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|05 || Canals || [[Action0/Canals | yes]] || [[Action1 | yes]] || [[Action2/Single Set | yes]] || [[VariationalAction2/Canals | yes]] || [[RandomAction2#Canals | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|06 || Bridges || [[Action0/Bridges | yes]] || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || [[VariationalAction2/Bridges | no-ish]] || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || [[Action0/Bridges#Purchase_text_.2810.29 | yes-ish]]&lt;br /&gt;
|-&lt;br /&gt;
|07 || Houses || [[Action0/Houses | yes]] || [[Action1 | yes]] || [[Action2/Sprite Layout | yes]] || [[VariationalAction2/Houses | yes]] || [[RandomAction2#Town_building_triggers | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|08 || Global Settings || [[Action0/Global Settings | yes]] || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|09 || Industry Tiles || [[Action0/Industry Tiles | yes]] || [[Action1 | yes]] || [[Action2/Sprite Layout | yes]] || [[VariationalAction2/Industry Tiles | yes]] || [[RandomAction2#Industry_tile_triggers | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0A || Industries || [[Action0/Industries | yes]] || [[Action1 | yes]] || [[Action2/Industries | yes]] || [[VariationalAction2/Industries | yes]] || [[RandomAction2#Industry_tile_triggers | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|0B || Cargos || [[Action0/Cargos | yes]] || [[Action1 | yes]] || [[Action2/Single Set | yes]] || [[VariationalAction2 | yes-ish]] &amp;lt;ref name=&amp;quot;novars&amp;quot;&amp;gt;No feature specific variables though&amp;lt;/ref&amp;gt; || &#039;&#039;no&#039;&#039; || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|0C || Sound Effects || [[Action0/Sound Effects | yes]] || &#039;&#039;no&#039;&#039; || [[Action2/Only Callback Failure | yes-ish]] &amp;lt;ref name=&amp;quot;failonly&amp;quot;&amp;gt;Callback failure only&amp;lt;/ref&amp;gt; || [[VariationalAction2 | yes-ish]] &amp;lt;ref name=&amp;quot;novars&amp;quot;/&amp;gt; || &#039;&#039;no&#039;&#039; || [[Callbacks | yes]] || [[Action3 | yes]] || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0D || Airports || [[Action0/Airports | yes]] || [[Action1 | yes]] || [[Action2/Single Set | yes]] || [[VariationalAction2/Airports | yes]] || [[RandomAction2#Stations | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|0E || Signals || &#039;&#039;no&#039;&#039; || [[Action5#0E_New_Signals | Action5]] || [[Action2/Only Callback Failure | yes-ish]] &amp;lt;ref name=&amp;quot;failonly&amp;quot;/&amp;gt; || [[VariationalAction2/Signals | yes]] || &#039;&#039;no&#039;&#039; || [[Callbacks | yes]] || [[Action3 | yes]] || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0F || Objects || [[Action0/Objects | yes]] || [[Action1 | yes]] || [[Action2/Sprite Layout | yes]] || [[VariationalAction2/Objects | yes]] || [[RandomAction2#Objects | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|10 || Railtypes || [[Action0/Railtypes | yes]] || [[Action1 | yes]] || [[Action2/Single Set | yes]] || [[VariationalAction2/Railtypes | yes]] || [[RandomAction2#Rail_types | yes]] || &#039;&#039;no&#039;&#039; || [[Action3 | yes]] || [[Action4 | yes]]&lt;br /&gt;
|-&lt;br /&gt;
|11 || Airport Tiles || [[Action0/Airport Tiles | yes]] || [[Action1 | yes]] || [[Action2/Sprite Layout | yes]] || [[VariationalAction2/Airport Tiles | yes]] || [[RandomAction2#Stations | yes]] || [[Callbacks | yes]] || [[Action3 | yes]] || &#039;&#039;no&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|12 || Towns || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || [[VariationalAction2/Towns | yes]] || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || [[ActionF]]&lt;br /&gt;
|-&lt;br /&gt;
|48 || Original Strings &amp;lt;ref&amp;gt;This is a pseudo-feature only used in Action4 to assign original strings. The value 0x48 originates from the way old TTDPatch versions checked for switches enabling/disabling features. NewTrains (feature 0x00) are activated by [[TTDPatchFlags | switch 0x37]]. Adding 0x48 to that results in 0x7F - a switch which is always set when TTDPatch is active. Thus feature 0x48 was not disabled by any switch. (today TTDPatch does not depend on the switches being in order of the features)&amp;lt;/ref&amp;gt; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || &#039;&#039;no&#039;&#039; || [[Action4 | yes]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Industries&amp;diff=3830</id>
		<title>VariationalAction2/Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Industries&amp;diff=3830"/>
		<updated>2018-12-22T10:22:17Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: fix order of sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Variable !![[GRFActionsDetailed|Size]] !!Version !! Description&lt;br /&gt;
|-&lt;br /&gt;
|40..42||||{{ottdp| | }}||Waiting cargo. See also variable 6F.&lt;br /&gt;
|-&lt;br /&gt;
|43||||{{ottdp| |2.6|ttdprev=r1298}}||Manhattan distance of closest dry/land tile&lt;br /&gt;
|-&lt;br /&gt;
|44||||{{ottdp| |2.6|ttdprev=r1594}}||Layout number (1-based)&lt;br /&gt;
|-&lt;br /&gt;
|45||||{{ottdp| |2.6|ttdprev=r1711}}||Player info&lt;br /&gt;
|-&lt;br /&gt;
|46||||{{ottdp|0.7|2.6|ttdprev=r2047|ottdrev=r13443}}||Date when industry was built in days since year 0&lt;br /&gt;
|-&lt;br /&gt;
|60||||{{ottdp| |2.5|ttdprev=alpha 73}}||Get industry tile ID at offset&lt;br /&gt;
|-&lt;br /&gt;
|61||||{{ottdp| |2.5|ttdprev=alpha 73}}||Get random tile bits at offset&lt;br /&gt;
|-&lt;br /&gt;
|62||||{{ottdp| |2.5|ttdprev=alpha 74}}||Land info of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|63||||{{ottdp| | }}||Animation stage of nearby tiles&lt;br /&gt;
|-&lt;br /&gt;
|64||||{{ottdp| | }}||Distance of nearest industry with given type&lt;br /&gt;
|-&lt;br /&gt;
|65||||{{ottdp| | }}||Get [[TownZones|town zone]] and Manhattan distance of closest town&lt;br /&gt;
|-&lt;br /&gt;
|66||||{{ottdp| | }}||Get square of Euclidean distance of closest town&lt;br /&gt;
|-&lt;br /&gt;
|67||||{{ottdp| | }}||Count of industry, distance of closest instance&lt;br /&gt;
|-&lt;br /&gt;
|68||||{{ottdp| | }}||Like the above, but with layout filter&lt;br /&gt;
|-&lt;br /&gt;
|69||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of produced output cargo waiting to be distributed.&lt;br /&gt;
|-&lt;br /&gt;
|6A||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of cargo produced this month (so far).&lt;br /&gt;
|-&lt;br /&gt;
|6B||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of cargo transported this month (so far).&lt;br /&gt;
|-&lt;br /&gt;
|6C||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of cargo produced last month.&lt;br /&gt;
|-&lt;br /&gt;
|6D||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of cargo transported last month.&lt;br /&gt;
|-&lt;br /&gt;
|6E||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Date since cargo was delivered last. (in days since year 0)&lt;br /&gt;
|-&lt;br /&gt;
|6F||||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Amount of waiting cargo to be processed.&lt;br /&gt;
|-&lt;br /&gt;
|8A||W||{{ottdp| | }}||Amount of produced output cargo waiting to be distributed, for the first output cargo. See also variable 69.&lt;br /&gt;
|-&lt;br /&gt;
|8C||W||{{ottdp| | }}||Amount of produced output cargo waiting to be distributed, for the 2nd output cargo. See also variable 69.&lt;br /&gt;
|-&lt;br /&gt;
|93||B||{{ottdp| | }}||Production level. Normally between 4 and 128, default starting level is 16. A level of 0 means imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
|94||W||{{ottdp| | }}||Production this month of first output cargo. See also variable 6A.&lt;br /&gt;
|-&lt;br /&gt;
|96||W||{{ottdp| | }}||Production this month of 2nd output cargo. See also variable 6A.&lt;br /&gt;
|-&lt;br /&gt;
|98||W||{{ottdp| | }}||Amount of cargo transported this month of the first output cargo. See also variable 6B.&lt;br /&gt;
|-&lt;br /&gt;
|9A||W||{{ottdp| | }}||Amount of cargo transported this month of the 2nd output cargo. See also variable 6B.&lt;br /&gt;
|-&lt;br /&gt;
|9C||B||{{ottdp| | }}||Fraction of cargo transported last month of the first output cargo&lt;br /&gt;
|-&lt;br /&gt;
|9D||B||{{ottdp| | }}||Fraction of cargo transported last month of the 2nd output cargo&lt;br /&gt;
|-&lt;br /&gt;
|9E||W||{{ottdp| | }}||Production last month of the first output cargo. See also variable 6C.&lt;br /&gt;
|-&lt;br /&gt;
|A0||W||{{ottdp| | }}||Production last month of the 2nd output cargo. See also variable 6C.&lt;br /&gt;
|-&lt;br /&gt;
|A2||W||{{ottdp| | }}||Amount of cargo transported last month of the first output cargo. See also variable 6D.&lt;br /&gt;
|-&lt;br /&gt;
|A4||W||{{ottdp| | }}||Amount of cargo transported last month of the 2nd output cargo. See also variable 6D.&lt;br /&gt;
|-&lt;br /&gt;
|A7||B||{{ottdp| |2.5|ttdprev=alpha 74}}||Industry founder information&lt;br /&gt;
|-&lt;br /&gt;
|A8||B||{{ottdp| | }}||Random (company) colour, chosen during construction&lt;br /&gt;
|-&lt;br /&gt;
|B0||W||{{ottdp| | }}||Date when industry was built in days since 1920&lt;br /&gt;
|-&lt;br /&gt;
|B3||B||{{ottdp| | }}||Construction type&lt;br /&gt;
|-&lt;br /&gt;
|B4||W||{{ottdp| |2.6|ttdprev=r1321}}||Date when cargo was last accepted in days since 1920, or 0 if no cargo was ever accepted. See also variable 6E.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For other 80+x variables confer the [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_IndustryArray TTD industry structure].&lt;br /&gt;
&lt;br /&gt;
=== Waiting cargo (40..42) ===&lt;br /&gt;
&lt;br /&gt;
If bit 1 or 2 is set in property 21, these variables contain the amount of incoming cargo waiting to be processed. (40 gives the amount of the first type waiting, 41 gives the same for the second type etc.) These variables are capped at FFFFh (65535).&lt;br /&gt;
&lt;br /&gt;
See also variable 6F.&lt;br /&gt;
&lt;br /&gt;
=== Manhattan distance of closest dry/land tile (43) ===&lt;br /&gt;
&lt;br /&gt;
This variable works the same way as var. 8B does during callback 28: if your industry is built on water, it gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile. However, you can&#039;t use this variable during callback 28; you must always use 8B.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PLEASE NOTE&#039;&#039;&#039;: This variable is rather expensive to compute because, in the worst case, it has to check all tiles on the map before it gives up looking for a good tile. Try to avoid it in frequent callbacks such as the production callback, animation callbacks (unless the animation is slow, around 1 frame per game day or slower). It is, however, OK to use it during the production change callbacks.&lt;br /&gt;
&lt;br /&gt;
=== Layout number (44) ===&lt;br /&gt;
T&lt;br /&gt;
his variable returns the number of the current layout. The first layout will return 01, the second 02, etc. In other words, this is one larger than what you get in variable 86 during callback 28.&lt;br /&gt;
&lt;br /&gt;
If the industry was created using an earlier version of TTDPatch, or while newindustries was off, the result will be zero.&lt;br /&gt;
&lt;br /&gt;
=== Player info (45) ===&lt;br /&gt;
&lt;br /&gt;
As [[VarAction2Vehicles#Player info 43|vehicle variable 43]], except that the no-player state is indicated by var A7 being 10h.&lt;br /&gt;
&lt;br /&gt;
=== Date when industry was built in days since year 0 (46) ===&lt;br /&gt;
&lt;br /&gt;
Exact same behaviour as var B0, but based on year 0, instead of year 1920&lt;br /&gt;
&lt;br /&gt;
In TTDPatch, industry age is limited to 65535 days (approximately 180 years) -- build date is never more than 65535 days ago.&lt;br /&gt;
&lt;br /&gt;
=== Get industry tile ID at offset (60) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the northernmost tile of the industry: the high nibble contains the Y offset, the low one the X offset; both are unsigned. The high word of the return value is currently reserved, and the low word can be:&lt;br /&gt;
* 00xxh if the tile is an industry tile and was defined in the current GRF with ID xx.&lt;br /&gt;
* FFxxh if the tile is an industry tile of an old type, and has the ID xx.&lt;br /&gt;
* FFFEh if the tile is an industry tile that was defined in another GRF file&lt;br /&gt;
* FFFFh if the tile isn&#039;t an industry tile, or doesn&#039;t belong to the current industry&lt;br /&gt;
&lt;br /&gt;
=== Get random tile bits at offset (61) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the northernmost tile of the industry: the high nibble contains the Y offset, the low one the X offset; both are unsigned. If there&#039;s an industry tile on that offset and it belongs to the current industry, the lowest byte of the return value will contain the random bits of that tile. Otherwise, the lowest byte will be zero.&lt;br /&gt;
&lt;br /&gt;
The other bytes are reserved for future use.&lt;br /&gt;
&lt;br /&gt;
=== Land info of nearby tiles (62) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the northernmost tile of the industry: the high nibble contains the Y offset, the low one the X offset; both are unsigned. This variable returns the same values as [[VarAction2IndustryTiles#Land info of nearby tiles 60|industry tile variable 60]], in the same format, except that bit 0 in the &#039;&#039;&#039;bb&#039;&#039;&#039; part is undefined. The offset should be given relatively to the north corner of the industry.&lt;br /&gt;
&lt;br /&gt;
=== Animation stage of nearby tiles (63) ===&lt;br /&gt;
&lt;br /&gt;
The parameter of this variable is an offset from the northernmost tile of the industry: the high nibble contains the Y offset, the low one the X offset; both are unsigned. This variable returns the same values as [[VarAction2IndustryTiles#Animation stage for nearby tiles 61|industry tile variable 61]], in the same format. The offset should be given relatively to the north corner of the industry.&lt;br /&gt;
&lt;br /&gt;
=== Distance of nearest industry with given type (64) ===&lt;br /&gt;
&lt;br /&gt;
The format of the parameter is the same as for industry property 16: either the ID of a new type with bit 7 set, or the ID of an old type. The returned value is FFFFFFFFh if there are no industries with the given type (not counting the current one, if it has the given type); otherwise, the returned value is the Manhattan distance of the closest industry with the given type.&lt;br /&gt;
&lt;br /&gt;
=== Get [[TownZones|town zone]] and Manhattan distance of closest town (65) ===&lt;br /&gt;
&lt;br /&gt;
The parameter gives an offset from the northernmost tile of the industry: the high nibble means the Y offset, the low nibble means the X offset, both signed. The returned value is rrzzdddd, where rr is reserved for future use, zz is the [[TownZones|town zone]] of the selected tile, while dddd is the Manhattan distance of the closest town.&lt;br /&gt;
&lt;br /&gt;
=== Get square of Euclidean distance of closest town (66) ===&lt;br /&gt;
&lt;br /&gt;
The parameter works like for var. 65, but the result is the Euclidean distance of the closest town, squared.&lt;br /&gt;
&lt;br /&gt;
=== Count of industry, distance of closest instance (67, 68) ===&lt;br /&gt;
&lt;br /&gt;
Variable 67 gets two parameters: the GRFID of the GRF where the industry is defined in register 100h (can be written using operator 0E of [[VarAction2Advanced|VarAction2]]) and the setID of the industry as the regular parameter. There are two special cases for the GRFID: 00000000h means you&#039;re checking for a default TTD industry type, while FFFFFFFFh can be used instead of the GRFID of the current GRF.&lt;br /&gt;
&lt;br /&gt;
The return value has the format rrccdddd, where rr is reserved for future use, cc is the number of instances of the industry type and dddd is the Manhattan distance of the closest instance, of FFFFh if not appliable.&lt;br /&gt;
&lt;br /&gt;
You may note that this variable can be used instead of variable 64. This variable is the preferred way to get this information since it allows you to check industries defined in other GRFs as well. Variable 64 will stay for backward compatibility only.&lt;br /&gt;
&lt;br /&gt;
Variable 68 works like variable 67, except that you can put a layout number in the lowest byte of register 101. (The other bits are reserved for future use, leave them zero for now.) This layout number should be 1-based (the first layout is 01, not 00). Only industries with the given layout are considered for counting and calculating distance. As a special case, if the layout number is 00, all layouts are counted, and so the result is the same as with variable 67.&lt;br /&gt;
&lt;br /&gt;
Since OpenTTD r22434, it is possible to filter by the town of the current industry. If the bit number 8 is set, only industries in the same town than the current one will be considered.&lt;br /&gt;
&lt;br /&gt;
=== Cargo info variables (69..6F) ===&lt;br /&gt;
{{ottdp|1.9|no|ottdrev=e66cec8f}}&lt;br /&gt;
&lt;br /&gt;
These variables allow to query information about accepted and produced cargos.&lt;br /&gt;
The variables are independent of the number of cargo types and their order. The 60+x parameter specifies the cargo type as index into the cargo translation table.&lt;br /&gt;
&lt;br /&gt;
=== Industry founder information (A7) ===&lt;br /&gt;
&lt;br /&gt;
This byte contains the ID of the company that funded the industry, or 10h if the industry was generated randomly. If the industry was built using an earlier TTDPatch than 2.0.1 &amp;amp;alpha;74 or with newindustries turned off, this field is 10h.&lt;br /&gt;
&lt;br /&gt;
=== Construction type (B3) ===&lt;br /&gt;
&lt;br /&gt;
This byte tells you how the industry got onto the map. The following values are possible:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||Unknown - This industry was built with newindustries being off, or in a TTDPatch version prior to TTDPatch 2.0.1 alpha 74&lt;br /&gt;
|-&lt;br /&gt;
|1||Created during normal gameplay, either by a player or the in-game random industry generator&lt;br /&gt;
|-&lt;br /&gt;
|2||Created during random map generation&lt;br /&gt;
|-&lt;br /&gt;
|3||Created in the scenario editor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In case 1, you can check variable A7 to find out whether the industry was funded by a player or by the random generator.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=TTDPatchFlags&amp;diff=3820</id>
		<title>TTDPatchFlags</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=TTDPatchFlags&amp;diff=3820"/>
		<updated>2018-11-15T21:53:32Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: it was a different hash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the table below you find all the TTDPatch flags that belong to &amp;lt;param-num&amp;gt; = 85 in Action 7 and Action 9.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;!!&#039;&#039;&#039;Switch (bit set = switch on)&#039;&#039;&#039;!!&#039;&#039;&#039;Correspondence in OpenTTD&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0C||keepsmallairport||station.never_expire_airports&lt;br /&gt;
|-&lt;br /&gt;
|0D||newairports||1&lt;br /&gt;
|-&lt;br /&gt;
|0E||largestations||1&lt;br /&gt;
|-&lt;br /&gt;
|0F||longbridges||construction.longbridges&lt;br /&gt;
|-&lt;br /&gt;
|10||loadtime||0&lt;br /&gt;
|-&lt;br /&gt;
|12||presignals||1&lt;br /&gt;
|-&lt;br /&gt;
|13||extpresignals||1&lt;br /&gt;
|-&lt;br /&gt;
|16||enginespersist||vehicles.never_expire_vehicles&lt;br /&gt;
|-&lt;br /&gt;
|1B||multihead||1&lt;br /&gt;
|-&lt;br /&gt;
|1D||lowmemory||1&lt;br /&gt;
|-&lt;br /&gt;
|1E||generalfixes||1&lt;br /&gt;
|-&lt;br /&gt;
|27||moreairports||economy.station_noise_level&lt;br /&gt;
|-&lt;br /&gt;
|28||mammothtrains||1&lt;br /&gt;
|-&lt;br /&gt;
|29||trainrefit||1&lt;br /&gt;
|-&lt;br /&gt;
|2B||subsidiaries||0&lt;br /&gt;
|-&lt;br /&gt;
|2C||gradualloading||order.gradual_loading&lt;br /&gt;
|-&lt;br /&gt;
|32||(Set to bit 0 of unifiedmaglev mode)||1 (n/a)&lt;br /&gt;
|-&lt;br /&gt;
|33||(Set to bit 1 of unifiedmaglev mode)||1 (n/a)&lt;br /&gt;
|-&lt;br /&gt;
|34||bridgespeedlimits||1&lt;br /&gt;
|-&lt;br /&gt;
|36||eternalgame||1&lt;br /&gt;
|-&lt;br /&gt;
|37||newtrains||1&lt;br /&gt;
|-&lt;br /&gt;
|38||newrvs||1&lt;br /&gt;
|-&lt;br /&gt;
|39||newships||1&lt;br /&gt;
|-&lt;br /&gt;
|3A||newplanes||1&lt;br /&gt;
|-&lt;br /&gt;
|3B||signalsontrafficside||construction.signal_side&lt;br /&gt;
|-&lt;br /&gt;
|3C||electrifiedrailway||vehicle.disable_elrails&lt;br /&gt;
|-&lt;br /&gt;
|41 &amp;lt;ref&amp;gt;loadallgraphics is obsolete (and its bit unused) since revision 401. The next official versions were the 5/Jun/2006 nightly (402) and TTDPatch 2.5 beta 6 (472)&amp;lt;/ref&amp;gt;||loadallgraphics||1&lt;br /&gt;
|-&lt;br /&gt;
|43||semaphores||1&lt;br /&gt;
|-&lt;br /&gt;
|4A||newobjects (since r2364)||1&lt;br /&gt;
|-&lt;br /&gt;
|4B||enhancegui||0&lt;br /&gt;
|-&lt;br /&gt;
|4C||newagerating||0&lt;br /&gt;
|-&lt;br /&gt;
|4D||buildonslopes||construction.build_on_slopes&lt;br /&gt;
|-&lt;br /&gt;
|4E||fullloadany||1&lt;br /&gt;
|-&lt;br /&gt;
|4F||planespeed||1&lt;br /&gt;
|-&lt;br /&gt;
|50 &amp;lt;ref&amp;gt;moreindustriesperclimate is obsolete (and its bit unused) since TTDPatch 2.5 beta 2.&amp;lt;/ref&amp;gt;||moreindustriesperclimate||0&lt;br /&gt;
|-&lt;br /&gt;
|51||moretoylandfeatures||0&lt;br /&gt;
|-&lt;br /&gt;
|52||newstations||1&lt;br /&gt;
|-&lt;br /&gt;
|53||tracktypecostdiff||1&lt;br /&gt;
|-&lt;br /&gt;
|54||manualconvert||1&lt;br /&gt;
|-&lt;br /&gt;
|55||buildoncoasts||construction.build_on_slopes&lt;br /&gt;
|-&lt;br /&gt;
|56||canals||1&lt;br /&gt;
|-&lt;br /&gt;
|57||newstartyear||1&lt;br /&gt;
|-&lt;br /&gt;
|58||freighttrains||vehicle.freight_trains &amp;gt; 1&lt;br /&gt;
|-&lt;br /&gt;
|59||newhouses||1&lt;br /&gt;
|-&lt;br /&gt;
|5A||newbridges||1&lt;br /&gt;
|-&lt;br /&gt;
|5B||newtownnames||1&lt;br /&gt;
|-&lt;br /&gt;
|5C||moreanimation||1&lt;br /&gt;
|-&lt;br /&gt;
|5D||wagonspeedlimits||vehicle.wagon_speed_limits&lt;br /&gt;
|-&lt;br /&gt;
|5E||newshistory||1&lt;br /&gt;
|-&lt;br /&gt;
|5F||custombridgeheads||0&lt;br /&gt;
|-&lt;br /&gt;
|60||newcargodistribution||0&lt;br /&gt;
|-&lt;br /&gt;
|61||windowsnap||1&lt;br /&gt;
|-&lt;br /&gt;
|62||townbuildnoroads||not (economy.allow_town_roads or _generating_world)&lt;br /&gt;
|-&lt;br /&gt;
|63||pathbasedsignalling||1&lt;br /&gt;
|-&lt;br /&gt;
|64||aichoosechances||0&lt;br /&gt;
|-&lt;br /&gt;
|65||resolutionwidth||1&lt;br /&gt;
|-&lt;br /&gt;
|66||resolutionheight||1&lt;br /&gt;
|-&lt;br /&gt;
|67||newindustries||1&lt;br /&gt;
|-&lt;br /&gt;
|68||fifoloading||order.improved_load&lt;br /&gt;
|-&lt;br /&gt;
|69||townroadbranchprob||0&lt;br /&gt;
|-&lt;br /&gt;
|6A||tempsnowline||0&lt;br /&gt;
|-&lt;br /&gt;
|6B||newcargos||1&lt;br /&gt;
|-&lt;br /&gt;
|6C||enhancemultiplayer||1&lt;br /&gt;
|-&lt;br /&gt;
|6D||onewayroads||1&lt;br /&gt;
|-&lt;br /&gt;
|6E||irregularstations||1&lt;br /&gt;
|-&lt;br /&gt;
|6F||morestatistics||1&lt;br /&gt;
|-&lt;br /&gt;
|70||newsounds||1&lt;br /&gt;
|-&lt;br /&gt;
|71||autoreplace||1&lt;br /&gt;
|-&lt;br /&gt;
|72||autoslope||1&lt;br /&gt;
|-&lt;br /&gt;
|73||followvehicle||0&lt;br /&gt;
|-&lt;br /&gt;
|74||trams||1&lt;br /&gt;
|-&lt;br /&gt;
|75||enhancetunnels||0&lt;br /&gt;
|-&lt;br /&gt;
|76||shortrvs||1&lt;br /&gt;
|-&lt;br /&gt;
|77||articulatedrvs||1&lt;br /&gt;
|-&lt;br /&gt;
|78||dynamicengines||{{ottd|0.7|r12924}} vehicle.dynamic_engines&lt;br /&gt;
|-&lt;br /&gt;
|7E||variablerunningcosts (since r1421)||1&lt;br /&gt;
|-&lt;br /&gt;
|7F||set if any switches are on||1&lt;br /&gt;
|-&lt;br /&gt;
|80||-||{{ottd|1.9|g4b0b4e064}} 1 (larger persistent storage)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Bridges&amp;diff=3792</id>
		<title>Action0/Bridges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Bridges&amp;diff=3792"/>
		<updated>2018-08-08T09:22:54Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Defining properties of bridges. By default the following bridges are defined:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;ID (dec)&#039;&#039;&#039;!!&#039;&#039;&#039;ID (hex)&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0||00||Wooden Bridge&lt;br /&gt;
|-&lt;br /&gt;
|1||01||Concrete Bridge&lt;br /&gt;
|-&lt;br /&gt;
|2||02||Girder, Steel Bridge&lt;br /&gt;
|-&lt;br /&gt;
|3||03||Suspension, Concrete Bridge&lt;br /&gt;
|-&lt;br /&gt;
|4||04||Suspension, Steel (Bronze) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|5||05||Suspension, Steel (Golden) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|6||06||Cantilever, Steel (Bronze) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|7||07||Cantilever, Steel (Brown) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|8||08||Cantilever, Steel (Red) Bridg&lt;br /&gt;
|-&lt;br /&gt;
|9||09||Girder, Steel Bridge&lt;br /&gt;
|-&lt;br /&gt;
|10||0A||Tubular, Steel (Bronze) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|11||0B||{{ottdp|0.6|no}} Tubular, Steel (Golden) Bridge&lt;br /&gt;
|-&lt;br /&gt;
|12||0C||{{ottdp|0.6|no}} Tubular, Silicon Bridge&lt;br /&gt;
|}&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;
|00||B||{{ottdp|no|2.6|ttdprev=r1994}}||Failback Type, a default TTD Bridge ID&lt;br /&gt;
|-&lt;br /&gt;
|08&amp;lt;ref&amp;gt;The meaning of prop. 08 has changed in TTDPatch 2.0.1 alpha 34, it used to be what is now prop. 0D.&amp;lt;/ref&amp;gt;||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Year of availability, counted from 1920 (set to 1920 for first bridge if newstartyear&amp;amp;lt;1930)&lt;br /&gt;
|-&lt;br /&gt;
|09||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Minimum length, not counting ramps&lt;br /&gt;
|-&lt;br /&gt;
|0A||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Maximum length, not counting ramps&lt;br /&gt;
|-&lt;br /&gt;
|0B||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Cost factor&lt;br /&gt;
|-&lt;br /&gt;
|0C||W||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Max. speed&lt;br /&gt;
|-&lt;br /&gt;
|0D||V||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Sprite layout, see below&lt;br /&gt;
|-&lt;br /&gt;
|0E||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Various flags, bitcoded&lt;br /&gt;
|-&lt;br /&gt;
|0F||D||{{ottdp|0.6|2.5|ttdprev=r1702|ottdrev=r7191}}||Long format year of availability, counted from year 0&lt;br /&gt;
|-&lt;br /&gt;
|10||W||{{ottdp|0.6|2.5|ttdprev=r1824|ottdrev=r10269}}||Purchase text&lt;br /&gt;
|-&lt;br /&gt;
|11||W||{{ottdp|0.6|2.5|ttdprev=r1824|ottdrev=r10269}}||Description of a rail bridge&lt;br /&gt;
|-&lt;br /&gt;
|12||W||{{ottdp|0.6|2.5|ttdprev=r1824|ottdrev=r10269}}||Description of a road bridge&lt;br /&gt;
|-&lt;br /&gt;
|13||W||{{ottdp|0.7|2.6|ttdprev=r1994|ottdrev=r14172}}||Cost factor word access&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;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 or at all in OpenTTD or TTDPatch: &lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|14||W||New Map Features||Menu icons &amp;lt;ref name=&amp;quot;nmf&amp;quot;&amp;gt;New Map Features (NMF) adds three bridge IDs (0x0D ... 0x0F). There are no graphics. Currently Graphic Resource Management (GRM) must be used to assign real sprites.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Descriptions==&lt;br /&gt;
&lt;br /&gt;
===Sprite layout (0D)===&lt;br /&gt;
&lt;br /&gt;
Property 0D sets the sprite layout for bridges.     Each part of a bridge has eight sprites for each of the four types (rail, road, monorail, maglev), making 32 sprites in total.     Each bridge has 7 parts, though not all of them have different graphics.&lt;br /&gt;
&lt;br /&gt;
The data for property 0D is variable sized, with the format being&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Field!!Description&lt;br /&gt;
|-&lt;br /&gt;
|B||tableid||First table to define sprites for&lt;br /&gt;
|-&lt;br /&gt;
|B||numtables||Number of tables to define sprites for&lt;br /&gt;
|-&lt;br /&gt;
|V||spritedata||spritedata, numtables*32 DWORDs with sprite numbers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The tableid is the number of the first table to change.     There are seven tables for each bridge, with the first six (0-5) being various middle parts and the last one (6) being the end pieces.&lt;br /&gt;
&lt;br /&gt;
In each of the six middle part tables, there are four entries each for the following:&lt;br /&gt;
* Rail X, Rail Y, Road X, Road Y, Monorail X, Monorail Y, Maglev X, Maglev Y&lt;br /&gt;
&lt;br /&gt;
Where X is a bridge in /-direction and Y a bridge in \-direction.&lt;br /&gt;
&lt;br /&gt;
The four entries are&lt;br /&gt;
* Back &amp;amp; Floor, Front, Pillars, 0&lt;br /&gt;
&lt;br /&gt;
Front and Pillars can be 0, meaning no sprite to draw.     The fourth entry is always ignored.&lt;br /&gt;
&lt;br /&gt;
In the end part table, there are again four entries each, but now for Rail flat, Rail ramp, Road flat, Road ramp, Monorail flat, Monorail ramp and Maglev flat, Maglev ramp.&lt;br /&gt;
&lt;br /&gt;
The four entries in this case are&lt;br /&gt;
* northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
&lt;br /&gt;
The sprite numbers can be any of TTD&#039;s sprite numbers.&lt;br /&gt;
&lt;br /&gt;
To summarize, there are 7 tables for each of the 11 bridges.     Each table contains 4*8 entries, making it 128 (80h) bytes large.     The first six tables, number 0 to 5, are middle pieces, the last table, number 6, is the end pieces.&lt;br /&gt;
&lt;br /&gt;
====Colour Translations====&lt;br /&gt;
&lt;br /&gt;
In order to recolour a bridge, you can add one of the values from the table below to the sprite number of the sprite you wish to recolour. The colour translations from the table will use the default colour translation tables from the base sets. These translation tables will translate the &#039;brownish red&#039; as used in the default bridges to the colour you specify.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Added value&#039;&#039;&#039;!!&#039;&#039;&#039;Little Endian&#039;&#039;&#039;!!&#039;&#039;&#039;Colour&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|031B8000h||00 80 1B 03||Blue&lt;br /&gt;
|-&lt;br /&gt;
|031C8000h||00 80 1C 03||Brown&lt;br /&gt;
|-&lt;br /&gt;
|031D8000h||00 80 1D 03||Pure white&lt;br /&gt;
|-&lt;br /&gt;
|031E8000h||00 80 1E 03||Red&lt;br /&gt;
|-&lt;br /&gt;
|031F8000h||00 80 1F 03||Green&lt;br /&gt;
|-&lt;br /&gt;
|03208000h||00 80 20 03||Blueish white (concrete)&lt;br /&gt;
|-&lt;br /&gt;
|03218000h||00 80 21 03||Yellow (golden steel)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take a look at the [[RecolorSprites#Default_recolour_sprites | default recolour tables]] for other colour translations. However, other recolor maps than the seven listed above will translate other colours than those uses by original bridges.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example: Translate sprite 4366 to yellow&#039;&#039;&lt;br /&gt;
:4366 translates to 0E 11 in little endian value and as such to 0E 11 00 00 in a dword. In order to convert to yellow you&#039;ll have to add 00 80 21 03 to the dword value. This yields 0E 91 21 03. Use the latter in your bridge table to colour one of the monorail bridgeheads grey.&lt;br /&gt;
&lt;br /&gt;
====Bridge Layouts====&lt;br /&gt;
&lt;br /&gt;
There are five possible bridge layouts in TTD. The numbers in the table below reflect the bridge table numbers in the NFO code.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Layout!!Description&lt;br /&gt;
|-&lt;br /&gt;
|__ ||Bridge without middle part&lt;br /&gt;
|-&lt;br /&gt;
|_0_||Bridge of length 3&lt;br /&gt;
|-&lt;br /&gt;
|_0(23)1_||Bridge of even length&lt;br /&gt;
|-&lt;br /&gt;
|_0(23)4(23)1_||Bridge of (uneven) lengths 5, 9, 13, 17 etc.&lt;br /&gt;
|-&lt;br /&gt;
|_0(23)253(23)1_||Bridge of (uneven) lengths 7, 11, 15, 19 etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
_ is used as a symbol to indicate bridgeheads (as defined in table 6).&lt;br /&gt;
&lt;br /&gt;
Part 0 is always at the farthest end from the viewer.&lt;br /&gt;
&lt;br /&gt;
Parts (23) are repeated &#039;&#039;n&#039;&#039; times as necessary, where &#039;&#039;n&#039;&#039; is any number equal or greater than 0.&lt;br /&gt;
&lt;br /&gt;
===Flags (0E)===&lt;br /&gt;
&lt;br /&gt;
The following flags can be set here:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Bit&#039;&#039;&#039;!!&#039;&#039;&#039;Value&#039;&#039;&#039;!!&#039;&#039;&#039;Meaning&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Do not draw the far pillars for higher bridges&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Long format year of availability (0F)===&lt;br /&gt;
&lt;br /&gt;
Set the year of availability of the bridge in years since 0. The date range is from 0 to 5000000. This property must be set after property 08 to take effect.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no||}} In TTDPatch, bridge introduction dates outside the range 1920..2175 will be limited to this range.&lt;br /&gt;
&lt;br /&gt;
===Purchase text (10)===&lt;br /&gt;
&lt;br /&gt;
Set the text appearing in the purchase window, describing what this bridge is made of, or what kind of bridge it is.&lt;br /&gt;
&lt;br /&gt;
This should be the ID of an original bridge name, or a TextID in the DCxx range.&lt;br /&gt;
&lt;br /&gt;
===Description of a rail(11) or road(12) bridge===&lt;br /&gt;
&lt;br /&gt;
Set the text used as a description by the query tool. When the bridge is used for carrying a rail, it will use property 11, and will use property 12 when it will be for road.&lt;br /&gt;
&lt;br /&gt;
This should be the ID of an original bridge name, or a TextID in the DCxx range.&lt;br /&gt;
&lt;br /&gt;
===Menu icons (14)===&lt;br /&gt;
&lt;br /&gt;
Previously menu icons could be replaced by an ActionA, with the exception of the six recolor bridges which always retained a recolored icon of one of the three parent bridges.&lt;br /&gt;
Property 14 allows all icons to be accessed including the three new bridge IDs in cirdan&#039;s New Map Features.&lt;br /&gt;
&lt;br /&gt;
Note: Currently this property is only supported by New Map Features.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
Below is an example code which rebuilds the bronze steel suspension bridge (ID 04). The code fragment by itself has no use (no visual difference in game), but might be useful in order to understand the bridge code. Sprite numbers refer to the numbers in the base grf. The code might also be useful to re-enstate the default bridge if you only want to replace only one certain tracktype.&lt;br /&gt;
&lt;br /&gt;
The complete recode of all default bridges including colour translations is available at TT-Forums: http://www.tt-forums.net/viewtopic.php?p=715362#p715362&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;//SUSPENSION, STEEL (BRONZE) bridge (04)&lt;br /&gt;
&lt;br /&gt;
-1 * 0 00 06 01 01 04 0D 00 07 //action 00 bridges, 01 property, 01 ID, ID, prop 0D, tableID 00, 07 tables&lt;br /&gt;
&lt;br /&gt;
//table 00&lt;br /&gt;
&lt;br /&gt;
A9 09 00 00     9F 09 00 00     B1 09 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A5 09 00 00     97 09 00 00     AD 09 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
9D 09 00 00     9F 09 00 00     B1 09 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
95 09 00 00     97 09 00 00     AD 09 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F2 10 00 00     9F 09 00 00     B1 09 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
EE 10 00 00     97 09 00 00     AD 09 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1A 11 00 00     9F 09 00 00     B1 09 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
16 11 00 00     97 09 00 00     AD 09 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 01&lt;br /&gt;
AA 09 00 00     A0 09 00 00     B2 09 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A6 09 00 00     98 09 00 00     AE 09 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
9E 09 00 00     A0 09 00 00     B2 09 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
96 09 00 00     98 09 00 00     AE 09 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F3 10 00 00     A0 09 00 00     B2 09 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
EF 10 00 00     98 09 00 00     AE 09 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1B 11 00 00     A0 09 00 00     B2 09 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
17 11 00 00     98 09 00 00     AE 09 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 02&lt;br /&gt;
AC 09 00 00     A4 09 00 00     B4 09 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A8 09 00 00     9C 09 00 00     B0 09 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A2 09 00 00     A4 09 00 00     B4 09 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
9A 09 00 00     9C 09 00 00     B0 09 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F5 10 00 00     A4 09 00 00     B4 09 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F1 10 00 00     9C 09 00 00     B0 09 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1D 11 00 00     A4 09 00 00     B4 09 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
19 11 00 00     9C 09 00 00     B0 09 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 03&lt;br /&gt;
AB 09 00 00     A3 09 00 00     B3 09 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A7 09 00 00     9B 09 00 00     AF 09 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
A1 09 00 00     A3 09 00 00     B3 09 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
99 09 00 00     9B 09 00 00     AF 09 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F4 10 00 00     A3 09 00 00     B3 09 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F0 10 00 00     9B 09 00 00     AF 09 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1C 11 00 00     A3 09 00 00     B3 09 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
18 11 00 00     9B 09 00 00     AF 09 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 04&lt;br /&gt;
B6 09 00 00     BA 09 00 00     BC 09 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
B5 09 00 00     B9 09 00 00     BB 09 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
B8 09 00 00     BA 09 00 00     BC 09 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
B7 09 00 00     B9 09 00 00     BB 09 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F7 10 00 00     BA 09 00 00     BC 09 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F6 10 00 00     B9 09 00 00     BB 09 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1F 11 00 00     BA 09 00 00     BC 09 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
1E 11 00 00     B9 09 00 00     BB 09 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 05&lt;br /&gt;
BD 09 00 00     C1 09 00 00     00 00 00 00     00 00 00 00 //rail X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
BE 09 00 00     C2 09 00 00     00 00 00 00     00 00 00 00 //rail Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
BF 09 00 00     C1 09 00 00     00 00 00 00     00 00 00 00 //Road X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
C0 09 00 00     C2 09 00 00     00 00 00 00     00 00 00 00 //Road Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F8 10 00 00     C1 09 00 00     00 00 00 00     00 00 00 00 //Mono X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
F9 10 00 00     C2 09 00 00     00 00 00 00     00 00 00 00 //Mono Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
20 11 00 00     C1 09 00 00     00 00 00 00     00 00 00 00 //Mlev X: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
21 11 00 00     C2 09 00 00     00 00 00 00     00 00 00 00 //Mlev Y: Back&amp;amp;amp;Floor, Front, Pillars, 0&lt;br /&gt;
//table 06&lt;br /&gt;
86 09 00 00     88 09 00 00     85 09 00 00     87 09 00 00 //rail flat: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
8A 09 00 00     8C 09 00 00     89 09 00 00     8B 09 00 00 //rail ramp: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
8E 09 00 00     90 09 00 00     8D 09 00 00     8F 09 00 00 //road flat: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
92 09 00 00     94 09 00 00     91 09 00 00     93 09 00 00 //road ramp: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
E7 10 00 00     E9 10 00 00     E6 10 00 00     E8 10 00 00 //mono flat: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
EB 10 00 00     ED 10 00 00     EA 10 00 00     EC 10 00 00 //mono ramp: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
0F 11 00 00     11 11 00 00     0E 11 00 00     10 11 00 00 //mlev flat: northern end X, northern end Y, southern end X, southern end Y&lt;br /&gt;
13 11 00 00     15 11 00 00     12 11 00 00     14 11 00 00 //mlev ramp: northern end X, northern end Y, southern end X, southern end Y&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Stations&amp;diff=3791</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=3791"/>
		<updated>2018-08-08T09:16:30Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Properties */&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||{{ottdp|0.6|2.5|ttdprev=alpha 20}}||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||{{ottdp|0.6|2.5|ttdprev=alpha 22}}||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;
|19||V||{{ottdp}}||Road routing (reserved for future use)&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;
&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;
When a WAYP 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 WAYP 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;
=== 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&lt;br /&gt;
&lt;br /&gt;
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;
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;
=== 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;
=== 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;
=== 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 the station size (to simulate cargo distributed over the area of the station)&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;
&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;
=== 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;
!Bit!!Value!!Version!!Meaning!!Happens on!!Var 18&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||&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||&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;
&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;
=== Road routing (19 - reserved for future use) ===&lt;br /&gt;
&lt;br /&gt;
Will allow to have routing informations for road vehicles on rail stations,&lt;br /&gt;
&lt;br /&gt;
generally you need to deny rail vehicle traveling via prop 15&lt;br /&gt;
&lt;br /&gt;
This property is not yet implemented {{ottd|no}}{{ttdp|no}}.&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 [http://wiki.openttd.org/Frosch/Advanced_Sprite_Layout#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 the developmental &amp;quot;New Map Features&amp;quot; (NMF) fork of OpenTTD.&lt;br /&gt;
&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>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3720</id>
		<title>Language IDs</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3720"/>
		<updated>2016-04-07T16:27:32Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: Link to plural forms. That column is NOT the number of plurals&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Currently, the scheme is to use international phone codes as language IDs, unless they&#039;re out of range. When creating a new translation for OpenTTD pick a number vaguely related in some way. Or something else. &lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of [[StringCodes#Using_plural_forms|plural form]] is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! [[StringCodes#Using_plural_forms|plural form]]&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 66&lt;br /&gt;
| Latin&lt;br /&gt;
| gen acc abl dat&lt;br /&gt;
| m f n mp fp np&lt;br /&gt;
|&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3691</id>
		<title>NML:Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3691"/>
		<updated>2015-08-26T10:52:06Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Industry properties */ elaborate more on &amp;#039;prob_random&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on industry properties, variables and callbacks. [[NML:IndustryTiles|Industry tiles]] are closely related.&lt;br /&gt;
&lt;br /&gt;
== Industry ID allocation ==&lt;br /&gt;
Industry IDs are local to the NewGRF, you are free to choose any ID in the 0..127-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new industry. The value of this property should be the ID of a [[IndustryDefaultProps|default industry]], 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 to be replaced with your item. You should use this if you are for example defining a coal mine which changes production more dynamically. If your type is not a direct replacement of an existing item, don&#039;t set this property.&lt;br /&gt;
&lt;br /&gt;
==Industry properties==&lt;br /&gt;
&lt;br /&gt;
Industry properties. Default industry type numbers can be found at [[NML:Default industries|default industries]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). &#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 industry.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| Array of tilelayouts&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Tilelayout|Tilelayout]] syntax.&lt;br /&gt;
|-&lt;br /&gt;
| life_type&lt;br /&gt;
| One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; EXTRACTIVE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ORGANIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; PROCESSING&lt;br /&gt;
| The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.&lt;br /&gt;
|-&lt;br /&gt;
| closure_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when the industry announces closure. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_increase_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry increases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_decrease_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry decreases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| fund_cost_multiplier&lt;br /&gt;
| 0..255&lt;br /&gt;
| Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)&lt;br /&gt;
|-&lt;br /&gt;
| min_cargo_distr&lt;br /&gt;
| 0..255&lt;br /&gt;
| Minimal amount of cargo before transporting to stations.&lt;br /&gt;
|-&lt;br /&gt;
| random_sound_effects&lt;br /&gt;
| array of ints&lt;br /&gt;
| Sound effect numbers that are played some times.&lt;br /&gt;
|-&lt;br /&gt;
| conflicting_ind_types&lt;br /&gt;
| array of up to 3x industry_type(IND_TYPE_OLD &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; IND_TYPE_NEW, id)&lt;br /&gt;
|&lt;br /&gt;
Three industry types that should not be nearby. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;industry_type(..)&amp;lt;/code&amp;gt; to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).&lt;br /&gt;
|-&lt;br /&gt;
| prob_random&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while generating initial industries. If the random game probability value is nonzero, at least one instance of this type is guaranteed to appear on the map.&lt;br /&gt;
|-&lt;br /&gt;
| prob_in_game&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while creating industries during the game.&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour index from the [[NML:Graphic files|DOS palette]] to use on the minimap for this industry.&lt;br /&gt;
|-&lt;br /&gt;
| spec_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
for flag values see [[#industry_special_flags|Industry special flags]]&lt;br /&gt;
|-&lt;br /&gt;
| new_ind_msg&lt;br /&gt;
| string&lt;br /&gt;
| Message displayed when industry gets built during game play.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_1&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the first accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the second accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the third accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Name of the industry, use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prospect_chance&lt;br /&gt;
| 0 .. 1 (float)&lt;br /&gt;
| Chance of successful prospecting.&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| remove_cost_multiplier&lt;br /&gt;
| int&lt;br /&gt;
| Cost multiplier for removing the industry (currently only possible with magic bulldozer).&lt;br /&gt;
|-&lt;br /&gt;
| nearby_station_name&lt;br /&gt;
| string&lt;br /&gt;
| Default additional name for a nearby station&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Industry special flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! flag&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_PERIODICALLY&lt;br /&gt;
| The industry periodically plants fields around itself (temperate and arctic farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CUT_TREES&lt;br /&gt;
| The industry cuts trees around itself and produces its first output cargo from them (lumber mill)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ON_WATER&lt;br /&gt;
| The industry is built on water (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_LARGE_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_NEAR_TOWN&lt;br /&gt;
| The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_WHEN_BUILT&lt;br /&gt;
| Fields are planted around the industry when it&#039;s built (all farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_NO_PRODUCTION_INCREASE&lt;br /&gt;
| The industry cannot increase its production on the temperate climate (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_BEFORE_1950&lt;br /&gt;
| The industry is built only before 1950 (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_AFTER_1960&lt;br /&gt;
| The industry is built only after 1960 (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES&lt;br /&gt;
| AI players will attempt to establish air and ship routes going to this industry (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military airplane (oil refinery)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military helicopter (factory)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CAN_CAUSE_SUBSIDENCE&lt;br /&gt;
| The industry can cause a subsidence (coal mine)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER&lt;br /&gt;
| Automatic production multiplier handing (No industry has this bit set by default.).&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK&lt;br /&gt;
| The production callback needs random bits in var. 10 (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION&lt;br /&gt;
| Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE&lt;br /&gt;
| Allow closing down the last instance of this type (No industry has this bit set by default.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:IndustryCommonVariables}}&lt;br /&gt;
&lt;br /&gt;
==Industry variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| production_level&lt;br /&gt;
| 0, or 4 .. 128&lt;br /&gt;
| Current production level of the industry. Usually in range 4 .. 128, default starting level is 16. A level of 0 indicates imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the first cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the second cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_3&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the third cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 1&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 2&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_1&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 1&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_2&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 2&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_1&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 1&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_2&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 2&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| water_distance&lt;br /&gt;
| Distance to the tile&lt;br /&gt;
| If the industry is built on water, this variable gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile.&lt;br /&gt;
|-&lt;br /&gt;
| layout_num&lt;br /&gt;
| 1..255&lt;br /&gt;
| Number of the layout being used by the industry.&lt;br /&gt;
|-&lt;br /&gt;
| founder&lt;br /&gt;
| 0..16&lt;br /&gt;
| Company number of the industry founder. It will be FOUNDER_GAME (=16) if the industry was generated randomly. TTDPatch only supports up to 8 companies (0..7).&lt;br /&gt;
|-&lt;br /&gt;
| founder_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| founder_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s first colour. 0 if not founded by a company. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| founder_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s second colour. It&#039;s the same as company_colour1, if no second company colour is chosen. 0 if not founded by a company. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Random colour for this industry. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0..1826212865&lt;br /&gt;
| Date of the industry foundation in days since year 0.&lt;br /&gt;
|-&lt;br /&gt;
| build_type&lt;br /&gt;
| BUILDTYPE_XX&lt;br /&gt;
| BUILDTYPE_UNKNOWN (if created in an old version or with newindustries disabled), BUILDTYPE_GAMEPLAY (if founded or created by the in-game random industry generator), BUILDTYPE_GENERATION (if created during random map generation) or BUILDTYPE_EDITOR (if created with the scenario editor).&lt;br /&gt;
|-&lt;br /&gt;
| counter&lt;br /&gt;
| 0..65535&lt;br /&gt;
| Decremented every tick, used to time primary industry production in TTD.&lt;br /&gt;
|-&lt;br /&gt;
| last_accept_date&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| Date when cargo was accepted for the last time. Not valid before 1920 and after 2090.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| Random data that can be used to randomize certain descisions. (see [[NML:Random_switch|Random switch]]) (NML r1666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Variables that require some parameters.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| industry_count&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
|&lt;br /&gt;
The value of this variable is the number of industries of a given type that are currently on the map. industry_type is either the ID of an industry. GRFid is the grf in which the industry was defined. The default value is -1, which means current newgrf. A grfid of 0 lets you check the number of default industries of a given type. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert a grfid to its numeric representation.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_distance&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
| The value of this variable is the manhattan distance the closest instance of the given industry or 0xFFFF if not applicable. See industry_count for a description of the parameters.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_layout_count / industry_layout_distance&lt;br /&gt;
| industry_type, layout, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the given layout number.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_town_count&lt;br /&gt;
| industry_type, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the same town than the current industry.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the Manhattan distance (dx + dy) from the selected tile to the closest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the squared Eucleidean distance (dx^2 + dy^2) from the selected tile to the closest town.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| x, y&lt;br /&gt;
|&lt;br /&gt;
Parameters indicate a signed offset relative to the northern tile. Returns the [[NML:List of town zones|town zone]] that the selected tile is in.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate an unsigned offset relative to the northern tile. Returns the random bits of the selected industry tile, or 0 if it is not an industry tile that&#039;s part of this industry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| varies&lt;br /&gt;
| Any unhandled callbacks. Generally this doesn&#039;t need to be used, except for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| produce_cargo_arrival&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo every 256 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| CB_RESULT_IND_ALLOW or CB_RESULT_IND_DISALLOW&lt;br /&gt;
|&lt;br /&gt;
{{nml|0.2}} Only available in NML 0.2 or earlier. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]].&lt;br /&gt;
|-&lt;br /&gt;
| construction_probability&lt;br /&gt;
| CB_RESULT_IND_NO_CONSTRUCTION, CB_RESULT_IND_PROBABILITY_FROM_PROPERTY or a relative probability 0..255&lt;br /&gt;
|&lt;br /&gt;
{{nml|0.3}}. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables.&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 creation types|creation type]].&lt;br /&gt;
If you return CB_RESULT_IND_NO_CONSTRUCTION or 0 the industry won&#039;t be build. If you return CB_RESULT_IND_PROBABILITY_FROM_PROPERTY it&#039;ll be build according to the relative probability as defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_random&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_in_game&amp;lt;/code&amp;gt; properties, otherwise it&#039;ll use the value as returned as relative probability.&lt;br /&gt;
|-&lt;br /&gt;
| location_check&lt;br /&gt;
|&lt;br /&gt;
See the [[#Location check results|table]] below.&lt;br /&gt;
|&lt;br /&gt;
Called to check if a location is suitable.&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 creation types|creation type]].&lt;br /&gt;
Since the industry isn&#039;t built yet, industry variables aren&#039;t available. If this callback is not implemented or fails, constructing the industry will be allowed. Construction might also be prevented via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; industry tile callback, though.&lt;br /&gt;
|-&lt;br /&gt;
| monthly_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Called each month to (possibly) change the industry production.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;: 32 random bits.&lt;br /&gt;
|-&lt;br /&gt;
| random_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Works exactly the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;monthly_prod_change&amp;lt;/code&amp;gt;, except that it&#039;s only called when TTD selects this industry for a random production change.&lt;br /&gt;
|-&lt;br /&gt;
| build_prod_change&lt;br /&gt;
| Value in range 4-128&lt;br /&gt;
| {{ottd|1.3|r24186}} Called when an industry is constructed.  Return value is production level (default 16).  Can also be used to initialise permanent storage when an industry is constructed.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_display&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning CB_RESULT_NO_TEXT displays nothing.&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;: 0 .. 2 to get texts for the first .. third accepted cargo type, and 3 .. 4 for the first ... second produced cargo type.&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;: 0 when getting a string for the buy menu (no industry variables available!), 1 when for the industry window and 2 for the industry directory window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_industry&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the industry window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_fund&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the fund window. Since the industry isn&#039;t built, no industry variables are available.&lt;br /&gt;
|-&lt;br /&gt;
| control_special&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called to control various effects from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spec_flags&amp;lt;/code&amp;gt; property. Currently only works for the first two (plant fields / cut trees). Return 1 to execute the action or 0 to not do so.&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.&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;: Queried effect.&lt;br /&gt;
The default (if the flag is enabled, of course) is to plant fields with 1/8th chance every 256 ticks, and to cut trees every 512 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| stop_accept_cargo&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| With this callback, you can temporarily refuse accepting a certain cargo, for example because the stockpile is full. Return 1 to accept or 0 to refuse. Make sure to synchronize this callback with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_amount_accept&amp;lt;/code&amp;gt; callback for industry tiles.&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 cargo type to accept or not.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Called after constructing the industry. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour&amp;lt;/code&amp;gt; variable is set to a random value at this point, you can use this callback to change this.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_input&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Decide the input cargo types. Called repeatedly until 0xFF is returned, although currently not more than three times. Do not rely on this limitation, though.&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;: Starts at 0 and is incremented for every iteration.&lt;br /&gt;
Return a cargo type (from the table) or 0xFF to stop.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_output&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_input&amp;lt;/code&amp;gt; above, except that it is applied to the output cargo types and currently not called more than twice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:LocationCheckResults}}&lt;br /&gt;
&lt;br /&gt;
===Production change callback results===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_NO_CHANGE&lt;br /&gt;
| Do not change industry production&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_HALF&lt;br /&gt;
| Half industry production. If production goes below a quarter of default, the industry closes.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DOUBLE&lt;br /&gt;
| Double production if it&#039;s not 8x default yet.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_CLOSE&lt;br /&gt;
| Announce closure and remove the industry next month.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_RANDOM&lt;br /&gt;
| Do a random production change, as if the industry is a primary one.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_4&lt;br /&gt;
| Divide production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_8&lt;br /&gt;
| Divide production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_16&lt;br /&gt;
| Divide production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_32&lt;br /&gt;
| Divide production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_4&lt;br /&gt;
| Multiply production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_8&lt;br /&gt;
| Multiply production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_16&lt;br /&gt;
| Multiply production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_32&lt;br /&gt;
| Multiply production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DECREMENT_BY_1&lt;br /&gt;
| Decrement production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_INCREMENT_BY_1&lt;br /&gt;
| Increment production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_SET_BY_0x100&lt;br /&gt;
| Set the production level to the value in bits 16 .. 23 of register 0x100.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting bit 7 of the result disables the associated news message.&amp;lt;br /&amp;gt; Setting bit 8 replaces the news message with a custom message, read from register 0x100 bits 0 .. 15.&lt;br /&gt;
&lt;br /&gt;
===Industry creation types===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_GENERATION&lt;br /&gt;
| Industry is created during map generation, or when building &#039;many random industries&#039; in the scenario editor.&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_RANDOM&lt;br /&gt;
| Industry is randomly generated during gameplay&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_FUND&lt;br /&gt;
| Industry is funded by the player (in game or scenario editor)&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_PROSPECT&lt;br /&gt;
| Industry is prospected by the player&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3682</id>
		<title>NML:Industries</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=3682"/>
		<updated>2015-07-08T08:57:14Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Industry callbacks */ Use version template for minimum OpenTTD version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
This page contains information on industry properties, variables and callbacks. [[NML:IndustryTiles|Industry tiles]] are closely related.&lt;br /&gt;
&lt;br /&gt;
== Industry ID allocation ==&lt;br /&gt;
Industry IDs are local to the NewGRF, you are free to choose any ID in the 0..127-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new industry. The value of this property should be the ID of a [[IndustryDefaultProps|default industry]], 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 to be replaced with your item. You should use this if you are for example defining a coal mine which changes production more dynamically. If your type is not a direct replacement of an existing item, don&#039;t set this property.&lt;br /&gt;
&lt;br /&gt;
==Industry properties==&lt;br /&gt;
&lt;br /&gt;
Industry properties. Default industry type numbers can be found at [[NML:Default industries|default industries]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type that replaces this one, should it not be available for some reason (e.g. missing NewGRF). &#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 industry.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| industry type&lt;br /&gt;
| Number of the original industry type overridden. This will cause other grfs / industries to consider your industry type the same as the old type. Only set this property if your type is (more or less) the same as the old type.&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| Array of tilelayouts&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Tilelayout|Tilelayout]] syntax.&lt;br /&gt;
|-&lt;br /&gt;
| life_type&lt;br /&gt;
| One of IND_LIFE_TYPE_XXX, XXX = BLACK_HOLE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; EXTRACTIVE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ORGANIC &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; PROCESSING&lt;br /&gt;
| The generic type of industry. This determines the production changes that occur by default (when not using the callback). Examples are respectively power plants, coal mines, forests en steel mills.&lt;br /&gt;
|-&lt;br /&gt;
| closure_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when the industry announces closure. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_increase_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry increases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prod_decrease_msg&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Message displayed when industry decreases production. Use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| fund_cost_multiplier&lt;br /&gt;
| 0..255&lt;br /&gt;
| Fund cost multiplier. Note that in OpenTTD the unmodified base cost is 8x higher for building (not prospecting) raw (=extractive / organic, see life_type) industries.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| Amount of each output cargo to produce every 256 ticks (8 or 9 times a month)&lt;br /&gt;
|-&lt;br /&gt;
| min_cargo_distr&lt;br /&gt;
| 0..255&lt;br /&gt;
| Minimal amount of cargo before transporting to stations.&lt;br /&gt;
|-&lt;br /&gt;
| random_sound_effects&lt;br /&gt;
| array of ints&lt;br /&gt;
| Sound effect numbers that are played some times.&lt;br /&gt;
|-&lt;br /&gt;
| conflicting_ind_types&lt;br /&gt;
| array of up to 3x industry_type(IND_TYPE_OLD &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; IND_TYPE_NEW, id)&lt;br /&gt;
|&lt;br /&gt;
Three industry types that should not be nearby. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;industry_type(..)&amp;lt;/code&amp;gt; to define either an old industry (using the global ID) or a new industry from your grf (using the grf-local ID).&lt;br /&gt;
|-&lt;br /&gt;
| prob_random&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while generating initial industries.&lt;br /&gt;
|-&lt;br /&gt;
| prob_in_game&lt;br /&gt;
| 0..255&lt;br /&gt;
| Probability of occurring while creating industries during the game.&lt;br /&gt;
|-&lt;br /&gt;
| map_colour&lt;br /&gt;
| 0..255&lt;br /&gt;
|&lt;br /&gt;
Colour index from the [[NML:Graphic files|DOS palette]] to use on the minimap for this industry.&lt;br /&gt;
|-&lt;br /&gt;
| spec_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
for flag values see [[#industry_special_flags|Industry special flags]]&lt;br /&gt;
|-&lt;br /&gt;
| new_ind_msg&lt;br /&gt;
| string&lt;br /&gt;
| Message displayed when industry gets built during game play.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_1&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the first accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the second accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| Output cargo multiplication factors for getting a unit of the third accepted cargo.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
Name of the industry, use a custom string or one of the [[NML:Default TTD strings|default TTD strings]].&lt;br /&gt;
|-&lt;br /&gt;
| prospect_chance&lt;br /&gt;
| 0 .. 1 (float)&lt;br /&gt;
| Chance of successful prospecting.&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(flags)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| remove_cost_multiplier&lt;br /&gt;
| int&lt;br /&gt;
| Cost multiplier for removing the industry (currently only possible with magic bulldozer).&lt;br /&gt;
|-&lt;br /&gt;
| nearby_station_name&lt;br /&gt;
| string&lt;br /&gt;
| Default additional name for a nearby station&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Industry special flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! flag&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_PERIODICALLY&lt;br /&gt;
| The industry periodically plants fields around itself (temperate and arctic farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CUT_TREES&lt;br /&gt;
| The industry cuts trees around itself and produces its first output cargo from them (lumber mill)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ON_WATER&lt;br /&gt;
| The industry is built on water (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_LARGE_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) with population larger than 1200 (temperate bank)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ONLY_IN_TOWNS&lt;br /&gt;
| The industry can only be built in towns (i.e. it has to replace houses) (arctic and tropic banks, water tower)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_NEAR_TOWN&lt;br /&gt;
| The industry is always built near towns (i.e. near town sign; additionally the industry is allowed to replace houses) (toy shop)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_PLANT_FIELDS_WHEN_BUILT&lt;br /&gt;
| Fields are planted around the industry when it&#039;s built (all farms)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_NO_PRODUCTION_INCREASE&lt;br /&gt;
| The industry cannot increase its production on the temperate climate (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_BEFORE_1950&lt;br /&gt;
| The industry is built only before 1950 (oil wells)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_BUILT_ONLY_AFTER_1960&lt;br /&gt;
| The industry is built only after 1960 (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AI_CREATES_AIR_AND_SHIP_ROUTES&lt;br /&gt;
| AI players will attempt to establish air and ship routes going to this industry (oil rig)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_AIRPLANE_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military airplane (oil refinery)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_MILITARY_HELICOPTER_CAN_EXPLODE&lt;br /&gt;
| The industry can be exploded by a military helicopter (factory)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_CAN_CAUSE_SUBSIDENCE&lt;br /&gt;
| The industry can cause a subsidence (coal mine)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_AUTOMATIC_PRODUCTION_MULTIPLIER&lt;br /&gt;
| Automatic production multiplier handing (No industry has this bit set by default.).&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_RANDOM_BITS_IN_PRODUCTION_CALLBACK&lt;br /&gt;
| The production callback needs random bits in var. 10 (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION&lt;br /&gt;
| Do not force one instance of this type to appear during initial map generation (No industry has this bit set by default.)&lt;br /&gt;
|-&lt;br /&gt;
| IND_FLAG_ALLOW_CLOSING_LAST_INSTANCE&lt;br /&gt;
| Allow closing down the last instance of this type (No industry has this bit set by default.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:IndustryCommonVariables}}&lt;br /&gt;
&lt;br /&gt;
==Industry variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| production_level&lt;br /&gt;
| 0, or 4 .. 128&lt;br /&gt;
| Current production level of the industry. Usually in range 4 .. 128, default starting level is 16. A level of 0 indicates imminent closure.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the first cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the second cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| waiting_cargo_3&lt;br /&gt;
| 0..65535&lt;br /&gt;
| If any of the production callbacks is enabled, this variable will contain the amount of the third cargo type awaiting to be processed.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 1&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of produced &#039;output cargo type 2&#039; that this waiting to be transported.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced this month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| produced_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_this_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was transported this month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_1&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 1&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_2&lt;br /&gt;
| 0..65535&lt;br /&gt;
| The amount of &#039;output cargo type 2&#039; that was produced last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_1&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 1&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct_2&lt;br /&gt;
| 0..100&lt;br /&gt;
| Percentage of produced &#039;output cargo type 2&#039; that was transported last month.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_1&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 1&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| production_rate_2&lt;br /&gt;
| 0..255&lt;br /&gt;
| {{nml|0.3}} Amount of &#039;output cargo type 2&#039; that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;prod_multiplier&amp;lt;/code&amp;gt;-property, but it will change accordingly when the production level changes.&lt;br /&gt;
|-&lt;br /&gt;
| water_distance&lt;br /&gt;
| Distance to the tile&lt;br /&gt;
| If the industry is built on water, this variable gives the distance of the closest dry land tile, otherwise it gives the distance of the closest water tile.&lt;br /&gt;
|-&lt;br /&gt;
| layout_num&lt;br /&gt;
| 1..255&lt;br /&gt;
| Number of the layout being used by the industry.&lt;br /&gt;
|-&lt;br /&gt;
| founder&lt;br /&gt;
| 0..16&lt;br /&gt;
| Company number of the industry founder. It will be FOUNDER_GAME (=16) if the industry was generated randomly. TTDPatch only supports up to 8 companies (0..7).&lt;br /&gt;
|-&lt;br /&gt;
| founder_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| PLAYERTYPE_HUMAN, PLAYERTYPE_AI, PLAYERTYPE_HUMAN_IN_AI (human managing AI company) or PLAYERTYPE_AI_IN_HUMAN (AI managing human company). OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| founder_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s first colour. 0 if not founded by a company. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| founder_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Index of founding company&#039;s second colour. It&#039;s the same as company_colour1, if no second company colour is chosen. 0 if not founded by a company. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Random colour for this industry. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| 0..1826212865&lt;br /&gt;
| Date of the industry foundation in days since year 0.&lt;br /&gt;
|-&lt;br /&gt;
| build_type&lt;br /&gt;
| BUILDTYPE_XX&lt;br /&gt;
| BUILDTYPE_UNKNOWN (if created in an old version or with newindustries disabled), BUILDTYPE_GAMEPLAY (if founded or created by the in-game random industry generator), BUILDTYPE_GENERATION (if created during random map generation) or BUILDTYPE_EDITOR (if created with the scenario editor).&lt;br /&gt;
|-&lt;br /&gt;
| counter&lt;br /&gt;
| 0..65535&lt;br /&gt;
| Decremented every tick, used to time primary industry production in TTD.&lt;br /&gt;
|-&lt;br /&gt;
| last_accept_date&lt;br /&gt;
| date(year, month, day)&lt;br /&gt;
| Date when cargo was accepted for the last time. Not valid before 1920 and after 2090.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0 ... 65535&lt;br /&gt;
| Random data that can be used to randomize certain descisions. (see [[NML:Random_switch|Random switch]]) (NML r1666)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Variables that require some parameters.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| industry_count&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
|&lt;br /&gt;
The value of this variable is the number of industries of a given type that are currently on the map. industry_type is either the ID of an industry. GRFid is the grf in which the industry was defined. The default value is -1, which means current newgrf. A grfid of 0 lets you check the number of default industries of a given type. Use the [[NML:Builtin functions|builtin function]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;str2number()&amp;lt;/code&amp;gt; to convert a grfid to its numeric representation.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_distance&lt;br /&gt;
| industry_type, grfid = -1&lt;br /&gt;
| The value of this variable is the manhattan distance the closest instance of the given industry or 0xFFFF if not applicable. See industry_count for a description of the parameters.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage register 0x100.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_layout_count / industry_layout_distance&lt;br /&gt;
| industry_type, layout, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the given layout number.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| industry_town_count&lt;br /&gt;
| industry_type, grfid = -1.&lt;br /&gt;
| See industry_count / industry_distance for description of industry_type, grfid and return value. The results are filtered to industries that have the same town than the current industry.&amp;lt;br /&amp;gt;&#039;&#039;Warning: using this variable trashes the contents of temporary storage registers 0x100 and 0x101.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| town_manhattan_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the Manhattan distance (dx + dy) from the selected tile to the closest town&lt;br /&gt;
|-&lt;br /&gt;
| town_euclidean_dist&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed offset relative to the northern tile. Returns the squared Eucleidean distance (dx^2 + dy^2) from the selected tile to the closest town.&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| x, y&lt;br /&gt;
|&lt;br /&gt;
Parameters indicate a signed offset relative to the northern tile. Returns the [[NML:List of town zones|town zone]] that the selected tile is in.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_random_bits&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate an unsigned offset relative to the northern tile. Returns the random bits of the selected industry tile, or 0 if it is not an industry tile that&#039;s part of this industry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| varies&lt;br /&gt;
| Any unhandled callbacks. Generally this doesn&#039;t need to be used, except for old-style callbacks.&lt;br /&gt;
|-&lt;br /&gt;
| produce_cargo_arrival&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| Produce-block&lt;br /&gt;
| Called to produce cargo every 256 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| CB_RESULT_IND_ALLOW or CB_RESULT_IND_DISALLOW&lt;br /&gt;
|&lt;br /&gt;
{{nml|0.2}} Only available in NML 0.2 or earlier. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the [[#Industry creation types|creation type]].&lt;br /&gt;
|-&lt;br /&gt;
| construction_probability&lt;br /&gt;
| CB_RESULT_IND_NO_CONSTRUCTION, CB_RESULT_IND_PROBABILITY_FROM_PROPERTY or a relative probability 0..255&lt;br /&gt;
|&lt;br /&gt;
{{nml|0.3}}. Called when the game needs to know if the industry type is available. It is limited to the type as a whole, so you can&#039;t access industry-specific variables.&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 creation types|creation type]].&lt;br /&gt;
If you return CB_RESULT_IND_NO_CONSTRUCTION or 0 the industry won&#039;t be build. If you return CB_RESULT_IND_PROBABILITY_FROM_PROPERTY it&#039;ll be build according to the relative probability as defined in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_random&amp;lt;/code&amp;gt; or &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;prob_in_game&amp;lt;/code&amp;gt; properties, otherwise it&#039;ll use the value as returned as relative probability.&lt;br /&gt;
|-&lt;br /&gt;
| location_check&lt;br /&gt;
|&lt;br /&gt;
See the [[#Location check results|table]] below.&lt;br /&gt;
|&lt;br /&gt;
Called to check if a location is suitable.&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 creation types|creation type]].&lt;br /&gt;
Since the industry isn&#039;t built yet, industry variables aren&#039;t available. If this callback is not implemented or fails, constructing the industry will be allowed. Construction might also be prevented via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt; industry tile callback, though.&lt;br /&gt;
|-&lt;br /&gt;
| monthly_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Called each month to (possibly) change the industry production.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt;: 32 random bits.&lt;br /&gt;
|-&lt;br /&gt;
| random_prod_change&lt;br /&gt;
|&lt;br /&gt;
See [[#Production change callback results|below]]&lt;br /&gt;
| Works exactly the same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;monthly_prod_change&amp;lt;/code&amp;gt;, except that it&#039;s only called when TTD selects this industry for a random production change.&lt;br /&gt;
|-&lt;br /&gt;
| build_prod_change&lt;br /&gt;
| Value in range 4-128&lt;br /&gt;
| {{ottd|1.3|r24186}} Called when an industry is constructed.  Return value is production level (default 16).  Can also be used to initialise permanent storage when an industry is constructed.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_subtype_display&lt;br /&gt;
| String or CB_RESULT_NO_TEXT&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning CB_RESULT_NO_TEXT displays nothing.&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;: 0 .. 2 to get texts for the first .. third accepted cargo type, and 3 .. 4 for the first ... second produced cargo type.&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;: 0 when getting a string for the buy menu (no industry variables available!), 1 when for the industry window and 2 for the industry directory window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_industry&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the industry window.&lt;br /&gt;
|-&lt;br /&gt;
| extra_text_fund&lt;br /&gt;
| String&lt;br /&gt;
| Show extra text in the fund window. Since the industry isn&#039;t built, no industry variables are available.&lt;br /&gt;
|-&lt;br /&gt;
| control_special&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called to control various effects from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;spec_flags&amp;lt;/code&amp;gt; property. Currently only works for the first two (plant fields / cut trees). Return 1 to execute the action or 0 to not do so.&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.&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;: Queried effect.&lt;br /&gt;
The default (if the flag is enabled, of course) is to plant fields with 1/8th chance every 256 ticks, and to cut trees every 512 ticks.&lt;br /&gt;
|-&lt;br /&gt;
| stop_accept_cargo&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| With this callback, you can temporarily refuse accepting a certain cargo, for example because the stockpile is full. Return 1 to accept or 0 to refuse. Make sure to synchronize this callback with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_amount_accept&amp;lt;/code&amp;gt; callback for industry tiles.&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 cargo type to accept or not.&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
| Called after constructing the industry. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;colour&amp;lt;/code&amp;gt; variable is set to a random value at this point, you can use this callback to change this.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_input&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Decide the input cargo types. Called repeatedly until 0xFF is returned, although currently not more than three times. Do not rely on this limitation, though.&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;: Starts at 0 and is incremented for every iteration.&lt;br /&gt;
Return a cargo type (from the table) or 0xFF to stop.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_output&lt;br /&gt;
| Cargo type, or 0xFF&lt;br /&gt;
| Same as &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_input&amp;lt;/code&amp;gt; above, except that it is applied to the output cargo types and currently not called more than twice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:LocationCheckResults}}&lt;br /&gt;
&lt;br /&gt;
===Production change callback results===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_NO_CHANGE&lt;br /&gt;
| Do not change industry production&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_HALF&lt;br /&gt;
| Half industry production. If production goes below a quarter of default, the industry closes.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DOUBLE&lt;br /&gt;
| Double production if it&#039;s not 8x default yet.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_CLOSE&lt;br /&gt;
| Announce closure and remove the industry next month.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_RANDOM&lt;br /&gt;
| Do a random production change, as if the industry is a primary one.&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_4&lt;br /&gt;
| Divide production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_8&lt;br /&gt;
| Divide production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_16&lt;br /&gt;
| Divide production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DIVIDE_BY_32&lt;br /&gt;
| Divide production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_4&lt;br /&gt;
| Multiply production by 4&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_8&lt;br /&gt;
| Multiply production by 8&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_16&lt;br /&gt;
| Multiply production by 16&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_MULTIPLY_BY_32&lt;br /&gt;
| Multiply production by 32&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_DECREMENT_BY_1&lt;br /&gt;
| Decrement production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_INCREMENT_BY_1&lt;br /&gt;
| Increment production by 1&lt;br /&gt;
|-&lt;br /&gt;
| CB_RESULT_IND_PROD_SET_BY_0x100&lt;br /&gt;
| Set the production level to the value in bits 16 .. 23 of register 0x100.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting bit 7 of the result disables the associated news message.&amp;lt;br /&amp;gt; Setting bit 8 replaces the news message with a custom message, read from register 0x100 bits 0 .. 15.&lt;br /&gt;
&lt;br /&gt;
===Industry creation types===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! value&lt;br /&gt;
! meaning&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_GENERATION&lt;br /&gt;
| Industry is created during map generation, or when building &#039;many random industries&#039; in the scenario editor.&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_RANDOM&lt;br /&gt;
| Industry is randomly generated during gameplay&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_FUND&lt;br /&gt;
| Industry is funded by the player (in game or scenario editor)&lt;br /&gt;
|-&lt;br /&gt;
| IND_CREATION_PROSPECT&lt;br /&gt;
| Industry is prospected by the player&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3637</id>
		<title>NML:Getting started</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3637"/>
		<updated>2015-04-11T07:35:39Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Syntax highlighting */ Update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
&lt;br /&gt;
== What is NML? ==&lt;br /&gt;
NML is a a python-based compiler, capable to compile NML files (along with their associated language, sound and graphic files) into grf and / or nfo files.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== pip ===&lt;br /&gt;
If you are familiar with python and pip then you can just use &lt;br /&gt;
    pip install nml&lt;br /&gt;
This will install the required dependancies. Note that you may need administrator privileges for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
Windows users can install the [http://bundles.openttdcoop.org/nml/nightlies/LATEST/ windows binary] which contains a binary which bundles (most) required libraries.&lt;br /&gt;
&lt;br /&gt;
If execution fails due to missing MSVCR libraries or due to an invalid application configuration or similar error, you need to install [http://www.microsoft.com/en-gb/download/details.aspx?id=5555 this package from Microsoft].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you go for a python install and the packages themselves (e.g. mingw or msys) instead of the pre-compiled binary: Apparently you can prevent a lot of problems by installing the 32bit version of python, even if you have a 64bit windows installation. Installing PIL might be troublesome if you do install the 64bit version of python.&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
Users on other OS need to install them separately, best by means of their packet manager. In order to work, the following items are required:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;python&#039;&#039;&#039;&lt;br /&gt;
** python 3.2 or newer (for nightly builds or NML 0.4.0 or newer, earlier versions require python 2.6 or 2.7)&lt;br /&gt;
** downloadable from from http://www.python.org/)&lt;br /&gt;
* &#039;&#039;&#039;python image library&#039;&#039;&#039;&lt;br /&gt;
** downloadable from https://pypi.python.org/pypi/Pillow/&lt;br /&gt;
* &#039;&#039;&#039;ply&#039;&#039;&#039;&lt;br /&gt;
** downloadable from http://www.dabeaz.com/ply/&lt;br /&gt;
* &#039;&#039;&#039;NML itself&#039;&#039;&#039;&lt;br /&gt;
** the latest (nightly) build can be downloaded from http://bundles.openttdcoop.org/nml/push/LATEST/&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t install these with the packet manager of your choice (or there is none like on windows and you don&#039;t use the pre-compiled binary file), you should install these libraries as well as NML itself using &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;python setup.py install&amp;lt;/code&amp;gt; from your command prompt.&lt;br /&gt;
&lt;br /&gt;
For debian or ubunutu you might try to use pip for PIL/pillow when it is not in the package manager for python3:&lt;br /&gt;
 sudo apt-get install python3&lt;br /&gt;
 sudo apt-get install python3-ply&lt;br /&gt;
 sudo apt-get install pip&lt;br /&gt;
 sudo /usr/bin/pip-3.2 install pillow&lt;br /&gt;
&lt;br /&gt;
=== OSX ===&lt;br /&gt;
OS X users have two choices: install the dependencies manually as described in the Linux section above, for use with the python version that ships with OS X. Or install everything from macports, including a new python version (using macports eases upgrading).  However using macports to install the dependencies for the bundled system python is likely to fail.&lt;br /&gt;
&lt;br /&gt;
=== Installing manually (any system) ===&lt;br /&gt;
We assume that you have a python setup (2.6 ... 2.7) where the distutils are available so that setup.py can be executed. You&#039;ll additionally need a gcc compiler in your path. On linux it is strongly recommended to use your package manager to install these packages.&lt;br /&gt;
&lt;br /&gt;
==== Install PLY ====&lt;br /&gt;
This is easy. Get the library from the link as mentioned above.&lt;br /&gt;
Install it from the unpacked PLY directory via&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install the Python Imaging Library (PIL) ====&lt;br /&gt;
Get the library from the above mentioned link (the source kit for PIL 1.1.7). From the PIL source directory, test the setup for all available dependencies:&lt;br /&gt;
 python setup.py build_ext -i&lt;br /&gt;
You should get an output like which concludes with a summary of the available dependencies:&lt;br /&gt;
 PIL 1.1.7 SETUP SUMMARY&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- TKINTER support available&lt;br /&gt;
 --- JPEG support available&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support available&lt;br /&gt;
 --- FREETYPE2 support available&lt;br /&gt;
 --- LITTLECMS support available&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
If you&#039;re missing zlib or jpeg support, install those libraries, too.&lt;br /&gt;
&lt;br /&gt;
If that build shows everything available, test the setup:&lt;br /&gt;
 python selftest.py&lt;br /&gt;
A successful selftest will result in&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 PIL 1.1.7 TEST SUMMARY &lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Python modules loaded from ./PIL&lt;br /&gt;
 Binary modules loaded from ./PIL&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- PIL CORE support ok&lt;br /&gt;
 --- TKINTER support ok&lt;br /&gt;
 --- JPEG support ok&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support ok&lt;br /&gt;
 --- FREETYPE2 support ok&lt;br /&gt;
 --- LITTLECMS support ok&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Running selftest:&lt;br /&gt;
 --- 57 tests passed.&lt;br /&gt;
If all is successful, finally install the library:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install NML ====&lt;br /&gt;
Now, that you have installed ply and pil, then you can install NML from the unpacked nml directory:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing the installation ==&lt;br /&gt;
To verify that everything is installed, enter &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc --version&amp;lt;/code&amp;gt; in your command line. This should output the version of NML as well as the version of the installed libraries.&lt;br /&gt;
&lt;br /&gt;
Examples for small NML &amp;quot;projects&amp;quot; are found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;examples&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;regression&amp;lt;/code&amp;gt; folder of NML. Generally it&#039;s assumed that the language files are in a separate language folder &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt;, thus a simple project may look like this:&lt;br /&gt;
&lt;br /&gt;
 mynewgrf.nml&lt;br /&gt;
 graphics.png&lt;br /&gt;
 funny_sound.wav&lt;br /&gt;
 &lt;br /&gt;
 lang/english.lng&lt;br /&gt;
&lt;br /&gt;
The compiler itself &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc&amp;lt;/code&amp;gt; is a command line tool and can take a number of parameters, at least the nml filename which it shall process, e.g. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc mynewgrf.nml&amp;lt;/code&amp;gt; will compile your nml file into the grf-file &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mynewgrf.grf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The full syntax is:&lt;br /&gt;
&lt;br /&gt;
 Usage: nmlc [options] &amp;lt;filename&amp;gt;&lt;br /&gt;
 Where &amp;lt;filename&amp;gt; is the nml file to parse&lt;br /&gt;
 &lt;br /&gt;
Options:&lt;br /&gt;
  --version             show program&#039;s version number and exit&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -d, --debug           write the AST to stdout&lt;br /&gt;
  -s, --stack           Dump stack when an error occurs&lt;br /&gt;
  --grf=&amp;lt;file&amp;gt;          write the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --md5=&amp;lt;file&amp;gt;          Write an md5sum of the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --nfo=&amp;lt;file&amp;gt;          write nfo output to &amp;lt;file&amp;gt;&lt;br /&gt;
  -M                    output a rule suitable for make describing the&lt;br /&gt;
                        graphics dependencies of the main grf file (requires&lt;br /&gt;
                        input file or --grf)&lt;br /&gt;
  --MF=&amp;lt;file&amp;gt;           When used with -M, specifies a file to write the&lt;br /&gt;
                        dependencies to&lt;br /&gt;
  --MT=&amp;lt;file&amp;gt;           target of the rule emitted by dependency generation&lt;br /&gt;
                        (requires -M)&lt;br /&gt;
  -c                    crop extraneous transparent blue from real sprites&lt;br /&gt;
  -u                    save uncompressed data in the grf file&lt;br /&gt;
  --nml=&amp;lt;file&amp;gt;          write optimized nml to &amp;lt;file&amp;gt;&lt;br /&gt;
  -o &amp;lt;file&amp;gt;, --output=&amp;lt;file&amp;gt;&lt;br /&gt;
                        write output(nfo/grf) to &amp;lt;file&amp;gt;&lt;br /&gt;
  -t &amp;lt;file&amp;gt;, --custom-tags=&amp;lt;file&amp;gt;&lt;br /&gt;
                        Load custom tags from &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        custom_tags.txt]&lt;br /&gt;
  -l &amp;lt;dir&amp;gt;, --lang-dir=&amp;lt;dir&amp;gt;&lt;br /&gt;
                        Load language files from directory &amp;lt;dir&amp;gt; [default:&lt;br /&gt;
                        lang]&lt;br /&gt;
  --default-lang=&amp;lt;file&amp;gt;&lt;br /&gt;
                        The default language is stored in &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        english.lng]&lt;br /&gt;
  --start-sprite=&amp;lt;num&amp;gt;  Set the first sprite number to write (do not use&lt;br /&gt;
                        except when you output nfo that you want to include in&lt;br /&gt;
                        other files)&lt;br /&gt;
  -p &amp;lt;palette&amp;gt;, --palette=&amp;lt;palette&amp;gt;&lt;br /&gt;
                        Force nml to use the palette &amp;lt;pal&amp;gt; [default: ANY].&lt;br /&gt;
                        Valid values are &#039;DEFAULT&#039;, &#039;LEGACY&#039;, &#039;ANY&#039;&lt;br /&gt;
  --quiet               Disable all warnings. Errors will be printed normally.&lt;br /&gt;
  -n, --no-cache        Disable caching of sprites in .cache[index] files,&lt;br /&gt;
                        which may reduce compilation time.&lt;br /&gt;
&lt;br /&gt;
== Syntax highlighting ==&lt;br /&gt;
For some editors a matching syntax highlighting file is generated for each build of NML:&lt;br /&gt;
&lt;br /&gt;
* [http://bundles.openttdcoop.org/nml/push/LATEST/nml_notepadpp.xml Notepad++]&lt;br /&gt;
* [http://bundles.openttdcoop.org/nml/push/LATEST/nml_kate.xml Kate]&lt;br /&gt;
&lt;br /&gt;
For a few editors there exist syntax highlighting rules, made at a certain point, see the [http://dev.openttdcoop.org/projects/home/documents DevZone documents] for details. These files might be more or less outdated and not support the full syntax of NML:&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/26 Geany]&lt;br /&gt;
Please make available to us any updates you might have made. If you want the highlighting files automatically generated for your editor, we&#039;ll happily accept patches. See [https://hg.openttdcoop.org/nml/files/tip/nml/editors here] for the existing generation scripts.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3636</id>
		<title>NML:Getting started</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3636"/>
		<updated>2015-04-11T07:26:37Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Windows */ some hint on python 32bit vs 64 bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
&lt;br /&gt;
== What is NML? ==&lt;br /&gt;
NML is a a python-based compiler, capable to compile NML files (along with their associated language, sound and graphic files) into grf and / or nfo files.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== pip ===&lt;br /&gt;
If you are familiar with python and pip then you can just use &lt;br /&gt;
    pip install nml&lt;br /&gt;
This will install the required dependancies. Note that you may need administrator privileges for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
Windows users can install the [http://bundles.openttdcoop.org/nml/nightlies/LATEST/ windows binary] which contains a binary which bundles (most) required libraries.&lt;br /&gt;
&lt;br /&gt;
If execution fails due to missing MSVCR libraries or due to an invalid application configuration or similar error, you need to install [http://www.microsoft.com/en-gb/download/details.aspx?id=5555 this package from Microsoft].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you go for a python install and the packages themselves (e.g. mingw or msys) instead of the pre-compiled binary: Apparently you can prevent a lot of problems by installing the 32bit version of python, even if you have a 64bit windows installation. Installing PIL might be troublesome if you do install the 64bit version of python.&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
Users on other OS need to install them separately, best by means of their packet manager. In order to work, the following items are required:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;python&#039;&#039;&#039;&lt;br /&gt;
** python 3.2 or newer (for nightly builds or NML 0.4.0 or newer, earlier versions require python 2.6 or 2.7)&lt;br /&gt;
** downloadable from from http://www.python.org/)&lt;br /&gt;
* &#039;&#039;&#039;python image library&#039;&#039;&#039;&lt;br /&gt;
** downloadable from https://pypi.python.org/pypi/Pillow/&lt;br /&gt;
* &#039;&#039;&#039;ply&#039;&#039;&#039;&lt;br /&gt;
** downloadable from http://www.dabeaz.com/ply/&lt;br /&gt;
* &#039;&#039;&#039;NML itself&#039;&#039;&#039;&lt;br /&gt;
** the latest (nightly) build can be downloaded from http://bundles.openttdcoop.org/nml/push/LATEST/&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t install these with the packet manager of your choice (or there is none like on windows and you don&#039;t use the pre-compiled binary file), you should install these libraries as well as NML itself using &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;python setup.py install&amp;lt;/code&amp;gt; from your command prompt.&lt;br /&gt;
&lt;br /&gt;
For debian or ubunutu you might try to use pip for PIL/pillow when it is not in the package manager for python3:&lt;br /&gt;
 sudo apt-get install python3&lt;br /&gt;
 sudo apt-get install python3-ply&lt;br /&gt;
 sudo apt-get install pip&lt;br /&gt;
 sudo /usr/bin/pip-3.2 install pillow&lt;br /&gt;
&lt;br /&gt;
=== OSX ===&lt;br /&gt;
OS X users have two choices: install the dependencies manually as described in the Linux section above, for use with the python version that ships with OS X. Or install everything from macports, including a new python version (using macports eases upgrading).  However using macports to install the dependencies for the bundled system python is likely to fail.&lt;br /&gt;
&lt;br /&gt;
=== Installing manually (any system) ===&lt;br /&gt;
We assume that you have a python setup (2.6 ... 2.7) where the distutils are available so that setup.py can be executed. You&#039;ll additionally need a gcc compiler in your path. On linux it is strongly recommended to use your package manager to install these packages.&lt;br /&gt;
&lt;br /&gt;
==== Install PLY ====&lt;br /&gt;
This is easy. Get the library from the link as mentioned above.&lt;br /&gt;
Install it from the unpacked PLY directory via&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install the Python Imaging Library (PIL) ====&lt;br /&gt;
Get the library from the above mentioned link (the source kit for PIL 1.1.7). From the PIL source directory, test the setup for all available dependencies:&lt;br /&gt;
 python setup.py build_ext -i&lt;br /&gt;
You should get an output like which concludes with a summary of the available dependencies:&lt;br /&gt;
 PIL 1.1.7 SETUP SUMMARY&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- TKINTER support available&lt;br /&gt;
 --- JPEG support available&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support available&lt;br /&gt;
 --- FREETYPE2 support available&lt;br /&gt;
 --- LITTLECMS support available&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
If you&#039;re missing zlib or jpeg support, install those libraries, too.&lt;br /&gt;
&lt;br /&gt;
If that build shows everything available, test the setup:&lt;br /&gt;
 python selftest.py&lt;br /&gt;
A successful selftest will result in&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 PIL 1.1.7 TEST SUMMARY &lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Python modules loaded from ./PIL&lt;br /&gt;
 Binary modules loaded from ./PIL&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- PIL CORE support ok&lt;br /&gt;
 --- TKINTER support ok&lt;br /&gt;
 --- JPEG support ok&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support ok&lt;br /&gt;
 --- FREETYPE2 support ok&lt;br /&gt;
 --- LITTLECMS support ok&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Running selftest:&lt;br /&gt;
 --- 57 tests passed.&lt;br /&gt;
If all is successful, finally install the library:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install NML ====&lt;br /&gt;
Now, that you have installed ply and pil, then you can install NML from the unpacked nml directory:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing the installation ==&lt;br /&gt;
To verify that everything is installed, enter &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc --version&amp;lt;/code&amp;gt; in your command line. This should output the version of NML as well as the version of the installed libraries.&lt;br /&gt;
&lt;br /&gt;
Examples for small NML &amp;quot;projects&amp;quot; are found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;examples&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;regression&amp;lt;/code&amp;gt; folder of NML. Generally it&#039;s assumed that the language files are in a separate language folder &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt;, thus a simple project may look like this:&lt;br /&gt;
&lt;br /&gt;
 mynewgrf.nml&lt;br /&gt;
 graphics.png&lt;br /&gt;
 funny_sound.wav&lt;br /&gt;
 &lt;br /&gt;
 lang/english.lng&lt;br /&gt;
&lt;br /&gt;
The compiler itself &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc&amp;lt;/code&amp;gt; is a command line tool and can take a number of parameters, at least the nml filename which it shall process, e.g. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc mynewgrf.nml&amp;lt;/code&amp;gt; will compile your nml file into the grf-file &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mynewgrf.grf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The full syntax is:&lt;br /&gt;
&lt;br /&gt;
 Usage: nmlc [options] &amp;lt;filename&amp;gt;&lt;br /&gt;
 Where &amp;lt;filename&amp;gt; is the nml file to parse&lt;br /&gt;
 &lt;br /&gt;
Options:&lt;br /&gt;
  --version             show program&#039;s version number and exit&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -d, --debug           write the AST to stdout&lt;br /&gt;
  -s, --stack           Dump stack when an error occurs&lt;br /&gt;
  --grf=&amp;lt;file&amp;gt;          write the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --md5=&amp;lt;file&amp;gt;          Write an md5sum of the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --nfo=&amp;lt;file&amp;gt;          write nfo output to &amp;lt;file&amp;gt;&lt;br /&gt;
  -M                    output a rule suitable for make describing the&lt;br /&gt;
                        graphics dependencies of the main grf file (requires&lt;br /&gt;
                        input file or --grf)&lt;br /&gt;
  --MF=&amp;lt;file&amp;gt;           When used with -M, specifies a file to write the&lt;br /&gt;
                        dependencies to&lt;br /&gt;
  --MT=&amp;lt;file&amp;gt;           target of the rule emitted by dependency generation&lt;br /&gt;
                        (requires -M)&lt;br /&gt;
  -c                    crop extraneous transparent blue from real sprites&lt;br /&gt;
  -u                    save uncompressed data in the grf file&lt;br /&gt;
  --nml=&amp;lt;file&amp;gt;          write optimized nml to &amp;lt;file&amp;gt;&lt;br /&gt;
  -o &amp;lt;file&amp;gt;, --output=&amp;lt;file&amp;gt;&lt;br /&gt;
                        write output(nfo/grf) to &amp;lt;file&amp;gt;&lt;br /&gt;
  -t &amp;lt;file&amp;gt;, --custom-tags=&amp;lt;file&amp;gt;&lt;br /&gt;
                        Load custom tags from &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        custom_tags.txt]&lt;br /&gt;
  -l &amp;lt;dir&amp;gt;, --lang-dir=&amp;lt;dir&amp;gt;&lt;br /&gt;
                        Load language files from directory &amp;lt;dir&amp;gt; [default:&lt;br /&gt;
                        lang]&lt;br /&gt;
  --default-lang=&amp;lt;file&amp;gt;&lt;br /&gt;
                        The default language is stored in &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        english.lng]&lt;br /&gt;
  --start-sprite=&amp;lt;num&amp;gt;  Set the first sprite number to write (do not use&lt;br /&gt;
                        except when you output nfo that you want to include in&lt;br /&gt;
                        other files)&lt;br /&gt;
  -p &amp;lt;palette&amp;gt;, --palette=&amp;lt;palette&amp;gt;&lt;br /&gt;
                        Force nml to use the palette &amp;lt;pal&amp;gt; [default: ANY].&lt;br /&gt;
                        Valid values are &#039;DEFAULT&#039;, &#039;LEGACY&#039;, &#039;ANY&#039;&lt;br /&gt;
  --quiet               Disable all warnings. Errors will be printed normally.&lt;br /&gt;
  -n, --no-cache        Disable caching of sprites in .cache[index] files,&lt;br /&gt;
                        which may reduce compilation time.&lt;br /&gt;
&lt;br /&gt;
== Syntax highlighting ==&lt;br /&gt;
For a few editors there exist syntax highlighting rules, see the [http://dev.openttdcoop.org/projects/home/documents DevZone documents] for details.&lt;br /&gt;
There are rules for&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/26 Geany]&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/24 Notepad++]&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/38 Kate]&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3635</id>
		<title>NML:Getting started</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3635"/>
		<updated>2015-04-11T07:25:08Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Linux */ rework linux instructions slightly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
&lt;br /&gt;
== What is NML? ==&lt;br /&gt;
NML is a a python-based compiler, capable to compile NML files (along with their associated language, sound and graphic files) into grf and / or nfo files.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== pip ===&lt;br /&gt;
If you are familiar with python and pip then you can just use &lt;br /&gt;
    pip install nml&lt;br /&gt;
This will install the required dependancies. Note that you may need administrator privileges for this to work.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
Windows users can install the [http://bundles.openttdcoop.org/nml/nightlies/LATEST/ windows binary] which contains a binary which bundles (most) required libraries.&lt;br /&gt;
&lt;br /&gt;
If execution fails due to missing MSVCR libraries or due to an invalid application configuration or similar error, you need to install [http://www.microsoft.com/en-gb/download/details.aspx?id=5555 this package from Microsoft].&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
Users on other OS need to install them separately, best by means of their packet manager. In order to work, the following items are required:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;python&#039;&#039;&#039;&lt;br /&gt;
** python 3.2 or newer (for nightly builds or NML 0.4.0 or newer, earlier versions require python 2.6 or 2.7)&lt;br /&gt;
** downloadable from from http://www.python.org/)&lt;br /&gt;
* &#039;&#039;&#039;python image library&#039;&#039;&#039;&lt;br /&gt;
** downloadable from https://pypi.python.org/pypi/Pillow/&lt;br /&gt;
* &#039;&#039;&#039;ply&#039;&#039;&#039;&lt;br /&gt;
** downloadable from http://www.dabeaz.com/ply/&lt;br /&gt;
* &#039;&#039;&#039;NML itself&#039;&#039;&#039;&lt;br /&gt;
** the latest (nightly) build can be downloaded from http://bundles.openttdcoop.org/nml/push/LATEST/&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t install these with the packet manager of your choice (or there is none like on windows and you don&#039;t use the pre-compiled binary file), you should install these libraries as well as NML itself using &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;python setup.py install&amp;lt;/code&amp;gt; from your command prompt.&lt;br /&gt;
&lt;br /&gt;
For debian or ubunutu you might try to use pip for PIL/pillow when it is not in the package manager for python3:&lt;br /&gt;
 sudo apt-get install python3&lt;br /&gt;
 sudo apt-get install python3-ply&lt;br /&gt;
 sudo apt-get install pip&lt;br /&gt;
 sudo /usr/bin/pip-3.2 install pillow&lt;br /&gt;
&lt;br /&gt;
=== OSX ===&lt;br /&gt;
OS X users have two choices: install the dependencies manually as described in the Linux section above, for use with the python version that ships with OS X. Or install everything from macports, including a new python version (using macports eases upgrading).  However using macports to install the dependencies for the bundled system python is likely to fail.&lt;br /&gt;
&lt;br /&gt;
=== Installing manually (any system) ===&lt;br /&gt;
We assume that you have a python setup (2.6 ... 2.7) where the distutils are available so that setup.py can be executed. You&#039;ll additionally need a gcc compiler in your path. On linux it is strongly recommended to use your package manager to install these packages.&lt;br /&gt;
&lt;br /&gt;
==== Install PLY ====&lt;br /&gt;
This is easy. Get the library from the link as mentioned above.&lt;br /&gt;
Install it from the unpacked PLY directory via&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install the Python Imaging Library (PIL) ====&lt;br /&gt;
Get the library from the above mentioned link (the source kit for PIL 1.1.7). From the PIL source directory, test the setup for all available dependencies:&lt;br /&gt;
 python setup.py build_ext -i&lt;br /&gt;
You should get an output like which concludes with a summary of the available dependencies:&lt;br /&gt;
 PIL 1.1.7 SETUP SUMMARY&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- TKINTER support available&lt;br /&gt;
 --- JPEG support available&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support available&lt;br /&gt;
 --- FREETYPE2 support available&lt;br /&gt;
 --- LITTLECMS support available&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
If you&#039;re missing zlib or jpeg support, install those libraries, too.&lt;br /&gt;
&lt;br /&gt;
If that build shows everything available, test the setup:&lt;br /&gt;
 python selftest.py&lt;br /&gt;
A successful selftest will result in&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 PIL 1.1.7 TEST SUMMARY &lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Python modules loaded from ./PIL&lt;br /&gt;
 Binary modules loaded from ./PIL&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 --- PIL CORE support ok&lt;br /&gt;
 --- TKINTER support ok&lt;br /&gt;
 --- JPEG support ok&lt;br /&gt;
 --- ZLIB (PNG/ZIP) support ok&lt;br /&gt;
 --- FREETYPE2 support ok&lt;br /&gt;
 --- LITTLECMS support ok&lt;br /&gt;
 --------------------------------------------------------------------&lt;br /&gt;
 Running selftest:&lt;br /&gt;
 --- 57 tests passed.&lt;br /&gt;
If all is successful, finally install the library:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
==== Install NML ====&lt;br /&gt;
Now, that you have installed ply and pil, then you can install NML from the unpacked nml directory:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing the installation ==&lt;br /&gt;
To verify that everything is installed, enter &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc --version&amp;lt;/code&amp;gt; in your command line. This should output the version of NML as well as the version of the installed libraries.&lt;br /&gt;
&lt;br /&gt;
Examples for small NML &amp;quot;projects&amp;quot; are found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;examples&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;regression&amp;lt;/code&amp;gt; folder of NML. Generally it&#039;s assumed that the language files are in a separate language folder &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt;, thus a simple project may look like this:&lt;br /&gt;
&lt;br /&gt;
 mynewgrf.nml&lt;br /&gt;
 graphics.png&lt;br /&gt;
 funny_sound.wav&lt;br /&gt;
 &lt;br /&gt;
 lang/english.lng&lt;br /&gt;
&lt;br /&gt;
The compiler itself &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc&amp;lt;/code&amp;gt; is a command line tool and can take a number of parameters, at least the nml filename which it shall process, e.g. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nmlc mynewgrf.nml&amp;lt;/code&amp;gt; will compile your nml file into the grf-file &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;mynewgrf.grf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The full syntax is:&lt;br /&gt;
&lt;br /&gt;
 Usage: nmlc [options] &amp;lt;filename&amp;gt;&lt;br /&gt;
 Where &amp;lt;filename&amp;gt; is the nml file to parse&lt;br /&gt;
 &lt;br /&gt;
Options:&lt;br /&gt;
  --version             show program&#039;s version number and exit&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -d, --debug           write the AST to stdout&lt;br /&gt;
  -s, --stack           Dump stack when an error occurs&lt;br /&gt;
  --grf=&amp;lt;file&amp;gt;          write the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --md5=&amp;lt;file&amp;gt;          Write an md5sum of the resulting grf to &amp;lt;file&amp;gt;&lt;br /&gt;
  --nfo=&amp;lt;file&amp;gt;          write nfo output to &amp;lt;file&amp;gt;&lt;br /&gt;
  -M                    output a rule suitable for make describing the&lt;br /&gt;
                        graphics dependencies of the main grf file (requires&lt;br /&gt;
                        input file or --grf)&lt;br /&gt;
  --MF=&amp;lt;file&amp;gt;           When used with -M, specifies a file to write the&lt;br /&gt;
                        dependencies to&lt;br /&gt;
  --MT=&amp;lt;file&amp;gt;           target of the rule emitted by dependency generation&lt;br /&gt;
                        (requires -M)&lt;br /&gt;
  -c                    crop extraneous transparent blue from real sprites&lt;br /&gt;
  -u                    save uncompressed data in the grf file&lt;br /&gt;
  --nml=&amp;lt;file&amp;gt;          write optimized nml to &amp;lt;file&amp;gt;&lt;br /&gt;
  -o &amp;lt;file&amp;gt;, --output=&amp;lt;file&amp;gt;&lt;br /&gt;
                        write output(nfo/grf) to &amp;lt;file&amp;gt;&lt;br /&gt;
  -t &amp;lt;file&amp;gt;, --custom-tags=&amp;lt;file&amp;gt;&lt;br /&gt;
                        Load custom tags from &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        custom_tags.txt]&lt;br /&gt;
  -l &amp;lt;dir&amp;gt;, --lang-dir=&amp;lt;dir&amp;gt;&lt;br /&gt;
                        Load language files from directory &amp;lt;dir&amp;gt; [default:&lt;br /&gt;
                        lang]&lt;br /&gt;
  --default-lang=&amp;lt;file&amp;gt;&lt;br /&gt;
                        The default language is stored in &amp;lt;file&amp;gt; [default:&lt;br /&gt;
                        english.lng]&lt;br /&gt;
  --start-sprite=&amp;lt;num&amp;gt;  Set the first sprite number to write (do not use&lt;br /&gt;
                        except when you output nfo that you want to include in&lt;br /&gt;
                        other files)&lt;br /&gt;
  -p &amp;lt;palette&amp;gt;, --palette=&amp;lt;palette&amp;gt;&lt;br /&gt;
                        Force nml to use the palette &amp;lt;pal&amp;gt; [default: ANY].&lt;br /&gt;
                        Valid values are &#039;DEFAULT&#039;, &#039;LEGACY&#039;, &#039;ANY&#039;&lt;br /&gt;
  --quiet               Disable all warnings. Errors will be printed normally.&lt;br /&gt;
  -n, --no-cache        Disable caching of sprites in .cache[index] files,&lt;br /&gt;
                        which may reduce compilation time.&lt;br /&gt;
&lt;br /&gt;
== Syntax highlighting ==&lt;br /&gt;
For a few editors there exist syntax highlighting rules, see the [http://dev.openttdcoop.org/projects/home/documents DevZone documents] for details.&lt;br /&gt;
There are rules for&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/26 Geany]&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/24 Notepad++]&lt;br /&gt;
* [http://dev.openttdcoop.org/documents/38 Kate]&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3634</id>
		<title>NML:GRF</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3634"/>
		<updated>2015-04-11T07:18:44Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: /* Industry tile callbacks */ Explicitly mention that tile_check deactivates use of landshape flags&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;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| Number of the default industry tile that replaces this one, if this industry tile is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| id of the default industry tile which this industry tile replaces. This will cause your industry tile to be placed instead of the default industry tile. This is ignored, if the default industry tile has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by this tile. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile accept both COAL and IORE you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[COAL, 8], [IORE, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a tile that doesn&#039;t any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| land_shape_flags&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Land shape flags|Land shape flags]])&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(INDTILE_CBF_XXX, INDTILE_CBF_YYY)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_INDTILE_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|-&lt;br /&gt;
| special_flags&lt;br /&gt;
| bitmask(INDTILE_FLAG_XXX)&lt;br /&gt;
| XXX is a special flag description. Currently there&#039;s only one flag defined: set INDTILE_FLAG_RANDOM_ANIMATION if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NW_EDGE&lt;br /&gt;
| North-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NE_EDGE&lt;br /&gt;
| North-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SW_EDGE&lt;br /&gt;
| South-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SE_EDGE&lt;br /&gt;
| South-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ONLY_ON_FLAT_LAND&lt;br /&gt;
| This tile can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ALLOW_ON_WATER&lt;br /&gt;
| The land/water check is disabled for this tile so it can be built on water. If you need more control over this use callback &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;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the industry tile.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Industry tiles have access to the [[#Common variables|common variables]] described above. Additionally, they have access to the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed tile offset relative to the current tile. Returns 1 if the tile is part of the same industry, 0 otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the industry tile&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the reason to trigger the animation, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Cargo types are from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[#Location check results|location_check]] industry callback&lt;br /&gt;
|&lt;br /&gt;
Called before constructing the industry, so nothing exists on the map yet. Since the industry isn&#039;t built yet, so you can&#039;t access industry variables. From the tile variables, relative x/y/position, town zone are available, as well as the class, height, slope, terrain type and water status of nearby tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the industry layout number in the lowest (first) byte and the [[#Industry creation types|creation type]] in the second byte. 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;t&amp;quot;&lt;br /&gt;
! Trigger&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE&lt;br /&gt;
| the construction state changes&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_TILE_LOOP&lt;br /&gt;
| the tile is processed in the periodic processing loop&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_INDUSTRY_LOOP&lt;br /&gt;
| the industry of the tile is processed in the periodic processing loop (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_RECEIVED_CARGO&lt;br /&gt;
| the industry of the tile receives input cargo from a station (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_DISTRIBUTES_CARGO&lt;br /&gt;
| the industry distributes its output cargo to one of the stations nearby (synchronized for all tiles)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryTiles&amp;diff=3627</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=3627"/>
		<updated>2015-04-08T19:53:05Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Land shape flags */ use callback name instead of its hex equivalent&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;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| Number of the default industry tile that replaces this one, if this industry tile is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
[[NML:Default industry tiles|0..174]]&lt;br /&gt;
| id of the default industry tile which this industry tile replaces. This will cause your industry tile to be placed instead of the default industry tile. This is ignored, if the default industry tile has already been overridden. You can define this property multiple times&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by this tile. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile accept both COAL and IORE you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[COAL, 8], [IORE, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a tile that doesn&#039;t any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| land_shape_flags&lt;br /&gt;
|&lt;br /&gt;
bitmask([[#Land shape flags|Land shape flags]])&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(INDTILE_CBF_XXX, INDTILE_CBF_YYY)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_INDTILE_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|-&lt;br /&gt;
| special_flags&lt;br /&gt;
| bitmask(INDTILE_FLAG_XXX)&lt;br /&gt;
| XXX is a special flag description. Currently there&#039;s only one flag defined: set INDTILE_FLAG_RANDOM_ANIMATION if the decision in anim_control callback needs random bits via extra_callback_info1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Land shape flags===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NW_EDGE&lt;br /&gt;
| North-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_NE_EDGE&lt;br /&gt;
| North-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SW_EDGE&lt;br /&gt;
| South-west edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_CANNOT_LOWER_SE_EDGE&lt;br /&gt;
| South-east edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ONLY_ON_FLAT_LAND&lt;br /&gt;
| This tile can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
| LSF_ALLOW_ON_WATER&lt;br /&gt;
| The land/water check is disabled for this tile so it can be built on water. If you need more control over this use callback &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;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the industry tile.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Industry tiles have access to the [[#Common variables|common variables]] described above. Additionally, they have access to the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_industry&lt;br /&gt;
| x, y&lt;br /&gt;
| Parameters indicate a signed tile offset relative to the current tile. Returns 1 if the tile is part of the same industry, 0 otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Industry tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the industry tile&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;special_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the reason to trigger the animation, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; are used instead. Cargo types are from the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
|&lt;br /&gt;
Same as for the [[#Location check results|location_check]] industry callback&lt;br /&gt;
|&lt;br /&gt;
Called before constructing the industry, so nothing exists on the map yet. Since the industry isn&#039;t built yet, so you can&#039;t access industry variables. From the tile variables, relative x/y/position, town zone are available, as well as the class, height, slope, terrain type and water status of nearby tiles. &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains the industry layout number in the lowest (first) byte and the [[#Industry creation types|creation type]] in the second byte. If this callback is not implemented or fails, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;land_shape_flags&amp;lt;/code&amp;gt; property will be used instead to determine if the slope is suitable. This also means that without this callback, the tile may not be built on steep slopes.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|-&lt;br /&gt;
| autoslope&lt;br /&gt;
| CB_RESULT[_NO]_AUTOSLOPE&lt;br /&gt;
| Return CB_RESULT_AUTOSLOPE to allow autoslope (altering the ground below a tile) or CB_RESULT_NO_AUTOSLOPE to disallow it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{NML:LocationCheckResults}}&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Trigger&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE&lt;br /&gt;
| the construction state changes&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_TILE_LOOP&lt;br /&gt;
| the tile is processed in the periodic processing loop&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_INDUSTRY_LOOP&lt;br /&gt;
| the industry of the tile is processed in the periodic processing loop (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_RECEIVED_CARGO&lt;br /&gt;
| the industry of the tile receives input cargo from a station (synchronized for all tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_INDTILE_DISTRIBUTES_CARGO&lt;br /&gt;
| the industry distributes its output cargo to one of the stations nearby (synchronized for all tiles)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=3619</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=3619"/>
		<updated>2015-03-03T08:31:32Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: style for variables, callbacks and constants&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change to python3 ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
* New warnings about and flags for realsprites: (NO)ALPHA, (NO)WHITE and (NO)ANIM. See explanation in [[NML:Realsprites|realsprite page]].&lt;br /&gt;
* Rigerous caching of real sprites. This improves encoding speed a lot on subsequent runs, especially for NewGRFs with many real sprites, more so for 32bpp&lt;br /&gt;
* Statistics on the NewGRF on used IDs for vehicles, houses, etc as well as available switches, parameters etc&lt;br /&gt;
&lt;br /&gt;
== Language additions ==&lt;br /&gt;
* Feature: vehicle property &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;effect_spawn_model_and_powered&amp;lt;/code&amp;gt; and related callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt;&lt;br /&gt;
* Feature: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;EFFECT_SPRITE_NONE&amp;lt;/code&amp;gt; constant for &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;create_effect&amp;lt;/code&amp;gt; callback&lt;br /&gt;
* Feature: support for &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;OTTD_RECOLOUR&amp;lt;/code&amp;gt; action5 sprite(s)&lt;br /&gt;
* Feature: Support for Latin translations&lt;br /&gt;
* Feature: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;wagon_speed_limits&amp;lt;/code&amp;gt; variable to test for enabled wagon speed limits. (issue #6474)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There&#039;s numerous other fixes, changes and additions. For a full changelog, see http://bundles.openttdcoop.org/nml/releases/0.4.0/changelog.txt&lt;br /&gt;
Get the latest release version from the bundles server: http://bundles.openttdcoop.org/nml/releases/LATEST/&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3614</id>
		<title>NML:Changes 0.4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3614"/>
		<updated>2015-02-19T13:12:55Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: Note to package maintainers not necessary here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change to python3 ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
* New warnings about and flags for realsprites: (NO)ALPHA, (NO)WHITE and (NO)ANIM. See explanation in [[NML:Realsprites|realsprite page]].&lt;br /&gt;
* Rigerous caching of real sprites. This improves encoding speed a lot on subsequent runs, especially for NewGRFs with many real sprites, more so for 32bpp&lt;br /&gt;
* Statistics on the NewGRF on used IDs for vehicles, houses, etc as well as available switches, parameters etc&lt;br /&gt;
&lt;br /&gt;
* Feature: [NewGRF] create_effect and effect_spawn_model&lt;br /&gt;
* Feature: [NewGRF] EFFECT_SPRITE_NONE constant for create_effect callback&lt;br /&gt;
* Feature: [NewGRF] support for OTTD_RECOLOUR action5 sprite(s)&lt;br /&gt;
* Feature: [NewGRF] Support for Latin translations&lt;br /&gt;
* Feature: [NewGRF] Variable to test for enabled wagon speed limits. (issue #6474)&lt;br /&gt;
* Feature: [NewGRF] Warn about usage of animation and semi-transparent colours, and add spriteset flags to enable/disable the checks. (issue #1085)&lt;br /&gt;
&lt;br /&gt;
There&#039;s numerous other fixes, changes and additions. For a full changelog, see http://bundles.openttdcoop.org/nml/releases/0.4.0/changelog.txt&lt;br /&gt;
Get the latest release version from the bundles server: http://bundles.openttdcoop.org/nml/releases/LATEST/&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3613</id>
		<title>NML:Changes 0.4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3613"/>
		<updated>2015-02-19T13:12:28Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: Changes in NML 0.4.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change to python3 ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
* New warnings about and flags for realsprites: (NO)ALPHA, (NO)WHITE and (NO)ANIM. See explanation in [[NML:Realsprites|realsprite page]].&lt;br /&gt;
* Rigerous caching of real sprites. This improves encoding speed a lot on subsequent runs, especially for NewGRFs with many real sprites, more so for 32bpp&lt;br /&gt;
* Statistics on the NewGRF on used IDs for vehicles, houses, etc as well as available switches, parameters etc&lt;br /&gt;
&lt;br /&gt;
* Feature: [NewGRF] create_effect and effect_spawn_model&lt;br /&gt;
* Feature: [NewGRF] EFFECT_SPRITE_NONE constant for create_effect callback&lt;br /&gt;
* Feature: [NewGRF] support for OTTD_RECOLOUR action5 sprite(s)&lt;br /&gt;
* Feature: [NewGRF] Support for Latin translations&lt;br /&gt;
* Feature: [NewGRF] Variable to test for enabled wagon speed limits. (issue #6474)&lt;br /&gt;
* Feature: [NewGRF] Warn about usage of animation and semi-transparent colours, and add spriteset flags to enable/disable the checks. (issue #1085)&lt;br /&gt;
&lt;br /&gt;
There&#039;s numerous other fixes, changes and additions. For a full changelog, see http://bundles.openttdcoop.org/nml/releases/0.4.0/changelog.txt&lt;br /&gt;
Get the latest release version from the bundles server: http://bundles.openttdcoop.org/nml/releases/LATEST/&lt;br /&gt;
&lt;br /&gt;
Note to package maintainers:&lt;br /&gt;
&lt;br /&gt;
    Dependency change: python 3.2+&lt;br /&gt;
    Dependency change: preferably use pillow for python3 as imaging library instead of PIL.&lt;br /&gt;
    Build requirement change (optional): c compiler needed to build the optional cython module for grf encoding (nml/_lz77.c). It&#039;s an optional speed improvement over the python-only implementation.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3600</id>
		<title>NML:Changes 0.4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3600"/>
		<updated>2014-11-09T01:51:38Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Introduction */ Not quite an introduction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change to python3 ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
* New warnings about and flags for realsprites: (NO)ALPHA, (NO)WHITE and (NO)ANIM. See explanation in [[NML:Realsprites|realsprite page]].&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3599</id>
		<title>NML:Changes 0.4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Changes_0.4&amp;diff=3599"/>
		<updated>2014-11-09T01:50:01Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* Other changes */ new realsprite flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
* New warnings about and flags for realsprites: (NO)ALPHA, (NO)WHITE and (NO)ANIM. See explanation in [[NML:Realsprites|realsprite page]].&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3587</id>
		<title>NML:General</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:General&amp;diff=3587"/>
		<updated>2014-10-24T09:22:10Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: /* variable */ map height is variable now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 48, it has been possible to use action D to read various special Patch variables. These are usually switch values, but there are also a few other useful values.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 0D &amp;lt;target&amp;gt; &amp;lt;operation&amp;gt; &amp;lt;variable&amp;gt; FE FF FF 00 00&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||B||Defines action 0D&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;target&amp;gt;||B||Target parameter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;operation&amp;gt;||B||As for ActionD, but only assignment is valid.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;variable&amp;gt;||B||Patch variable number to read. See below.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|FE||B||Defines a special variable access&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|FF FF 00 00||D||Indicates that a patch variable is being read&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== variable ==&lt;br /&gt;
&lt;br /&gt;
The following patch variables are defined:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!variable!!Switch!!Version!!Value&lt;br /&gt;
|-&lt;br /&gt;
|00||miscmods/-Yo||{{ottdp|no|2.5}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|01||experimentalfeatures/-XF||{{ottdp|no|2.5}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|02||morevehicles/-x||{{ottdp|no|2.5}}||Vehicle array multiplier&lt;br /&gt;
|-&lt;br /&gt;
|03||mountains and curves/-mc||{{ottdp|no|2.5}}||Two bytes with four sets of two bits&lt;br /&gt;
|-&lt;br /&gt;
|04||planecrashcontrol/-Xc||{{ottdp|no|2.5}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|05||autorenew/-Xa||{{ottdp|no|2.5}}||Signed value&lt;br /&gt;
|-&lt;br /&gt;
|06||multihead/-M||{{ottdp|no|2.5}}||Speed increase, in percent&lt;br /&gt;
|-&lt;br /&gt;
|07||disasters/-XD||{{ottdp|no|2.5}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|08||unifiedmaglev/-XM||{{ottdp|no|2.5}}||Unified maglev mode&lt;br /&gt;
|-&lt;br /&gt;
|09||bridgespeedlimits/-XX||{{ottdp|no|2.5}}||Speed fraction, in percent&lt;br /&gt;
|-&lt;br /&gt;
|0A||---||{{ottdp|no|2.5}}||TTD Language, see the &amp;quot;new scheme&amp;quot; for [[Action4#language id|action 4]]&lt;br /&gt;
|-&lt;br /&gt;
|0B||startyear/-XY||{{ottdp|0.6|2.5}}||Year-1920&lt;br /&gt;
|-&lt;br /&gt;
|0C||morebuildoptions/-YB||{{ottdp|no|2.5}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|0D||moresteam/-YM||{{ottdp|no|2.5}}||value=LF (two hex digits), L=length, F=frequency&lt;br /&gt;
|-&lt;br /&gt;
|0E||freighttrains/-Yf||{{ottdp|0.6|2.5}}||weight factor&lt;br /&gt;
|-&lt;br /&gt;
|0F||wagonspeedlimits/-YL||{{ottdp|0.6|2.5}}||Speed increase for empty wagons&lt;br /&gt;
|-&lt;br /&gt;
|10||planespeed/-YP||{{ottdp|0.6|2.5}}||speed factor&lt;br /&gt;
|-&lt;br /&gt;
|11||dual company colors||{{ottdp|0.6|2.5|ttdprev=r1404}}||2CC colormap base sprite&lt;br /&gt;
|-&lt;br /&gt;
|12||miscmods2/-Zm||{{ottdp|no|2.6|ttdprev=r1738}}||Bit switch&lt;br /&gt;
|-&lt;br /&gt;
|13||map size information||{{ottdp|0.6|2.6|ottdrev=r11961|ttdprev=r1817}}||Format = -MABXYSS&lt;br /&gt;
{| |-&lt;br /&gt;
| M  || the type of map&lt;br /&gt;
* bit 0 set: squared map. Clear : rectangular map&lt;br /&gt;
* bit 1 set: Y is the bigger edge(bit 0 is clear).Clear : X is the bigger edge.&lt;br /&gt;
|-&lt;br /&gt;
|A  || minimum edge(log2) of the map&lt;br /&gt;
|-&lt;br /&gt;
|B  || maximum edge(log2) of the map&lt;br /&gt;
|-&lt;br /&gt;
|XY || edges(log2) of each side of the map.&lt;br /&gt;
|-&lt;br /&gt;
|SS || combination of both X and Y, thus giving the size(log2) of the map&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
All map sizes will be substracted by 6, as to keep the size 64 the smallest one, thus zero based&lt;br /&gt;
|-&lt;br /&gt;
|14||maximum height level||{{ottdp|1.2|no|ottdrev=r23158}}||Maximal possible height level of a tile. {{ottdp|1.5|no|ottdrev=r27010}}Any value between 1 and 255. In earlier versions fixed at 15.&lt;br /&gt;
|-&lt;br /&gt;
|15||extra foundations||{{ottdp|1.4|no|ottdrev=r25230}}||Extra foundation sprites as set via [[Action5|Action 5 type 06]]. This sprite block does only contain the extra foundations from Action 5, it does not contain the default foundations of Action A sprites 990 to 1003.&lt;br /&gt;
|-&lt;br /&gt;
|16||coast sprites||{{ottdp|1.4|no|ottdrev=r25230}}||All coast sprites in the order of the 16 sprites version of [[Action5#In_NewGRFs|Action 5 type 0D]]. Note that, it does not matter in which way the sprites were originally defined (whether via Action 5 with 10 or 16 sprites, or via Action A), the sprite block returned by this variable has always all sprites in the same order.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If experimentalfeatures, miscmods, or miscmods2 are off, the corresponding value will be zero. For all other switches, the value is unspecified if the switch is off, so [[TTDPatchFlags|action 7 variable 85]] should be checked first.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Houses&amp;diff=3585</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=3585"/>
		<updated>2014-10-23T12:07:45Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: /* House variables */ c&amp;amp;p error&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
==House IDs==&lt;br /&gt;
House IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. You should start your item definition with the &#039;substitute&#039;-property, which allocates a new house. The value of this property should be the ID of a [[NML:List_of_default_house_properties|default house type]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Although the majority of all original houses occupy a single tile, it is possible to define a larger house of up to 2x2 tiles. For this, you should set the fourth &#039;size&#039; parameter in the item-block. Valid values are HOUSE_SIZE_XXX, XXX = &amp;lt;nowiki&amp;gt;[1X1 | 1X2 | 2X1 | 2X2]&amp;lt;/nowiki&amp;gt;. This size should match the size of the substitute house type.&lt;br /&gt;
&lt;br /&gt;
===Multi-tile houses===&lt;br /&gt;
Internally, due to the way NewGRF houses work, a multi-tile house will occupy more than one item ID. If you assign item ID X to a house, item IDs X+1 (for a 2-tile house) and (X+1) .. (X+3) (for a 4-tile house) will also be used. Normally you don&#039;t have to care about this, but there are two exceptions:&lt;br /&gt;
* If you manually assign numeric ids to your houses. You are recommended to just set all ids to -1 and let NML figure it out for you.&lt;br /&gt;
* When working with several variables that work with house type IDs. Keep in mind that tiles of a multi-tile house may have IDs X .. X + N - 1, with X being the assigned id and N the number of house tiles.&lt;br /&gt;
&lt;br /&gt;
==House properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| for example string(STR_NAME_EIFFEL_TOWER)&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| Number of the default house that replaces this one, if this house is not available for some reason. This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics. All properties of the old type are copied to your new house, except for the church / stadium flags (see below). The old house must have the same size as the new house, see the list of [[NML:List_of_default_house_properties|default house types]] for a list of possible substitute IDs.&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
| 0 ... 109&lt;br /&gt;
| id of the default house which this house replaces (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&lt;br /&gt;
;HOUSE_FLAG_CHURCH&lt;br /&gt;
:House is a church (only 1  will be built per town)&lt;br /&gt;
;HOUSE_FLAG_STADIUM&lt;br /&gt;
:House is a stadium (only 1 will be built per town)&lt;br /&gt;
;HOUSE_FLAG_ONLY_SE&lt;br /&gt;
:Can only be built in the scenario editor&lt;br /&gt;
;HOUSE_FLAG_PROTECTED&lt;br /&gt;
:Will not be removed by the game&lt;br /&gt;
;HOUSE_FLAG_SYNC_CALLBACK&lt;br /&gt;
:Animation callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; is called at the same time for all tiles.&lt;br /&gt;
;HOUSE_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:Enable random bits in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt;-callback.&lt;br /&gt;
|-&lt;br /&gt;
| population&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of inhabitants the building adds to the town, if present&lt;br /&gt;
|-&lt;br /&gt;
| mail_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| accepted_cargos&lt;br /&gt;
| Array with up to 3 [cargo_id, amount]-pairs.&lt;br /&gt;
| The cargos that are accepted by each tile of the house. CargoID is a cargo type from your cargo translation table, amount is the acceptance of the given cargo in 1/8 units.&amp;lt;br /&amp;gt; Example: to make a tile fully accept both PASS and MAIL you could use this: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;accepted_cargos: [[PASS, 8], [MAIL, 8]];&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; Example: for a house tile that doesn&#039;t accept any cargos at all you&#039;d use: &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;accepted_cargos: [];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| local_authority_impact&lt;br /&gt;
| 0 ... 65525&lt;br /&gt;
| amount of happiness decrease of the city council, if the building is destroyed. Town ratings can vary between -1000 (appalling) and +1000 (outstanding). &lt;br /&gt;
|-&lt;br /&gt;
| removal_cost_multiplier&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| probability&lt;br /&gt;
| 0 ... 15 (float)&lt;br /&gt;
| Probability with respect to the default houses (=1). Mind that these are relative probabilities with respect to all houses defined. If all probabilities are defined as 16, they&#039;ll all have the same probability as if they had all a probability of 1.&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| array of two int&lt;br /&gt;
| [xx, yy] where xx and yy indicate the introduction year and the last year the building can be built&lt;br /&gt;
|-&lt;br /&gt;
| minimum_lifetime&lt;br /&gt;
| 0 ... 255&lt;br /&gt;
| number of years the building will remain at least&lt;br /&gt;
|-&lt;br /&gt;
| availability_mask&lt;br /&gt;
|&lt;br /&gt;
[bitmask([[NML:List of town zones|town zones]]), bitmask(CLIMATE_XXX, ...)]&lt;br /&gt;
|&lt;br /&gt;
An array with two bitmasks, the first bitmask is a mask of town zones where this house is available. The second bitmask is a mask of climates combined with the special value ABOVE_SNOWLINE which you need to set for houses available in the arctic climate above the snowline.&amp;lt;br /&amp;gt; Examples:&lt;br /&gt;
&lt;br /&gt;
* Available in the centre town zone in toyland only: &amp;lt;code&amp;gt;[bitmask(TOWNZONE_CENTRE), bitmask(CLIMATE_TOYLAND)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available in all town zones in the arctic climate both above and below the snowline: &amp;lt;code&amp;gt;[ALL_TOWNZONES, bitmask(CLIMATE_ARCTIC, ABOVE_SNOWLINE)]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Available everywhere except on the town edge: &amp;lt;code&amp;gt;[ALL_TOWNZONES &amp;amp;amp; ~bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask(HOUSE_CBF_XX)&lt;br /&gt;
|&lt;br /&gt;
Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| random_colours&lt;br /&gt;
| array of 4, each COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
colour values in an array, refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for a list of possible values.&lt;br /&gt;
|-&lt;br /&gt;
| refresh_multiplier&lt;br /&gt;
| 0 ... 63&lt;br /&gt;
| Defines the frequency with which the tile will be re-randomized which has an impact for random animation. The tile will be processed by the periodic tile processing loop every (X + 1)*256 ticks, with X being the value of this property.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| &lt;br /&gt;
Type of animation and its length (1...128 frames):&lt;br /&gt;
&lt;br /&gt;
;ANIMATION_LOOPING&lt;br /&gt;
;ANIMATION_NON_LOOPING&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 2 ... 16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| building_class&lt;br /&gt;
| 0 .. 254&lt;br /&gt;
| An arbitrary number. You can check for the presence of buildings of the same class when building new buildings or using animation. Only the north tile of a multi-tile building is assigned a class.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_types&lt;br /&gt;
| array of values from your [[NML:Cargotable|cargo table]]&lt;br /&gt;
| {{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}List of cargo types to watch, to be used with the &amp;lt;code style:darkgreen&amp;gt;watched_cargo_accepted&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==House variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| construction_state&lt;br /&gt;
| 0..3&lt;br /&gt;
| Current construction state of the house tile. 0..2 = under construction, 3 = finished.&lt;br /&gt;
|-&lt;br /&gt;
| pseudo_random_bits&lt;br /&gt;
| 0..3&lt;br /&gt;
| Some pseudo-random bits, based on the tile position. TTD houses use this to randomize their appearance.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits&lt;br /&gt;
| 0..255&lt;br /&gt;
| 8 random bits, also used for [[NML:Random_switch|random switch]]-blocks. Initially these are the same for all tiles of a multi-tile house.&lt;br /&gt;
|-&lt;br /&gt;
| age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the house in years, limited to 255&lt;br /&gt;
|-&lt;br /&gt;
| town_zone&lt;br /&gt;
| [[NML:List of town zones|town zone]]&lt;br /&gt;
| The town zone of the current tile&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID in the same town as this house&lt;br /&gt;
|-&lt;br /&gt;
| same_house_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same ID on the entire map&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_town&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; in the same town as this house. The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| same_class_count_map&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of the houses with the same &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_class&amp;lt;/code&amp;gt; on the entire map.  The class of the north tile of the use is used for this purpose, as other tiles don&#039;t normally have a class.&lt;br /&gt;
|-&lt;br /&gt;
| generating_town&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 a random town is currently being created, 0 otherwise. Note that while generating a random town, [[NML:Towns#Town variables|town variables]] &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;population&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;building_count&amp;lt;/code&amp;gt; are incorrect. The population variable contains the population of buildings generated &#039;&#039;yet&#039;&#039;, the final value may be larger. The building_count is surely higher than the final value will be.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Current animation frame&lt;br /&gt;
|-&lt;br /&gt;
| x_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| y_coordinate&lt;br /&gt;
| 0..2047&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile on the map&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..1&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..1&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| house_tile&lt;br /&gt;
| HOUSE_TILE_XXX, XXX = &amp;lt;nowiki&amp;gt;[NORTH | EAST | WEST | SOUTH]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| What tile of a multi-tile house this is.&lt;br /&gt;
|-&lt;br /&gt;
| house_type_id&lt;br /&gt;
| 0..255&lt;br /&gt;
| Item ID of this house type, that was assigned to the item. See the note above about [[#Multi-tile houses|multi-tile houses]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require one or more arguments&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_town&lt;br /&gt;
| ID of old house type (0..109)&lt;br /&gt;
| 0..255&lt;br /&gt;
| Number of old houses with a given ID in the same town as the current house&lt;br /&gt;
|-&lt;br /&gt;
| old_house_count_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;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==House callbacks==&lt;br /&gt;
Unless noted otherwise, callbacks may be called for any of the tiles of a multi-tile house.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for the house tile&lt;br /&gt;
|-&lt;br /&gt;
| graphics_xxx, xxx = &amp;lt;nowiki&amp;gt;[north | east | south | west]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Tile-specific graphics for one of the tiles of a multi-tile house. Of course, this is callback is called for that tile only.&lt;br /&gt;
|-&lt;br /&gt;
| random_trigger&lt;br /&gt;
| N/A&lt;br /&gt;
|&lt;br /&gt;
See [[NML:Random switch|random switch]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits, if enabled in the &amp;lt;code&amp;gt;building_flags&amp;lt;/code&amp;gt; property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called every 256 ticks. Return the animation frame to show, or CB_RESULT_XXX with XXX = &amp;lt;nowiki&amp;gt;[CB_RESULT_START_ANIMATION | STOP_ANIMATION | DO_NOTHING]&amp;lt;/nowiki&amp;gt; to respectively start the animation in its current frame, stop the animation or do nothing. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains 32 random bits. The low 16 bits are always different for each house tile, but the high 16 bits are the same for each tile if synchronized animation is enabled in the &amp;lt;code&amp;gt;building_flags&amp;lt;/code&amp;gt;-property. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| construction_anim&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when the construction state changes.&lt;br /&gt;
|-&lt;br /&gt;
| watched_cargo_accepted&lt;br /&gt;
| Same as &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt;&lt;br /&gt;
| Works the same as the &amp;lt;code&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, except that it&#039;s called when one of the watched cargo types is accepted.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_type_accept&lt;br /&gt;
| type1 + (type2 &amp;amp;lt;&amp;amp;lt; 5) + (type3 &amp;amp;lt;&amp;amp;lt; 10)&lt;br /&gt;
| Decide the cargo types that this tile accepts. If this callback is not implemented or fails, the values from &amp;lt;code&amp;gt;accepted_cargo&amp;lt;/code&amp;gt; are used instead. Bits 0..4: First cargo type. Bits 5..9: Second cargo type. Bits 10..14: Third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_accept&lt;br /&gt;
| amt1 + (amt2 &amp;amp;lt;&amp;amp;lt; 4) + (amt3 &amp;amp;lt;&amp;amp;lt; 8)&lt;br /&gt;
| Acceptance for each cargo amount in 1/8th. If this callback is not implemented or fails, the values from the acceptance properties are used instead. Cargo types are from the &amp;lt;code&amp;gt;cargo_type_accept&amp;lt;/code&amp;gt; callback, or the &amp;lt;code&amp;gt;accepted_cargo&amp;lt;/code&amp;gt; property if that callback failed. Bits 0..3: Acceptance of first cargo type. Bits 4..7: Acceptance of second cargo type. Bits 8..11: Acceptance of third cargo type.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_production&lt;br /&gt;
| (cargo_type * 256) + amount, 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. &amp;lt;code&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt; contains the number of iterations so far, &amp;lt;code&amp;gt;extra_callback_info2&amp;lt;/code&amp;gt; contains random bits.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|-&lt;br /&gt;
| autoslope&lt;br /&gt;
| CB_RESULT[_NO]_AUTOSLOPE&lt;br /&gt;
| Return CB_RESULT_AUTOSLOPE to allow autoslope (altering the ground below a tile) or CB_RESULT_NO_AUTOSLOPE to disallow it.&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the building (when using tile query tool)&lt;br /&gt;
|-&lt;br /&gt;
| colour&lt;br /&gt;
| Palette number&lt;br /&gt;
|&lt;br /&gt;
Used to recolour the building. See here [[NML:List of default colour translation palettes|here]] for an overview of default palettes.&lt;br /&gt;
|-&lt;br /&gt;
| construction_check&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 1 to allow building the house or 0 to disallow. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| destruction&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Called periodically. Return 0 to keep the building or 1 to destroy it. Called only for the north tile.&lt;br /&gt;
|-&lt;br /&gt;
| protection&lt;br /&gt;
| 0 or 1&lt;br /&gt;
| Return 0 to allow destruction, or 1 to disallow&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action4&amp;diff=3584</id>
		<title>Action4</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action4&amp;diff=3584"/>
		<updated>2014-10-12T08:46:51Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: /* LanguageIDs */ Use the shared list of languageIDs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Language files are usually found in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lang&amp;lt;/code&amp;gt; sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:&lt;br /&gt;
&lt;br /&gt;
 nmlc -l path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
 nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml&lt;br /&gt;
&lt;br /&gt;
Language files MUST have the extension &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;.lng&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt; The language files themselves follow a certain structure:&lt;br /&gt;
&lt;br /&gt;
 ##grflangid &amp;amp;lt;number&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;string-name&amp;amp;gt;                                                   :&amp;amp;lt;text&amp;amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 ##grflangid 0x01&lt;br /&gt;
 STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}&lt;br /&gt;
 STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.&lt;br /&gt;
 STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== String codes ==&lt;br /&gt;
&lt;br /&gt;
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; (for example a newgrf version which is written by your build script). In the case above the &amp;lt;code&amp;gt;custom_tags.txt&amp;lt;/code&amp;gt; could, for example read&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
 VERSION  :alpha-r88&lt;br /&gt;
 TITLE    :Example NewGRF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally to custom-defined tags, NML comes with a number of default tags:&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|              ||empty tag, written as {} is used to create a newline&lt;br /&gt;
|-&lt;br /&gt;
|NBSP          || non-breaking space&lt;br /&gt;
|-&lt;br /&gt;
|{             || Display a left curly bracket. You write this as {{}. If you&#039;d include it without surrounding it by { and } it&#039;d be seen as the start of a tag and the rest of the string would be read as name of the tag.&lt;br /&gt;
|-&lt;br /&gt;
|COPYRIGHT     || copyright symbol            || ©&lt;br /&gt;
|-&lt;br /&gt;
|TRAIN         || display train symbol&lt;br /&gt;
|-&lt;br /&gt;
|LORRY         || display lorry symbol&lt;br /&gt;
|-&lt;br /&gt;
|BUS           || display bus symbol&lt;br /&gt;
|-&lt;br /&gt;
|PLANE         || display plane symbol&lt;br /&gt;
|-&lt;br /&gt;
|SHIP          || display ship symbol&lt;br /&gt;
|-&lt;br /&gt;
|TINYFONT      || switch to small font&lt;br /&gt;
|-&lt;br /&gt;
|BIGFONT       || switch to big font&lt;br /&gt;
|-&lt;br /&gt;
|BLUE          || switch to blue text&lt;br /&gt;
|-&lt;br /&gt;
|SILVER        || switch to silver text&lt;br /&gt;
|-&lt;br /&gt;
|GOLD          || switch to golden text&lt;br /&gt;
|-&lt;br /&gt;
|RED           || switch to red text&lt;br /&gt;
|-&lt;br /&gt;
|PURPLE        || switch to purple text&lt;br /&gt;
|-&lt;br /&gt;
|LTBROWN       || switch to light brown text&lt;br /&gt;
|-&lt;br /&gt;
|ORANGE        || switch to orange text&lt;br /&gt;
|-&lt;br /&gt;
|GREEN         || switch to green text&lt;br /&gt;
|-&lt;br /&gt;
|YELLOW        || switch to yellow text&lt;br /&gt;
|-&lt;br /&gt;
|DKGREEN       || switch to dark green text&lt;br /&gt;
|-&lt;br /&gt;
|CREAM         || switch to cream-coloured text&lt;br /&gt;
|-&lt;br /&gt;
|BROWN         || switch to brown text&lt;br /&gt;
|-&lt;br /&gt;
|WHITE         || switch to white text&lt;br /&gt;
|-&lt;br /&gt;
|LTBLUE        || switch to light blue text&lt;br /&gt;
|-&lt;br /&gt;
|GRAY          || switch to gray text&lt;br /&gt;
|-&lt;br /&gt;
|DKBLUE        || switch to dark blue text&lt;br /&gt;
|-&lt;br /&gt;
|BLACK         || switch to black text&lt;br /&gt;
|}&lt;br /&gt;
== String parameters ==&lt;br /&gt;
The above tags can be used in almost all strings. There are also a number of tags that need an argument they&#039;ll read from the textstack. The textstack is only available for certain callbacks an properties.&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;150pt&amp;quot;|Tag&lt;br /&gt;
!width=&amp;quot;600pt&amp;quot;|Meaning&lt;br /&gt;
!Size (number of bytes read from stack)&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|COMMA         || signed number with decimal separator between 1000&#039;s.   || 4&lt;br /&gt;
|-&lt;br /&gt;
|SIGNED_WORD   || signed number with decimal separator between 1000&#039;s.   || 2&lt;br /&gt;
|-&lt;br /&gt;
|UNSIGNED_WORD || unsigned number with decimal separator between 1000&#039;s. || 2&lt;br /&gt;
|-&lt;br /&gt;
|CURRENCY      || money in proper currency units                         || 4 || 24,492 €&lt;br /&gt;
|-&lt;br /&gt;
|VELOCITY      || velocity in proper units                               || 2 || 35 km/h&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME        || volume in proper units                                 || 2 || 29,000 litres&lt;br /&gt;
|-&lt;br /&gt;
|VOLUME_SHORT  || volume in proper units in short form                   || 2 || 29,000l&lt;br /&gt;
|-&lt;br /&gt;
|POWER         || power in proper units                                  || 2 || 2,030 kW&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT        || weight in proper units                                 || 2 || 5 tonnes&lt;br /&gt;
|-&lt;br /&gt;
|WEIGHT_SHORT  || weight in proper units in short form                   || 2 || 5t&lt;br /&gt;
|-&lt;br /&gt;
|CARGO_LONG    || {{ottdp|1.4|no|ottdrev=r26244}} cargo amount in proper units                           || 4 (2 + 2)&amp;lt;ref name=&amp;quot;cargoamount&amp;quot;&amp;gt;First (lower) 2 bytes for cargo type, second (higher) 2 bytes for cargo amount.&amp;lt;/ref&amp;gt; || 10 bags of mail&lt;br /&gt;
|-&lt;br /&gt;
|CARGO_SHORT   || {{ottdp|1.4|no|ottdrev=r26244}} cargo amount in proper units in short form             || 4 (2 + 2)&amp;lt;ref name=&amp;quot;cargoamount&amp;quot;/&amp;gt; || 10 bags&lt;br /&gt;
|-&lt;br /&gt;
|CARGO_TINY    || {{ottdp|1.4|no|ottdrev=r26244}} cargo amount in proper units in tiny form (only unit conversion) || 4 (2 + 2)&amp;lt;ref name=&amp;quot;cargoamount&amp;quot;/&amp;gt; || 10&lt;br /&gt;
|-&lt;br /&gt;
|HEX           || hexadecimal presentation                               || 4 || F0 3D D4 33&lt;br /&gt;
|-&lt;br /&gt;
|STRING        || include other string                                   || 2&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_LONG || days since 1920 as long date                           || 2 || 12 August 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE1920_SHORT|| days since 1920 as short date                          || 2 || 12 Aug 1935&lt;br /&gt;
|-&lt;br /&gt;
|DATE_LONG     || days since 0 as long date                              || 4 || 12 August 1610&lt;br /&gt;
|-&lt;br /&gt;
|DATE_SHORT    || days since 0 as short date                             || 4 || 12 Aug 3049&lt;br /&gt;
|-&lt;br /&gt;
|POP_WORD      || Remove 2 bytes from the top of the stack               || 2&lt;br /&gt;
|-&lt;br /&gt;
|STATION       || Station name of station with given ID                  || 2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you don&#039;t want to use the first 2 (or 4) bytes from the stack but rather another variable, you can prefix the tag name with the number, like {1:COMMA} to use the second (indexing starts at 0) argument from the stack. You can also use this in translations that require a different order, for example (in english.lng):&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{COMMA} items cost {CURRENCY}&lt;br /&gt;
&lt;br /&gt;
And the same string in dutch.lng:&lt;br /&gt;
&lt;br /&gt;
 STR_SOME_STRING    :{1:CURRENCY} is de prijs van {0:COMMA} items.&lt;br /&gt;
&lt;br /&gt;
The string parameters itself are assigned in units of dwords (4 bytes), starting with temporary storage 256, up to 259 or 261. Thus if you use parameters which are not of dword size (e.g. strings or word-sized numbers), you have to construct the text stack via bit arithmetic:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
switch(FEAT_INDUSTRIES, SELF, extra_text_switch, [&lt;br /&gt;
			STORE_TEMP(&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 1) * string(STR_EXTRA_PRIMARY_EFFICIENT1)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 2) * string(STR_EXTRA_PRIMARY_EFFICIENT2)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 3) * string(STR_EXTRA_PRIMARY_EFFICIENT3)    ) +&lt;br /&gt;
				(    (LOAD_PERM(var_supply_efficiency_factor) == 4) * string(STR_EXTRA_PRIMARY_EFFICIENT4)    ) |&lt;br /&gt;
				LOAD_PERM(var_supply_requirement) &amp;lt;&amp;lt; 16,&lt;br /&gt;
				256&lt;br /&gt;
			),&lt;br /&gt;
	return string(STR_EXTRA_PRIMARY);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for a language file which reads&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT1 :{YELLOW}very efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT2 :{YELLOW}efficient{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT3 :in a {YELLOW}normal{BLACK} way&lt;br /&gt;
STR_EXTRA_PRIMARY_EFFICIENT4 :{YELLOW}wasteful{BLACK}ly&lt;br /&gt;
STR_EXTRA_PRIMARY            :{BLACK}This industry needs {YELLOW}supplies{BLACK}.{}They use them {STRING}{}{}Monthly demand: {YELLOW}{UNSIGNED_WORD} crate{P &amp;quot;&amp;quot; s} of engineering supplies{BLACK}.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining cases ==&lt;br /&gt;
Similar to OpenTTD&#039;s language files, NML can also make use of cases, genders and plural forms. In order to utilize them, they have to be defined in the language file&#039;s header and have to match the definition as used in OpenTTD&#039;s language files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##case pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                     :Utas&lt;br /&gt;
STR_NAME.pragma                              :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g. for Hungarian you&#039;d have&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##case t ba&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS                  :Utas&lt;br /&gt;
STR_CARGO_PLURAL_PASSENGERS.t                :utast&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a case changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_case pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##map_case t t_old&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Defining genders ==&lt;br /&gt;
Genders just like cases are defined in the header of the language file and have to match the definition as found within OpenTTD&#039;s language files. The gender of a word or expression is declared within the string&#039;s text itself by a tag of the form &amp;lt;code&amp;gt;{G=gendername}&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##gender pragma&lt;br /&gt;
&lt;br /&gt;
STR_NAME                                      :{G=gendername}String which requires gender &#039;gendername&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where the string with the defined gender then will trigger the correct usage in a string which includes it and which has to take provisions to show the proper gender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STR_OTHER                                     :Some text {G gender1 gender2 ...} {STRING}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example in German&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
##gender m w n p&lt;br /&gt;
&lt;br /&gt;
STR_CARGO_NAME_BAUXITE                        :{G=n}Bauxit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which then will be used with the correct gender by a string which includes it:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;&lt;br /&gt;
STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO                        :{WHITE}{STATION} akzeptiert kein{G &amp;quot;en&amp;quot; &amp;quot;e&amp;quot; &amp;quot;&amp;quot; &amp;quot;e&amp;quot;} {STRING} mehr.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the name of a gender changes in the OpenTTD language file, your language file will have to follow that change. To keep compatible with older OpenTTD versions you can use the ##map_gender pragma, like this:&lt;br /&gt;
&amp;lt;pre class=example&amp;gt;##gender m f&lt;br /&gt;
##map_gender m male&lt;br /&gt;
##map_gender f female&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LanguageIDs ==&lt;br /&gt;
&lt;br /&gt;
{{:language_IDs}}&lt;br /&gt;
&lt;br /&gt;
In case a language is not in this list, edit the shared [[language_IDs|master language list]] in the NewGRF Specs. This master list is always leading. NFO language ID 7F has no meaning in NML (set --default-lang instead) and setting bit 8 will break your language file.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3582</id>
		<title>Language IDs</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3582"/>
		<updated>2014-10-12T08:28:57Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: no double title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Currently, the scheme is to use international phone codes as language IDs, unless they&#039;re out of range. When creating a new translation for OpenTTD pick a number vaguely related in some way. Or something else. &lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 66&lt;br /&gt;
| Latin&lt;br /&gt;
| gen acc abl dat&lt;br /&gt;
| m f n mp fp np&lt;br /&gt;
|&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3581</id>
		<title>Language IDs</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Language_IDs&amp;diff=3581"/>
		<updated>2014-10-12T08:28:27Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: languageIDs as separate page to avoid duplication&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LanguageIDs ==&lt;br /&gt;
Currently, the scheme is to use international phone codes as language IDs, unless they&#039;re out of range. When creating a new translation for OpenTTD pick a number vaguely related in some way. Or something else. &lt;br /&gt;
&lt;br /&gt;
Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD&#039;s language file for each language.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! ID&lt;br /&gt;
! language&lt;br /&gt;
! cases&lt;br /&gt;
! genders&lt;br /&gt;
! plurals&lt;br /&gt;
|-&lt;br /&gt;
| 00&lt;br /&gt;
| English (US)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 01&lt;br /&gt;
| English (GB)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 02&lt;br /&gt;
| German&lt;br /&gt;
|&lt;br /&gt;
| m w n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 03&lt;br /&gt;
| French&lt;br /&gt;
|&lt;br /&gt;
| m m2 f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 04&lt;br /&gt;
| Spanish&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 05&lt;br /&gt;
| Esperanto&lt;br /&gt;
|&lt;br /&gt;
| n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 06&lt;br /&gt;
| Ido&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 07&lt;br /&gt;
| Russian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 08&lt;br /&gt;
| Irish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 09&lt;br /&gt;
| Maltese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 0A&lt;br /&gt;
| Tamil&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0B&lt;br /&gt;
| Chuvash&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0C&lt;br /&gt;
| Chinese (Traditional)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 0D&lt;br /&gt;
| Serbian&lt;br /&gt;
| nom big gen dat aku vok lok ins&lt;br /&gt;
| muški ženski srednji&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 0E&lt;br /&gt;
| Norwegian (Nynorsk)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0F&lt;br /&gt;
| Welsh&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Belarusian&lt;br /&gt;
| m f n p nom gen dat acc abl pre&lt;br /&gt;
| m f n p&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Marathi&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Faroese&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Arabic (Egypt)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Czech&lt;br /&gt;
| nom gen dat acc voc loc ins big small&lt;br /&gt;
| m f n map mnp fp np&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Slovak&lt;br /&gt;
| g&lt;br /&gt;
| m z s&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Bulgarian&lt;br /&gt;
| m f n p&lt;br /&gt;
| m f n p&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1B&lt;br /&gt;
| Afrikaans&lt;br /&gt;
|&lt;br /&gt;
| male&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 1E&lt;br /&gt;
| Greek&lt;br /&gt;
| subs date geniki&lt;br /&gt;
| m f n&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 1F&lt;br /&gt;
| Dutch&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| Basque&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Catalan&lt;br /&gt;
|&lt;br /&gt;
| Masculin Femenin&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Luxembourgish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Hungarian&lt;br /&gt;
| t ba&lt;br /&gt;
|&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Macedonian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Italian&lt;br /&gt;
| ms mp fs fp&lt;br /&gt;
| m ma f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Romanian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Icelandic&lt;br /&gt;
|&lt;br /&gt;
| karlkyn kvenkyn hvorugkyn&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2A&lt;br /&gt;
| Latvian&lt;br /&gt;
| kas&lt;br /&gt;
| m f&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 2B&lt;br /&gt;
| Lithuanian&lt;br /&gt;
| kas ko kam ka kuo kur kreip&lt;br /&gt;
| vyr mot&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 2C&lt;br /&gt;
| Slovenian&lt;br /&gt;
| r d t&lt;br /&gt;
|&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| 2D&lt;br /&gt;
| Danish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2E&lt;br /&gt;
| Swedish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 2F&lt;br /&gt;
| Norwegian (Bokmal)&lt;br /&gt;
| small&lt;br /&gt;
| masculine feminine neuter&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Polish&lt;br /&gt;
| d c b n m w&lt;br /&gt;
| m f n&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Galician&lt;br /&gt;
|&lt;br /&gt;
| m f n&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| Frisian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| Ukrainian&lt;br /&gt;
| r d z&lt;br /&gt;
| m f s mn&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Estonian&lt;br /&gt;
| g in sü&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| Finnish&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| Portuguese&lt;br /&gt;
|&lt;br /&gt;
| n m f mp fp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Brazilian Portuguese&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| Croatian&lt;br /&gt;
| nom gen dat aku vok lok ins&lt;br /&gt;
| male female middle&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Japanese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3A&lt;br /&gt;
| Korean&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| 3C&lt;br /&gt;
| Malay&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3D&lt;br /&gt;
| English (AU)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 3E&lt;br /&gt;
| Turkish&lt;br /&gt;
| tamlanan&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| Thai&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| Vietnamese&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| Chinese (Simplified)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5A&lt;br /&gt;
| Indonesian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5C&lt;br /&gt;
| Urdu&lt;br /&gt;
|&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| Hebrew&lt;br /&gt;
| singular plural gen&lt;br /&gt;
| m f&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| Persian&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 66&lt;br /&gt;
| Latin&lt;br /&gt;
| gen acc abl dat&lt;br /&gt;
| m f n mp fp np&lt;br /&gt;
|&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Replace_new_sprites&amp;diff=3568</id>
		<title>NML:Replace new sprites</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Replace_new_sprites&amp;diff=3568"/>
		<updated>2014-09-21T11:30:21Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: add additional recolour sprite(s)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
Over time, several features have been added to OpenTTD that require new sprites. As these sprites are not present in the original base graphics and only found in the extra grf of each base set. They cannot be replaced using a normal &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;replace&amp;lt;/code&amp;gt; block. Instead, a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;replacenew&amp;lt;/code&amp;gt; block has to be used. The semantics are like this:&lt;br /&gt;
&lt;br /&gt;
 replacenew [&amp;amp;lt;block-name&amp;amp;gt;](&amp;amp;lt;type&amp;amp;gt;, [&amp;amp;lt;image-file&amp;amp;gt;[, &amp;amp;lt;offset&amp;amp;gt;]]) {&lt;br /&gt;
 	[[NML:Realsprites|list of realsprites]]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;block_name&amp;amp;gt;&amp;lt;/code&amp;gt; is optional but required, if you want to define [[NML:Alternative sprites|alternative sprites]] for the sprite block so that it can be referenced there.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;type&amp;amp;gt;&amp;lt;/code&amp;gt; parameter indicates the type of sprites that will be replaced. It should be an identifier from the first column of the following table.&lt;br /&gt;
&lt;br /&gt;
For information on what sprites are needed and in what order, it&#039;s generally best to look at the OpenGFX source [http://hg.openttdcoop.org/opengfx/file/tip/sprites/extra], in the sprites/extra directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Number of sprites&lt;br /&gt;
|-&lt;br /&gt;
| PRE_SIGNAL&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| PRE_SIGNAL_SEMAPHORE&lt;br /&gt;
| 112&lt;br /&gt;
|-&lt;br /&gt;
| PRE_SIGNAL_SEMAPHORE_PBS&lt;br /&gt;
| 240&lt;br /&gt;
|-&lt;br /&gt;
| CATENARY&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| FOUNDATIONS_SLOPES&lt;br /&gt;
| 74&lt;br /&gt;
|-&lt;br /&gt;
| FOUNDATIONS_SLOPES_HALFTILES&lt;br /&gt;
| 90&lt;br /&gt;
|- &lt;br /&gt;
&amp;lt;!-- This is not usable anyway, as NML 0.3 is grf v8&lt;br /&gt;
| TTDP_GUI_25&lt;br /&gt;
| 73&amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| TTDP_GUI&lt;br /&gt;
| 93&amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
| CANALS&lt;br /&gt;
| 65&lt;br /&gt;
|-&lt;br /&gt;
| ONE_WAY_ROAD&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| COLOURMAP_2CC&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| TRAMWAY&lt;br /&gt;
| 113&lt;br /&gt;
|-&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
| SNOWY_TEMPERATE_TREES&lt;br /&gt;
| 133&amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
| COAST_TILES&lt;br /&gt;
| 16&amp;lt;ref name=&amp;quot;no_offset&amp;quot;&amp;gt;This type does not support the use of an offset. Thus the exact amount of sprites must be supplied.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| COAST_TILES_BASEGFX&lt;br /&gt;
| 10&amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| COAST_TILES_DIAGONAL&lt;br /&gt;
| 18&amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
| NEW_SIGNALS&lt;br /&gt;
| any &amp;lt;ref name=&amp;quot;not_supported&amp;quot;&amp;gt;Any number of sprites is allowed here, however both OpenTTD and NML don&#039;t (yet) support the other features required to use these sprites.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
| SLOPED_RAILS&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| AIRPORTS&lt;br /&gt;
| 15&lt;br /&gt;
|-&lt;br /&gt;
| ROAD_STOPS&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| AQUEDUCTS&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| AUTORAIL&lt;br /&gt;
| 55&lt;br /&gt;
|-&lt;br /&gt;
| FLAGS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| OTTD_GUI&lt;br /&gt;
| 175&lt;br /&gt;
|-&lt;br /&gt;
| AIRPORT_PREVIEW&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| RAILTYPE_TUNNELS&lt;br /&gt;
| 16&lt;br /&gt;
|-&lt;br /&gt;
| OTTD_RECOLOUR&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Parameter two &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;image-file&amp;amp;gt;&amp;lt;/code&amp;gt; (optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite.&lt;br /&gt;
&lt;br /&gt;
Parameter &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;offset&amp;amp;gt;&amp;lt;/code&amp;gt; is optional and has a default value of 0. Setting this value sets an offset into the block of sprites, so only a subset of the sprites (starting at &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;offset&amp;lt;/code&amp;gt;) will be replaced. An offset is not allowed in the case of the sprite types marked with &amp;lt;ref name=&amp;quot;no_offset&amp;quot; /&amp;gt;. Don&#039;t use offsets, if you want you NewGRF compatible with TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spritelayout&amp;diff=3560</id>
		<title>NML:Spritelayout</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spritelayout&amp;diff=3560"/>
		<updated>2014-09-02T19:21:28Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Planetmaker: update links to palette files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavNoSubpages}}&lt;br /&gt;
&lt;br /&gt;
All graphic files must be in a format that can be loaded by the python imaging library and they must have a valid palette. You can chose either the default (DOS) palette (recommended as it contains a few more colours) or the legacy (windows) palette.&lt;br /&gt;
&lt;br /&gt;
Palette files for several editors:&lt;br /&gt;
&lt;br /&gt;
* [http://dev.openttdcoop.org/attachments/download/1741/ttd-newgrf-dos.gpl Default (DOS) palette for GIMP]&lt;br /&gt;
* [http://dev.openttdcoop.org/attachments/download/1738/ttd-newgrf-win.gpl Legacy (Windows) palette for GIMP]&lt;br /&gt;
* [http://dev.openttdcoop.org/attachments/download/1749/photoshop-ttd-dos.act Default (DOS) palette for Photoshop]&lt;br /&gt;
* [http://dev.openttdcoop.org/attachments/download/1746/pal_win_png.act Legacy (Windows) palette for Photoshop]&lt;br /&gt;
* (another collection of palette files on the [http://dev.openttdcoop.org/documents/1 #openttdcoop DevZone])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Windows versions of NML do NOT support graphics in the pcx format due to missiong support within the PIL.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3524</id>
		<title>NML:GRF</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:GRF&amp;diff=3524"/>
		<updated>2014-06-24T15:52:52Z</updated>

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

		<summary type="html">&lt;p&gt;Planetmaker: loading speed better describes prop. 0x07&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;
== Introduction ==&lt;br /&gt;
Action 0 properties common to all vehicle types:&lt;br /&gt;
The four vehicle types (trains, road vehicles, ships and planes) all have some common properties, which are described here.&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;
!Number !![[GRFActionsDetailed|Size]]!!Version !!Description !!Available for articulated parts&lt;br /&gt;
|-&lt;br /&gt;
|00 ||W||{{ottdp|0.6|2.0}}||date of introduction||no&lt;br /&gt;
|-&lt;br /&gt;
| 02||B||{{ottdp|0.6|2.0}}||reliability decay speed||no&lt;br /&gt;
|-&lt;br /&gt;
| 03||B||{{ottdp|0.6|2.0}}||vehicle life in years||no&lt;br /&gt;
|-&lt;br /&gt;
| 04||B||{{ottdp|0.6|2.0}}||model life in years||no&lt;br /&gt;
|-&lt;br /&gt;
| 06||B||{{ottdp|0.6|2.0}}||climate availability||should be zero&lt;br /&gt;
|-&lt;br /&gt;
| 07||B||{{ottdp|0.6|2.0}} {{grfFrom|2}}||loading speed||yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In TTDPatch properties 00 to 06 only apply to new games, or when using [[ttwiki:ResetVehicleData|Cht: ResetVehicles]].&lt;br /&gt;
In OpenTTD the same holds for 00, 02, 04 and 06 (i.e. not for 03) unless using [[ottdwiki:Console#Other_commands|resetengines]].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Date of introduction ===&lt;br /&gt;
&lt;br /&gt;
The date is specified as number of days since 1920 where TTD counts 365,25 days in a year. It will have a random number from 0 to 511 days added to it at the start of every new game, or after using [[ttwiki:ResetVehicleData|Cht: ResetVehicles]] (TTDPatch) resp. [[ottdwiki:Console#Other_commands|resetengines]] (OpenTTD).&lt;br /&gt;
&lt;br /&gt;
{{ottdp|&amp;amp;lt;0.7|}} Note that TTD stops updating vehicle type data after the game ends in 2050, so all dates of introduction should be no later than in 2044, to ensure that all vehicle types can be introduced and reach their maximum reliability. This restriction does not apply to OpenTTD 0.7 and newer.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|&amp;amp;lt;0.7| |ottdrev=before r16929}} If the property value is 729 (2D9h) or less, i.e. before 1922, the random number is not added and the vehicle is introduced at exactly the given date.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|no}} Since OpenTTD r16929 the start date is not randomised in the first two years after game-start (no matter whether before or after 1922).&lt;br /&gt;
&lt;br /&gt;
The \w&amp;amp;lt;date&amp;amp;gt; escape sequence is especially useful here. See [[GRFActionsDetailed#Byte order|the discussion of escape sequences]] for further information.&lt;br /&gt;
&lt;br /&gt;
=== Reliability decay speed ===&lt;br /&gt;
&lt;br /&gt;
The reliability decay speed is set when a new vehicle is bought, and specifies how quickly the reliability decays after servicing. &amp;amp;nbsp;The initial TTD default for all vehicles is 20. &amp;amp;nbsp;If a vehicle goes without servicing for a long time, or if it gets very, very old, this number increases, meaning faster decay and more breakdowns. &amp;amp;nbsp;Larger numbers mean faster decay, smaller number slower decay. If set to 0, reliability never decreases in normal operation.&lt;br /&gt;
&lt;br /&gt;
=== Vehicle life ===&lt;br /&gt;
&lt;br /&gt;
The number of years before a particular vehicle is considered too old and needs replacing,&lt;br /&gt;
&lt;br /&gt;
=== Model life ===&lt;br /&gt;
&lt;br /&gt;
The number of years that this model can be bought in the game (if PersistentEngines is off). &amp;amp;nbsp;Usually this should be at least twice or three times as &amp;amp;nbsp;long as the vehicle life. &amp;amp;nbsp;When starting a new game, a random amount between 31 months and 17 years is added to this as well.&lt;br /&gt;
&lt;br /&gt;
If the early retirement property (26/1B/16/16) is not set, the model life works like this:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
!Phase !!Duration !!Reliability&lt;br /&gt;
|-&lt;br /&gt;
|1||7 to 38 months||increases from 48-73% to 75-100%&lt;br /&gt;
|-&lt;br /&gt;
|2||prop. 04 less 8 years||stays constant at peak, 75-100%&lt;br /&gt;
|-&lt;br /&gt;
|3||10 to 20.5 years||decreases from peak to 25-50%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(the ranges in time and reliability are randomized at the start of each game)&lt;br /&gt;
&lt;br /&gt;
At the end of phase 3, the model is retired and removed from the purchase list. &amp;amp;nbsp;Note that when the model reliability starts dropping in phase 3, so does the reliability of every single vehicle of this make in the game.&lt;br /&gt;
&lt;br /&gt;
Setting this property to 0xFF means the model will never expire.&lt;br /&gt;
&lt;br /&gt;
If persistentengines is on, the model never gets to within two years of the end of phase 2, it is kept in phase 2 as long as at least one vehicle of this make is in the game.&lt;br /&gt;
&lt;br /&gt;
If the early retirement property is set, the vehicle is retired this many years before the end of phase 2 (can be negative if desired), but not if persistentengines would keep the model alive.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ottdrev=r14680|ttdprev=2.5 beta 7}} This property also works for wagons since TTDPatch 2.5 beta 7 resp. OpenTTD r14680.&lt;br /&gt;
&lt;br /&gt;
=== Climate availability ===&lt;br /&gt;
&lt;br /&gt;
This is a bit mask of the climates in which this model is available. &amp;amp;nbsp;Simply add the values for the climates:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
!Bit!!Value!!Climate&lt;br /&gt;
|-&lt;br /&gt;
|0||1||Temperate&lt;br /&gt;
|-&lt;br /&gt;
|1||2||Arctic&lt;br /&gt;
|-&lt;br /&gt;
|2||4||Tropical&lt;br /&gt;
|-&lt;br /&gt;
|3||8||Toyland&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, 1+2+4 = 07 would make a vehicle available in all climates except Toyland.&lt;br /&gt;
&lt;br /&gt;
If you need a vehicle not to be available through the purchase menu, e.g. a locomotive tender being part of an articulated vehicle (locomotive and tender), you may use a value of zero for the bit mask.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no|2.5}} Same procedure works for vehicles to be used exlusively by [[Callback:_AI_construction/purchase_selection |TTDPatch&#039;s AI]], but not by a human player.&lt;br /&gt;
&lt;br /&gt;
=== Loading speed ===&lt;br /&gt;
This is the amount of cargo transferred per unit of time if using gradualloading. The default is 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;
If [[Action0/Vehicles/Trains#Miscellaneous_flags_.2827.29|Miscellaneous flag 5]] is set, the load amount specified in this property is scaled using [[Action0/Cargos#Capacity_multiplier_.281D.29|Cargo property 1D]].&lt;br /&gt;
&lt;br /&gt;
{{ottdp|&amp;amp;lt;0.7||ottdrev=before r14672}} For aircraft carrying both passengers and mail this property is broken (wrt. mail) in TTDPatch and OpenTTD before r14672. All aircraft effectively use the load amount of the train engine with ID 00.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|no|ottdrev=r14672}} Since OpenTTD r14672 this property is used for passengers, while mail uses 1/4 (rounded up). You can use [[Callbacks#Load amount (12)|callback 12]] to control load amounts for passengers and mail independently.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action8&amp;diff=3521</id>
		<title>Action8</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action8&amp;diff=3521"/>
		<updated>2014-06-23T22:49:01Z</updated>

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

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

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

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

		<summary type="html">&lt;p&gt;Planetmaker: add changes based on using python3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
With NML 0.4 we change some of its foundations, it now is written in python3 and requires python 3.2 or newer. Requirements are:&lt;br /&gt;
* python 3.2 or newer&lt;br /&gt;
* python3-pillow (imaging library)&lt;br /&gt;
* python3-ply    (lexer library)&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
None yet&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Main&amp;diff=3511</id>
		<title>NML:Main</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Main&amp;diff=3511"/>
		<updated>2014-06-20T16:59:48Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: Add changes page for NML 0.4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; padding-left:12px; background:none;&amp;quot;&amp;gt;{{NMLNavMain}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[NML:Preface |Preface]]&lt;br /&gt;
;[[NML:changes 0.3|Changes between NML 0.2 and head / 0.3]]&lt;br /&gt;
;[[NML:changes 0.4|Changes between NML 0.3 and head / 0.4]]&lt;br /&gt;
;[[NML:Getting started|Getting started]]&lt;br /&gt;
;[[NML:Graphic files|Graphics files]]&lt;br /&gt;
&lt;br /&gt;
;[[NML:Block syntax|Language structure and block syntax]]&lt;br /&gt;
*[[NML:GRF|GRF]] and its parameters&lt;br /&gt;
*[[NML:Item|Item]] (Properties, graphics, livery overrides)&lt;br /&gt;
&lt;br /&gt;
*;Defining sprites:&lt;br /&gt;
**[[NML:Realsprites|Realsprites]]&lt;br /&gt;
**[[NML:Template|Template]]&lt;br /&gt;
**[[NML:Base Graphics|Base Graphics]]&lt;br /&gt;
**[[NML:Spriteset|Spriteset]]&lt;br /&gt;
**;Replacing sprites:&lt;br /&gt;
***[[NML:Replace TTD sprites|Replace TTD sprites]]&lt;br /&gt;
***[[NML:Replace new sprites|Replace new sprites]]&lt;br /&gt;
***[[NML:Add font glyphs|Add font glyphs]]&lt;br /&gt;
***[[NML:Alternative sprites|Alternative sprites]] (32bpp, zoom levels)&lt;br /&gt;
**;Aranging and grouping sprites:&lt;br /&gt;
***[[NML:Spritegroup|Spritegroup]] (Vehicles)&lt;br /&gt;
***[[NML:Spritelayout|Spritelayout]] (Houses, industries, stations, airports, objects)&lt;br /&gt;
***[[NML:Recolour sprites|Recolour sprites]]&lt;br /&gt;
&lt;br /&gt;
*;Flow control&lt;br /&gt;
**[[NML:Tilelayout|Tilelayout]]&lt;br /&gt;
**[[NML:Switch|Switch]]&lt;br /&gt;
**[[NML:Produce|Produce]]&lt;br /&gt;
**[[NML:Random switch|Random switch]]&lt;br /&gt;
&lt;br /&gt;
*;Global scope&lt;br /&gt;
**[[NML:Cargotable|Cargotable]]&lt;br /&gt;
**[[NML:Railtypetable|Railtypetable]]&lt;br /&gt;
**[[NML:Snow line|Snow line]]&lt;br /&gt;
**[[NML:Setting base costs|Setting base costs]]&lt;br /&gt;
**[[NML:Parameter assignment|Parameter assignment]]&lt;br /&gt;
**[[NML:If|If/else]]&lt;br /&gt;
**[[NML:While|While]]&lt;br /&gt;
&lt;br /&gt;
*;Interaction with other grfs&lt;br /&gt;
**[[NML:Error|Error]]&lt;br /&gt;
**[[NML:Disable items|Disable items]]&lt;br /&gt;
**[[NML:Deactivate other NewGRFs|Deactivate other NewGRFs]]&lt;br /&gt;
**[[NML:Testing for other NewGRFs|Testing for other NewGRFs]]&lt;br /&gt;
**[[NML:Overriding vehicles in other NewGRFs|Overriding vehicles in other NewGRFs]]&lt;br /&gt;
&lt;br /&gt;
*;Misc&lt;br /&gt;
**[[NML:Town names|Town names]]&lt;br /&gt;
**[[NML:Town names parts|Town names parts]]&lt;br /&gt;
&lt;br /&gt;
;[[NML: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 properties, variables and callbacks]]&lt;br /&gt;
{|&lt;br /&gt;
|[[NML:General|General]] ||  || [[NML:General#General variables|variables]] || &lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Vehicles|Vehicles]] || [[NML:Vehicles#Properties common to all vehicle types|common properties]] || [[NML:Vehicles#Vehicle variables|variables]] || [[NML:Vehicles#Vehicle callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Train properties|train properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Road vehicle properties|road vehicle properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Ship properties|ship properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Vehicles#Aircraft properties|aircraft properties]] || || &lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Stations|Stations]] || [[NML:Stations#Station properties|properties]] || [[NML:Stations#Station variables|variables]] || [[NML:Stations#Station callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Canals|Canals]] || [[NML:Canals#Canal properties|properties]] || [[NML:Canals#Canal variables|variables]] || [[NML:Canals#Canal callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Bridges|Bridges]] || [[NML:Bridges#Bridge properties|properties]] || [[NML:Bridges#Bridge variables|variables]] || [[NML:Bridges#Bridge callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Towns|Towns]] || || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Houses|Houses]] || [[NML:Houses#House properties|properties]] || [[NML:Houses#House variables|variables]] || [[NML:Houses#House callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Industries|Industries]]||  || [[NML:Industries#Common variables|common variables]] || &lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Industries#Industry properties|industry properties]] || [[NML:Industries#Industry variables|industry variables]] || [[NML:Industries#Industry callbacks|industry callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Industries#Industry tile properties|tile properties]] || [[NML:Industries#Industry tile variables|tile variables]] || [[NML:Industries#Industry tile callbacks|tile callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Cargos|Cargos]] || [[NML:Cargos#Cargo properties|properties]] || [[NML:Cargos#Cargo variables|variables]] || [[NML:Cargos#Cargo callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Airports|Airports]] || [[NML:Airports#Airport properties|properties]] || [[NML:Airports#Airport variables|variables]] || [[NML:Airports#Airport callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
| || [[NML:Airports#Airport tile properties|tile properties]] || [[NML:Airports#Airport tile variables|tile variables]] || [[NML:Airports#Airport tile callbacks|tile callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Objects|Objects]] || [[NML:Objects#Object properties|properties]] || [[NML:Objects#Object variables|variables]] || [[NML:Objects#Object callbacks|callbacks]]&lt;br /&gt;
|-&lt;br /&gt;
|[[NML:Railtypes|Railtypes]] || [[NML:Railtypes#Railtype properties|properties]] || [[NML:Railtypes#Railtype variables|variables]] || [[NML:Railtypes#Railtype callbacks|callbacks]]&lt;br /&gt;
|}&lt;br /&gt;
;[[NML:Warnings|Compiler Warnings]]&lt;br /&gt;
;[[NML:Additional references|Additional references]]&lt;br /&gt;
*[[NML:Animation speed|Animation speed]]&lt;br /&gt;
*[[NML:Default industries|Default industries]]&lt;br /&gt;
*[[NML:Default industry tiles|Default industry tiles]]&lt;br /&gt;
*[[NML:Base cost table|Base cost table]]&lt;br /&gt;
*[[NML:List of sound effects|List of sound effects]]&lt;br /&gt;
*[[NML:List of default vehicle IDs|List of default vehicle IDs]]&lt;br /&gt;
*[[NML:List of default house properties|List of default house properties]]&lt;br /&gt;
*[[NML:List of town zones|List of town zones]]&lt;br /&gt;
*[[NML:List of tile classes|List of tile classes]]&lt;br /&gt;
*[[NML:List of default colour translation palettes|List of default colour translation palettes]]&lt;br /&gt;
*[[NML:List of direction constants|List of direction constants]]&lt;br /&gt;
*[[NML:List of tile slopes|List of tile slopes]]&lt;br /&gt;
*[[NML:List of tiles|List of tiles]]&lt;br /&gt;
*[[NML:Default TTD strings|Default TTD strings]]&lt;br /&gt;
*[[NML:Deprecated syntax|Deprecated syntax]]&lt;br /&gt;
;[[NML:NewGRF compatibility|NewGRF compatibility]]&lt;br /&gt;
;[[NML:Old style callbacks|Old-style callbacks]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[NML:Manual of style|Manual of style]]&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3509</id>
		<title>NML:Snow line</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3509"/>
		<updated>2014-05-11T17:57:03Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: snow%...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
The snowline is specified by a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. See the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 snowline (linear) {&lt;br /&gt;
 	day_of_year(2,  1):  2;&lt;br /&gt;
 	day_of_year(11, 1):  4;&lt;br /&gt;
 	177: 29;&lt;br /&gt;
 	day_of_year(10, 1): 50 snow%;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It starts with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; keyword followed by the mode. It contains a number of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;day-of-the-year&amp;amp;gt; : &amp;amp;lt;height&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. The values can be any value between 0 and 255. 255 means &#039;no snow&#039;; other values are scaled to the number of possible heightlevels of the map. Going in steps of 16 will mean that snowline makes large jumps if more heightlevels are used. If you use the unit &#039;snow%&#039; then the values give the percentage of height levels not covered with snow and 0 snow% means snow everywhere and 100 snow% snow everywhere.&lt;br /&gt;
&lt;br /&gt;
For the days not listed, the program computes a height. It can do that in two modes, namely in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode and in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode (last line of text in the example). In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode, the height of the snow is the same as the day before, unless the day is listed in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around&#039; at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3508</id>
		<title>NML:Snow line</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3508"/>
		<updated>2014-05-11T17:55:04Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: and fix again.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
The snowline is specified by a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. See the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 snowline (linear) {&lt;br /&gt;
 	day_of_year(2,  1):  2;&lt;br /&gt;
 	day_of_year(11, 1):  4;&lt;br /&gt;
 	177: 29;&lt;br /&gt;
 	day_of_year(10, 1): 50 snow%;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It starts with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; keyword followed by the mode. It contains a number of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;day-of-the-year&amp;amp;gt; : &amp;amp;lt;height&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. The values can be any value between 0 and 255. 255 means &#039;no snow&#039;; other values are scaled to the number of possible heightlevels of the map. Going in steps of 16 will mean that snowline makes large jumps if more heightlevels are used. If you use the unit &#039;snow%&#039; then the values give the percentage of height levels covered with snow and 0% means no snow at all.&lt;br /&gt;
&lt;br /&gt;
For the days not listed, the program computes a height. It can do that in two modes, namely in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode and in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode (last line of text in the example). In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode, the height of the snow is the same as the day before, unless the day is listed in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around&#039; at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3507</id>
		<title>NML:Snow line</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Snow_line&amp;diff=3507"/>
		<updated>2014-05-11T17:51:44Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: clarify documentation a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
The snowline is specified by a &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. See the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 snowline (linear) {&lt;br /&gt;
 	day_of_year(2,  1):  2;&lt;br /&gt;
 	day_of_year(11, 1):  4;&lt;br /&gt;
 	177: 29;&lt;br /&gt;
 	day_of_year(10, 1): 50 snow%;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It starts with the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; keyword followed by the mode. It contains a number of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;day-of-the-year&amp;amp;gt; : &amp;amp;lt;height&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. Heights run from 0 to 255 in levels above sea level. Thus a value of  17 is already sufficient to remove all traces of snow from the game. And any value lower than 2 will cover the whole map in snow. If you use the unit &#039;snow%&#039; then the values are scaled to the available height difference, thus to values between 0 and 17.&lt;br /&gt;
&lt;br /&gt;
For the days not listed, the program computes a height. It can do that in two modes, namely in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode and in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode (last line of text in the example). In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;equal&amp;lt;/code&amp;gt; mode, the height of the snow is the same as the day before, unless the day is listed in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;snowline&amp;lt;/code&amp;gt; statement. In &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;linear&amp;lt;/code&amp;gt; mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around&#039; at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3504</id>
		<title>NML:Getting started</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Getting_started&amp;diff=3504"/>
		<updated>2014-04-12T15:09:54Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Planetmaker: some spelling and linke to other part of townname docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;town_names&amp;lt;/code&amp;gt; block has one or more &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;part&amp;amp;gt;&amp;lt;/code&amp;gt;s. Each part defines a piece of a town name. All pieces together form the name generated by the [[NML:town_names|townname]] block.&lt;br /&gt;
&lt;br /&gt;
An example of a part is:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
 	text(&amp;quot;name1&amp;quot;, 1),&lt;br /&gt;
 	text(&amp;quot;name2&amp;quot;, 2),&lt;br /&gt;
 	town_names(othernames, 3)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simplest form is just a list of &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;text(...)&amp;lt;/code&amp;gt;entries. Each entry contains a possible value of piece, and a probability of picking that name. The &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;town_names(&amp;amp;lt;name&amp;amp;gt;, &amp;amp;lt;probability&amp;amp;gt;)&amp;lt;/code&amp;gt;calls a previous &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;town_names&amp;lt;/code&amp;gt; block (called &#039;othernames&#039; in the example), and returns the value generated there. A part should have at least one entry. Up to 255 entries will always work. If a part contains even more entries, NML tries to make it fit by creating sub-blocks. If that fails, you will get an error.&lt;br /&gt;
&lt;br /&gt;
The numbers are the probabilities. In the example, the sum of all values is 6, which means that &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;name1&amp;lt;/code&amp;gt; is picked with 1/6 chance, &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;name2&amp;lt;/code&amp;gt; has a 2/6 chance, and a name generated from the previous &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;town_names&amp;lt;/code&amp;gt; block has a 3/6 chance.&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Town_names&amp;diff=3493</id>
		<title>NML:Town names</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Town_names&amp;diff=3493"/>
		<updated>2014-02-01T22:07:41Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: Add link to town name parts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
To define randomly generated town names, the &amp;lt;tt&amp;gt;town_names&amp;lt;/tt&amp;gt; block should be used. Such blocks can be used in two ways, as generator of (partial) town names for another block, or as top-level town names block, a starting point of town names in the grf file. You must have at least one starting point, but you can have more than one.&lt;br /&gt;
&lt;br /&gt;
The general syntax of a town names block is:&lt;br /&gt;
&lt;br /&gt;
 town_names[(&amp;amp;lt;name&amp;amp;gt;)] {&lt;br /&gt;
 	[styles : &amp;amp;lt;string&amp;amp;gt;]&lt;br /&gt;
 	&amp;amp;lt;part&amp;amp;gt; &amp;amp;lt;part&amp;amp;gt; ....&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The optional &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; defines the name of the block. Such a name is used to refer to this block from another town names block. For top-level town names blocks, it is often left out. Note that in that case, you must also leave out the parentheses.&lt;br /&gt;
&lt;br /&gt;
The optional &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;string&amp;amp;gt;&amp;lt;/code&amp;gt; defines how the town names are called in the menu. It may only be defined in a top-names block. To make the name available in all languages, it is probably a good idea to at least define a menu name for the generic language.&lt;br /&gt;
&lt;br /&gt;
The townname &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;&amp;amp;lt;part&amp;amp;gt;&amp;lt;/code&amp;gt;s define the actual strings and their probability of the [[NML:Town_names_parts|parts]] which townnames consist of.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
In this example, town names are randomly constructed from two parts. Note that the top-level block is on the bottom; this is necessary so it can reference the other two blocks. Have a look at the [[NML:Town_names_parts]] section for more info on the syntax used in this example.&lt;br /&gt;
&lt;br /&gt;
 town_names(one) {&lt;br /&gt;
 	{&lt;br /&gt;
 	 	text(&amp;quot;Avon&amp;quot;, 31),&lt;br /&gt;
 	 	text(&amp;quot;Black&amp;quot;, 10),&lt;br /&gt;
 	 	...&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 town_names(two) {&lt;br /&gt;
 	{&lt;br /&gt;
 	 	text(&amp;quot; Bridge&amp;quot;, 1),&lt;br /&gt;
 	 	text(&amp;quot;ton&amp;quot;, 1),&lt;br /&gt;
 	 	...&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 town_names {&lt;br /&gt;
 	styles : string(STR_STYLES);&lt;br /&gt;
 	{&lt;br /&gt;
 	 	town_names(one,3)&lt;br /&gt;
 	}&lt;br /&gt;
 	{&lt;br /&gt;
 	 	town_names(two,1)&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This will generate:&lt;br /&gt;
&lt;br /&gt;
 Avon Bridge&lt;br /&gt;
 Avonton&lt;br /&gt;
 Black Bridge&lt;br /&gt;
 Blackton&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Recolour_sprites&amp;diff=3484</id>
		<title>NML:Recolour sprites</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Recolour_sprites&amp;diff=3484"/>
		<updated>2013-12-18T13:22:07Z</updated>

		<summary type="html">&lt;p&gt;Planetmaker: change palette naming DOS-&amp;gt;default and windows-&amp;gt;legacy to match OpenTTD&amp;#039;s naming of those&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
Recolour sprites are special sprites that are used to recolour other sprites, for example to apply company colours. It&#039;s basically a remapping of the colour table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 recolour_sprite {&lt;br /&gt;
 	0xC6: 0x28;&lt;br /&gt;
 	0xC7: 0xF5;&lt;br /&gt;
 	0xC8..0xCD: 0x0A..0x0F;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will remap colour 0xC6 as 0x28, 0xC7 as 0xF5 and the range 0xC8 to 0xCD to the colours 0x0A..0x0F. This is one of the company colour recolour sprites defined in the baseset. Please note that in NML every recolour sprite will use the Default (DOS) palette. If your actual graphics files use the legacy (windows) palette, nmlc will silently convert the recolour sprite to the legacy (windows) palette before writing it to the output file.&lt;br /&gt;
&lt;br /&gt;
With the following table you can find out the colour indices in the Default (DOS) palette (left). &lt;br /&gt;
&lt;br /&gt;
[[File:TTD_Palettes.png]]&lt;/div&gt;</summary>
		<author><name>Planetmaker</name></author>
	</entry>
</feed>