<?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=Pikkabird</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=Pikkabird"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Pikkabird"/>
	<updated>2026-05-14T09:25:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Industry_Tiles&amp;diff=5073</id>
		<title>Action0/Industry Tiles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Industry_Tiles&amp;diff=5073"/>
		<updated>2025-07-19T13:11:58Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: /* Callback flags (0E) */  Added a note for a hidden feature, because I always forget what it&amp;#039;s attached to...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Industry tiles work similarly to town buildings, except that they are not stand-alone; they are always part of an industry.&lt;br /&gt;
&lt;br /&gt;
Defining industry tiles follows the same schema as houses do: to start using an ID, you first need to define it by setting property 8 for it. If you try to reference an ID (either via action0 or via action3) that isn&#039;t defined, your request is ignored, but not reported as an error, either. This means that if you want to conditionally define an ID, all you need to do is skipping the action0 that sets property8, and everything else gets skipped automatically.&lt;br /&gt;
&lt;br /&gt;
Industry tile IDs are unique within each grf file. The per-GRF ID is specified as a byte, which means no GRF can define more than 256 tile IDs. You should use your industry tile IDs sparingly. [[VariationalAction2/Industry_Tiles#Relative_position_.2843.29| Variational action 2 variable 43]] for industry tiles can help you limiting tile consumption to 2 or 3 per industry. Avoid using tile FFh, so the tileID can be turned into an extended byte (in Action 3) in the distant future without breaking your NewGRF.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} In total, TTDPatch can have up to a total of 256 new industry tile IDs (i.e. old tile types don&#039;t count).&lt;br /&gt;
&lt;br /&gt;
{{ottd|}} OpenTTD can have 512 IDs for all active grf files, but that includes non-overridden original tiles.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Property !![[GRFActionsDetailed|Size]] !!Version !! Description&lt;br /&gt;
|-&lt;br /&gt;
|08||B||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Substitute building type&lt;br /&gt;
|-&lt;br /&gt;
|09||B||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Industry tile override&lt;br /&gt;
|-&lt;br /&gt;
|0A,0B,0C||W||{{ottdp|0.6|2.5}}||Tile acceptance&lt;br /&gt;
|-&lt;br /&gt;
|0D||B||{{ottdp|0.6|2.5|ttdprev=alpha 49}}||Land shape flags&lt;br /&gt;
|-&lt;br /&gt;
|0E||B||{{ottdp|0.6|2.5|ttdprev=alpha 54}}||Callback flags&lt;br /&gt;
|-&lt;br /&gt;
|0F||W||{{ottdp|0.6|2.5|ttdprev=alpha 54}}||Animation information&lt;br /&gt;
|-&lt;br /&gt;
|10||B||{{ottdp|0.6|2.5|ttdprev=alpha 54}}||Animation speed.&lt;br /&gt;
|-&lt;br /&gt;
|11||B||{{ottdp|0.6|2.5|ttdprev=alpha 54}}||Triggers for callback 25&lt;br /&gt;
|-&lt;br /&gt;
|12||B||{{ottdp|0.6|2.5|ttdprev=beta 2}}||Special flags&lt;br /&gt;
|-&lt;br /&gt;
|13||V||{{ottdp|1.9|no|ottdrev=e66cec8f}}||Tile acceptance list&lt;br /&gt;
|-&lt;br /&gt;
|14||W n*W||{{ottdp|15}}||List of badges&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Substitute tile type (08) ===&lt;br /&gt;
&lt;br /&gt;
This tile type will be used instead of your new one if your definition isn&#039;t available for any reason. Valid values are [http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#Class8 00h-AEh]. Assigning this property copies the properties of the old type just like it does with houses.&lt;br /&gt;
&lt;br /&gt;
If this tile&#039;s action 3 appears before this property is set, the action 3 will have no effect.&lt;br /&gt;
&lt;br /&gt;
=== Industry tile override (09) ===&lt;br /&gt;
&lt;br /&gt;
Works like the house override property for houses.&lt;br /&gt;
&lt;br /&gt;
=== Tile acceptance (0A, 0B, 0C) ===&lt;br /&gt;
&lt;br /&gt;
These three words define what cargoes the tile accepts, and how much of them. The low byte defines the type of the cargo according to the current climate, while the high byte defines the degree of acceptance in 1/8 units. If you don&#039;t need all three cargo types, just zero out the high byte of the extra properties.&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|7}} From GRF version 7 and above, the meaning of the low byte changes: instead of a climate-dependent cargo slot number, you have to give a climate-independent cargo ID. If your GRF has a cargo translation table, then this ID is the index in that table; otherwise, it&#039;s the cargo bit. Acceptance of cargoes not currently present will automatically be disabled.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.9|no|ottdrev=e66cec8f}} These properties only support three cargos. Use property 13 instead to list more cargo types. &lt;br /&gt;
&lt;br /&gt;
=== Land shape flags (0D) ===&lt;br /&gt;
&lt;br /&gt;
This property defines which slopes the tile can be built on.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.6|2.5}}||NW edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.6|2.5}}||NE edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.6|2.5}}||SW edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|0.6|2.5}}||SE edge cannot be lowered&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|0.6|2.5}}||Can only be built on flat land&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||The tile is allowed on both land and water&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Industry tiles are never built on steep slopes unless [[Callbacks#Custom shape check (2F) |callback 2F]] is enabled, but bits 0..4 are ignored in that case.&lt;br /&gt;
&lt;br /&gt;
Bit 5 can be used to allow tiles of land industries built on water or vice versa. It effectively disables the land/water check code for the tile. If you need to customize the behavior further, you can use [[Callbacks#Custom shape check (2F) |callback 2F]] to decide what kind of water/land is allowed.&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;PLEASE NOTE&#039;&#039;&#039;: Be careful when setting this property. If you fail to set it correctly, your industry may end up building on a hillside, which is probably not what you want. The easiest way is to set bit 4 for middle tiles, bit 0 for the tiles along the SE edge, bit 1 for those along the SW edge and so on.&lt;br /&gt;
&lt;br /&gt;
=== Callback flags (0E) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!value!!version!!meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp| | }}||use [[Callbacks#Next animation frame (1A/26/141/153/158) |callback 26]] to decide the next animation frame&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp| | }}||use [[Callbacks#Length of animation frame (20/27/142/154/15A) |callback 27]] to decide animation speed&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp| |2.5|ttdprev=alpha 55 vcs 3}}||use [[Callbacks#Decide cargo acceptance (2B) |callback 2B]] to decide amount of acceptance&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp| |2.5|ttdprev=alpha 55 vcs 3}}||use [[Callbacks#Get accepted cargo types (2A/2C) |callback 2C]] to decide accepted types&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp| | }}||use [[Callbacks#Custom shape check (2F) |callback 2F]] to check if a slope is suitable&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp| | }}||use [[Callbacks#Decide drawing default foundations (30/14E/150) |callback 30]] to decide if default foundations need to be drawn&lt;br /&gt;
|-&lt;br /&gt;
|6||40||{{ottdp| |2.5|ttdprev=beta 3}}||use [[Callbacks#Disable autosloping (3C/14F/15D) |callback 3C]] to allow or deny autosloping below the tile&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Please note that [[Callbacks#Animation control (1B/25/140/152/159) |callback 25]] doesn&#039;t have a bit here. To use [[Callbacks#Animation control (1B/25/140/152/159) |callback 25]], simply set the wanted bits in property 11 and it will work as intended.&lt;br /&gt;
&lt;br /&gt;
If bit 4 is set to activate callback 2F, the game will not automatically attempt to level the land around this tile when building a new industry.&lt;br /&gt;
&lt;br /&gt;
=== Animation information (0F) ===&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 tile (this is the default value).&lt;br /&gt;
&lt;br /&gt;
=== Animation speed (10) ===&lt;br /&gt;
&lt;br /&gt;
The meaning is the same as for 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;
=== Triggers for [[Callbacks#Animation control (1B/25/140/152/159) |callback 25]] (11) ===&lt;br /&gt;
&lt;br /&gt;
Call [[Callbacks#Animation control (1B/25/140/152/159) |callback 25]] when:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Property bit, var 18 byte 0!!Property value!!Version!!Meaning||Happens on||Var 18 byte 1&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.6|2.5}}||the construction state changes &amp;lt;ref&amp;gt;During normal gameplay called 4 times per tile. During map generation called 1 time.&amp;lt;br&amp;gt;{{ttdp|}} For the first call to happen, you also have to set [[Action0/Industry_Tiles#Animation_information_.280F.29|property 0F]] to some other value than 0xFFFF.&amp;lt;/ref&amp;gt;||single tile||{{ottdp|15|no}} First call &amp;lt;ref&amp;gt;Var 18 bit 8 is set, if the callback is called the first time for a new industry. In-game the construction stage will be zero, at map generation and in scenario editor, it will be 3.&amp;lt;br&amp;gt;Other bits of var 18 are reserved, and must be masked.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.6|2.5}}||the tile is processed in the periodic processing loop||single tile||&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.6|2.5}}||the industry of the tile is processed in the periodic processing loop (synchronized animation)||all tiles||&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|0.6|2.5}}||the industry of the tile receives input cargo from a station||all tiles||&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|0.6|2.5|ttdprev=beta 2}}||the industry distributes its output cargo to one of the stations nearby||all tiles||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently no trigger provides additional information in var 18 bytes 1 to 3.&lt;br /&gt;
&lt;br /&gt;
=== Special flags (12) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||[[Callbacks#Next animation frame (1A/26/141/153/158) |Callback 26]] needs random bits&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|1.9|no|ottdrev=e66cec8f}} In addition to the cargotypes set by property 0A..0C and 13, the tile accepts all cargotypes which the industry accepts.&lt;br /&gt;
* This considers industry properties 11 and 26 and callback 14B.&lt;br /&gt;
* This does not consider industry callback 3D.&lt;br /&gt;
* This property adds 8/8 acceptance for the matching cargotypes. You can list negative acceptances (-8/8) in property 13 to exclude specific cargos.&lt;br /&gt;
* Tile callback 2C overrides all acceptances including those added by this flag.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile acceptance list (13) ===&lt;br /&gt;
{{ottdp|1.9|no|ottdrev=e66cec8f}} &lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
 &amp;lt;numinput&amp;gt; (&amp;lt;cargotype&amp;gt; &amp;lt;acceptance&amp;gt;)*&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Variable!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||numinput||Number of (&amp;lt;cargotype&amp;gt; &amp;lt;acceptance&amp;gt;) pairs to follow,&lt;br /&gt;
|-&lt;br /&gt;
|B||cargotype||Cargotype (from CTT) to accept.&lt;br /&gt;
|-&lt;br /&gt;
|B||acceptance||Acceptance in 1/8 units. May be negative to negate property 12 bit 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This property defines up to 16 cargotypes, which are accepted by the industry tile.&lt;br /&gt;
Use this property instead of property 0A..0C.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=4842</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=4842"/>
		<updated>2024-08-21T22:28:36Z</updated>

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

		<summary type="html">&lt;p&gt;Pikkabird: /* Triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Unlike [[VariationalAction2]], whose results are always determined by a predictable decision, RandomAction2 can use randomized results to pick one of several [[Action2]] entries.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 02 &amp;lt;feature&amp;gt; &amp;lt;set-id&amp;gt; &amp;lt;nowiki&amp;gt;[80|83]&amp;lt;/nowiki&amp;gt; &amp;lt;random-triggers&amp;gt; &amp;lt;randbit&amp;gt; &amp;lt;nrand&amp;gt; &amp;lt;set-ids&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From TTDPatch 2.6 r1850 and OpenTTD r12452, and &#039;&#039;&#039;for vehicles only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 02 &amp;lt;feature&amp;gt; &amp;lt;set-id&amp;gt; 84 &amp;lt;count&amp;gt; &amp;lt;random-triggers&amp;gt; &amp;lt;randbit&amp;gt; &amp;lt;nrand&amp;gt; &amp;lt;set-ids&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action.&lt;br /&gt;
|-&lt;br /&gt;
|02||B||Defines action 02&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;feature&amp;gt;||B||For what type of vehicle/station/... should this definition be used?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;set-id&amp;gt;||B||The ID of this action 2 (used like a cargo ID)&lt;br /&gt;
|-&lt;br /&gt;
|80, 83, 84||B||Type of random action, see below.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;count&amp;gt;||B||(when present) Location of controlling vehicle.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;random-triggers&amp;gt;||B||When to re-randomize&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;randbit&amp;gt;||B||What random bit to use for this action 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;nrand&amp;gt;||B||Number of set-ids to choose from, must be a power of 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;set-ids&amp;gt;||W||Action 2 set-ids to choose from.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
===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;
|05||Canals/Rivers&lt;br /&gt;
|-&lt;br /&gt;
|07||Houses&lt;br /&gt;
|-&lt;br /&gt;
|09||Industry Tiles&lt;br /&gt;
|-&lt;br /&gt;
|0A||Industries&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;
|11||Airport Tiles&lt;br /&gt;
|-&lt;br /&gt;
|12||Roadtypes&lt;br /&gt;
|-&lt;br /&gt;
|13||Tramtypes&lt;br /&gt;
|-&lt;br /&gt;
|14||Road Stops&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== set-ID ===&lt;br /&gt;
&lt;br /&gt;
This defines the number of this action 2. &amp;amp;nbsp;The ID can then be used as target in an action 3 or another variational/random action 2.&lt;br /&gt;
&lt;br /&gt;
=== 80/83/84 ===&lt;br /&gt;
&lt;br /&gt;
Use 80 to randomize the object (vehicle, station, building, industry, object) based on its own triggers and bits.&lt;br /&gt;
&lt;br /&gt;
Use 83 to randomize the object based on its &amp;quot;related&amp;quot; object (s.b.).&lt;br /&gt;
&lt;br /&gt;
Use 84 to randomize the vehicle based on any vehicle in the consist.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Feature!!Related object&lt;br /&gt;
|-&lt;br /&gt;
|Vehicles (00-03)||First vehicle of consist&lt;br /&gt;
|-&lt;br /&gt;
|Stations (04)||N/A&lt;br /&gt;
|-&lt;br /&gt;
|Houses (07)||N/A&lt;br /&gt;
|-&lt;br /&gt;
|Industry tiles (09)||Industry containing tile&lt;br /&gt;
|-&lt;br /&gt;
|Industries (0A)||N/A&lt;br /&gt;
|-&lt;br /&gt;
|Objects (0F)||N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== count ===&lt;br /&gt;
&lt;br /&gt;
For type 84, this specifies which vehicle&#039;s random bits this vehicle will be using and/or modifying.&lt;br /&gt;
&lt;br /&gt;
The low nibble (bits 0-3) specifies how far to count from the starting vehicle. If it is zero, the count will be read from GRF register 100h instead.&lt;br /&gt;
&lt;br /&gt;
The high nibble (bits 6-7, actually) specifies which vehicle is the starting vehicle, and which direction to count:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||count back (away from the engine), starting at this vehicle&lt;br /&gt;
|-&lt;br /&gt;
|4||count forward (toward the engine), starting at this vehicle.&lt;br /&gt;
|-&lt;br /&gt;
|8||count back, starting at the engine&lt;br /&gt;
|-&lt;br /&gt;
|C||count back, starting at the first vehicle in this chain of vehicles with the same ID, as for vehicle variable 41&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bits 4-5 are reserved and must be zero, so other values of the high nibble are not allowed.&lt;br /&gt;
&lt;br /&gt;
=== random-triggers ===&lt;br /&gt;
&lt;br /&gt;
This is a bit mask of triggers which cause re-randomizing. Normally, any matching trigger causes the graphics to be randomized again, but if you add 80 to the bitmask, the re-randomizing only happens if &#039;&#039;&#039;all&#039;&#039;&#039; triggers have occurred.&lt;br /&gt;
&lt;br /&gt;
Trigger bits are feature-specific, see below.&lt;br /&gt;
&lt;br /&gt;
Note, that rerandomisation only occurs in the graphics chain, not for callbacks. So, if you use a random action only inside a callback and want to rerandomise the bits, you have to add a &amp;quot;dummy&amp;quot; rerandomisation RA2 into the graphics chain.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 -1 * -1   02 04 02&lt;br /&gt;
           80                         // random in callback&lt;br /&gt;
           00                         // no triggers&lt;br /&gt;
           00                         // first random bit to use&lt;br /&gt;
           \b 16                      // number of cases&lt;br /&gt;
           \w 10 \w 11 \w 12 \w 13    // random cases&lt;br /&gt;
           \w 14 \w 15 \w 16 \w 17&lt;br /&gt;
           \w 18 \w 19 \w 20 \w 21&lt;br /&gt;
           \w 22 \w 23 \w 24 \w 25&lt;br /&gt;
 &lt;br /&gt;
 -1 * -1   02 04 01&lt;br /&gt;
           85 0C 00 \wx FFFF&lt;br /&gt;
           01&lt;br /&gt;
           \w 2 \w 14 \w 14           // callback 14&lt;br /&gt;
           \w 3                       // graphics chain&lt;br /&gt;
 &lt;br /&gt;
 -1 * -1   02 04 00&lt;br /&gt;
           80                         // dummy random outside callback&lt;br /&gt;
           04                         // train arrival&lt;br /&gt;
           00                         // first bit to rerandomise&lt;br /&gt;
           \b 16                      // number of cases&lt;br /&gt;
           \w 1 \w1 \w 1 \w1          // all cases the same, only for triggering rerandomisation&lt;br /&gt;
           \w 1 \w1 \w 1 \w1&lt;br /&gt;
           \w 1 \w1 \w 1 \w1&lt;br /&gt;
           \w 1 \w1 \w 1 \w1&lt;br /&gt;
 &lt;br /&gt;
 -1 * -1   03 04 01 00 00 \w 0        // action 3&lt;br /&gt;
&lt;br /&gt;
=== randbit ===&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no|&amp;amp;lt;2.5|ttdprev=alpha30}} For versions before TTDPatch 2.0.1 alpha 30, leave this at 00. It doesn&#039;t quite work the way intended (it was supposed to allow independent random chains, but currently everything is re-randomized at the same time, thereby defeating this mechanism).&lt;br /&gt;
&lt;br /&gt;
{{ottdp| |2.5|ttdprev=alpha 30}} Since TTDPatch 2.0.1 alpha 30, only those bits that actually get triggered will be re-randomized. Prior versions always re-randomized all bits. This will make it possible to have independent sets of bits for independent triggers (or untriggered bits, set only at the time of purchase). Setting randbit determines the first bit to be re-randomized, as well as basing the random graphics on. The total number of bits used is the 2-logarithm of nrand below (e.g., for nrand=16, 4 bits are used).&lt;br /&gt;
&lt;br /&gt;
=== nrand ===&lt;br /&gt;
&lt;br /&gt;
Number of different sets to choose from. &amp;amp;nbsp;This must be a power of 2, i.e. 2, 4, 8, 16 etc.&lt;br /&gt;
&lt;br /&gt;
=== set-ids ===&lt;br /&gt;
&lt;br /&gt;
Action 2 IDs to randomly choose from&lt;br /&gt;
&lt;br /&gt;
== Triggers ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!rowspan=&amp;quot;2&amp;quot;|Feature&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Random bits&lt;br /&gt;
!rowspan=&amp;quot;2&amp;quot;|Triggers&lt;br /&gt;
|-&lt;br /&gt;
!Self!!Related&lt;br /&gt;
|-&lt;br /&gt;
|Vehicles&lt;br /&gt;
|8&lt;br /&gt;
{{ottdp|14.0|no}} 16&lt;br /&gt;
|8 read-only&lt;br /&gt;
{{ottdp|14.0|no}} 16 read-only&lt;br /&gt;
|yes&lt;br /&gt;
|-&lt;br /&gt;
|Stations||16 + 4 &amp;lt;ref name=&amp;quot;stationshared&amp;quot;&amp;gt;16 Bits shared for the whole station/airport (airport and station share the same bits). 4 bits per tile.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;TTDPatch actually only implements 8 shared random bits (plus 4 per tile). Bits 8-15 are always zero.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|no||yes&lt;br /&gt;
|-&lt;br /&gt;
|Canals||8||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Houses||8||no||yes&lt;br /&gt;
|-&lt;br /&gt;
|Industry tiles||8||16||yes&lt;br /&gt;
|-&lt;br /&gt;
|Industries||16||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Airports||16 &amp;lt;ref name=&amp;quot;stationshared&amp;quot;/&amp;gt;||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Objects||8||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Railtypes||2||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Roadtypes||2||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Tramtypes||2||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Airport tiles||16 + 4 &amp;lt;ref name=&amp;quot;stationshared&amp;quot;/&amp;gt;||no||no&lt;br /&gt;
|-&lt;br /&gt;
|Road stops||16 + 8 &amp;lt;ref name=&amp;quot;stationshared&amp;quot;/&amp;gt;||no||no&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicles ===&lt;br /&gt;
&lt;br /&gt;
Vehicles have 8 random bits, increased to 16 since {{ottdp|14.0|no}}, and the following triggers:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Trigger&lt;br /&gt;
|-&lt;br /&gt;
|0||01||{{ottdp|0.6|2.0}}||Vehicle gets new load of cargo (only after it was empty)&lt;br /&gt;
|-&lt;br /&gt;
|1||02||{{ottdp|0.6|2.0}}||Vehicle enters a depot and is serviced&lt;br /&gt;
|-&lt;br /&gt;
|2||04||{{ottdp|0.6|2.5}}||The consist has unloaded all cargo&lt;br /&gt;
|-&lt;br /&gt;
|3||08||{{ottdp|0.6|2.5}}||Any vehicle of the consist receives cargo&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|0.6|2.5}}||[[Callbacks#32-day callback (32) |Callback 32]] returned 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The consist trigger bits 2 and 3 allow re-randomizing whenever the consist receives cargo after fully unloading. They should be used with action 2 type 80, not 83, and the random-triggers variable should have 80 added to it, to make the re-randomizing happen only if the consist was empty and &#039;&#039;&#039;then&#039;&#039;&#039; received new cargo.&lt;br /&gt;
&lt;br /&gt;
Vehicles can read the random bits of other vehicles (using random action type 83 or 84), but they can only trigger&lt;br /&gt;
rerandomisation of their own bits. Do not specify any triggers for rerandomisation when accessing random bits of other vehicles (via type 83 or 84), it will not do what you think.&lt;br /&gt;
&lt;br /&gt;
=== Stations ===&lt;br /&gt;
&lt;br /&gt;
Stations have 16+4 random bits. Bits 0 to 15 are a property of the station as a whole, and bits 16 to 19 are different for each tile. &amp;amp;nbsp;To get tile-based randomness, therefore use randbit=10 and nrand of no more than 16 (since only 4 random bits are available per tile).&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Trigger&lt;br /&gt;
|-&lt;br /&gt;
|0||01||{{ottdp|1.3|2.5}}||new cargo waiting&lt;br /&gt;
|-&lt;br /&gt;
|1||02||{{ottdp|1.3|2.5}}||no more cargo&lt;br /&gt;
|-&lt;br /&gt;
|2||04||{{ottdp|1.3|2.5}}||train arrives (starts unloading/loading)&lt;br /&gt;
|-&lt;br /&gt;
|3||08||{{ottdp|1.3|2.5}}||train leaves (done unloading &amp;amp; loading)&lt;br /&gt;
|-&lt;br /&gt;
|4||10||{{ottdp|1.3|2.5}}||train loads or unloads cargo&lt;br /&gt;
|-&lt;br /&gt;
|5||20||{{ottdp|1.3|2.5}}||train reserves platform (using PBS)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Also note that none of the above triggers will actually trigger unless prop. 12 has at least one bit set. &amp;amp;nbsp;Triggers 01 will be triggered for any of the cargo types set in prop. 12, but trigger 02 will only be triggered if all of those cargo types have no more cargo waiting. Triggers 04, 08 and 20 are triggered no matter what cargo types the train transports, as long as prop. 12 is not zero.&lt;br /&gt;
&lt;br /&gt;
Triggers 04, 08, 10 and 20 only affect the platform on which they occur, as well as the random bits of the station, but not other platforms.&lt;br /&gt;
&lt;br /&gt;
Because the &#039;occured triggers&#039; are only stored once per station (not distinguishing tiles or cargo types), adding 80 to &lt;br /&gt;
random-triggers does not make a lot of sense.&lt;br /&gt;
&lt;br /&gt;
=== Town building triggers ===&lt;br /&gt;
&lt;br /&gt;
Town buildings have 8 random bits.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Trigger&lt;br /&gt;
|-&lt;br /&gt;
|0||01||{{ottdp|0.6|2.5}}||the building tile is processed in the periodic tile processing loop&lt;br /&gt;
|-&lt;br /&gt;
|1||02||{{ottdp|0.6|2.5}}||the top tile of the building is processed in the periodic tile processing loop&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The periodic tile processing loop constantly processes the tiles of the map, processing any given tile in every 256 ticks (approx. 3.5 TTD days). Since no &amp;quot;real&amp;quot; event happens to town buildings, you have only this opportunity to re-randomize the look of your building.&lt;br /&gt;
&lt;br /&gt;
If every 3.5 days is too fast for you, you can multiply the time-out by setting property 16 for the given tile. The time-out is 256 ticks*(prop. 16+1), so 0 means every 3.5 days, 1 means every 7 days, 2 means every 10.5 days and so on.&lt;br /&gt;
&lt;br /&gt;
If trigger 02 is activated, all parts of the building that has this trigger set will get the same random bits, allowing you to randomize a multi-tile building as one unit. On the other hand, if the tiles of a multi-tile building have trigger 1 set, all tiles will be randomized individually. Note that all tiles of a multi-tile building get the same value when building the building.&lt;br /&gt;
&lt;br /&gt;
=== Industry tile triggers ===&lt;br /&gt;
&lt;br /&gt;
Industry tiles have 8+16 random bits. Accessed through random action 2 type 80, you get 8 tile-specific bits, and accessed through random action 2 type 83, you get 16 industry-specific bits. The triggers are the same for both. Triggers 02 and 04 are triggered for all tiles of the industry at once. Every tile can rerandomise both its own random bits and those of the industry. That is every tile can specify some bits of the industry to rerandomize, and the union of all those bits will be rerandomsied at the end.&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Trigger&lt;br /&gt;
|-&lt;br /&gt;
|0||01||{{ottdp|0.6|2.5}}||the building tile is processed in the periodic tile processing loop&amp;lt;ref&amp;gt;{{ottdp|no| |}} Rerandomisation of the shared bits of the industry does not happen properly in current TTDPatch.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1||02||{{ottdp|0.6|2.5}}||triggers simultaneously for all tiles of the industry every 256 ticks. If the industry is a primary one, output cargo is generated at the same time.&lt;br /&gt;
|-&lt;br /&gt;
|2||04||{{ottdp|0.6|2.5}}||cargo is delivered to the industry. If the industry is a processing one, output cargo is generated at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigger 1 works similarly to trigger 1 for houses except that you cannot multiply the timeout: it&#039;s always 256 ticks.&lt;br /&gt;
&lt;br /&gt;
Industry tiles can rerandomise both their own random bits as well as the random bits of the industry (via random action type 83).&lt;br /&gt;
The remembered triggers for rerandomisation with 80 added to the triggers are in both cases the same per tile.&lt;br /&gt;
&lt;br /&gt;
Industries have random bits. However, they can only be rerandomised by their tiles.&lt;br /&gt;
&lt;br /&gt;
=== Canals ===&lt;br /&gt;
&lt;br /&gt;
Canals / Rivers have 8 random bits.&lt;br /&gt;
&lt;br /&gt;
There is currently no way to influence the random byte creation via triggers, internally the bits are feed from VarAction2Canals var 83 that is set when building a canal. Feature ids not supported by VarAction2Canals are undefined and should never be used.&lt;br /&gt;
&lt;br /&gt;
=== Objects ===&lt;br /&gt;
&lt;br /&gt;
Objects have 8 random bits per tile of the object.&lt;br /&gt;
&lt;br /&gt;
There are no triggers for objects however.&lt;br /&gt;
&lt;br /&gt;
Also note that the random bits are unique to each tile in the object, and are not shared across the whole object.&lt;br /&gt;
&lt;br /&gt;
=== Railtypes ===&lt;br /&gt;
&lt;br /&gt;
Rail tiles have 2 pseudo random bits, based on tile location.&lt;br /&gt;
&lt;br /&gt;
There are no triggers.&lt;br /&gt;
&lt;br /&gt;
=== Roadtypes ===&lt;br /&gt;
&lt;br /&gt;
Road tiles have 2 pseudo random bits, based on tile location.&lt;br /&gt;
&lt;br /&gt;
There are no triggers.&lt;br /&gt;
&lt;br /&gt;
=== Tramtypes ===&lt;br /&gt;
&lt;br /&gt;
Tram tiles have 2 pseudo random bits, based on tile location.&lt;br /&gt;
&lt;br /&gt;
There are no triggers.&lt;br /&gt;
&lt;br /&gt;
=== Other features ===&lt;br /&gt;
&lt;br /&gt;
All features not mentioned in the list above have neither random bits nor triggers, including towns (which would be accessed using random action 2 type 83 for stations and industries).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action2/Advanced_Sprite_Layout&amp;diff=4660</id>
		<title>Action2/Advanced Sprite Layout</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action2/Advanced_Sprite_Layout&amp;diff=4660"/>
		<updated>2023-11-30T20:24:44Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: /* Advanced sprite layout using register offsets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Advanced sprite layout using register offsets ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 02 07/09/0F/11 &amp;lt;set-id&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;
{{ottdp|1.2|no|ottdrev=r22518}}&lt;br /&gt;
The spritelayout defines fixed spritesets to use from the Action 1. The registers can be used to individually select sprites from the spritesets instead of always using the construction stage. The registers are evaluated and their values are saved when the Action 2 sprite layout is evaluated. Other callbacks called during drawing (like CB 1E) have no effect on the used values of the registers. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite-number|Sprite-number]]&amp;amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Length|length]]&amp;amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|02||B||Defines action 02&lt;br /&gt;
|-&lt;br /&gt;
|04/07/09/0F/11/14||B||feature: 07 town buildings, 09 industry tiles, 0F objects, 11 airport tiles, or 14 road stops&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Set-id|set-id]]&amp;amp;gt;||B||ID for this definition&lt;br /&gt;
|-&lt;br /&gt;
|40 + &amp;amp;lt;num-sprites&amp;amp;gt;||B||Number of following building sprites (the primary groundsprite mustn&#039;t be counted). Allowed range: 0x40+0 to 0x40+63 (0x40 to 0x7F).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|groundsprite]]&amp;amp;gt;||D||Primary ground sprite for the building (see format below)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Flags in advanced sprite layouts|flags]]&amp;amp;gt;||W||Flags for the primary ground sprite (see format below)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Register or value in advances sprite layouts|register/value]]&amp;amp;gt;||V||Registers / values to be used. Depending on &amp;amp;lt;flags&amp;amp;gt; (see format below)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|buildingsprite]]&amp;amp;gt;||D||The sprite to be drawn. Unlike the basic format, zero isn&#039;t allowed here.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Flags in advanced sprite layouts|flags]]&amp;amp;gt;||W||Flags for the building sprite (see format below)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;| -- for sprites defining a new bounding box --&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xofs&amp;amp;gt;||B||x-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yofs&amp;amp;gt;||B||y-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;zofs&amp;amp;gt;||B||z-offset from the ground&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xextent&amp;amp;gt;||B||size of sprite in x direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yextent&amp;amp;gt;||B||size of sprite in y direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;zextent&amp;amp;gt;||B||size of sprite in z direction&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;| -- for sprites sharing their bounding box with the previous sprite --&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xpixeloffset&amp;amp;gt;||B||x offset from the top left corner of the previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;ypixeloffset&amp;amp;gt;||B||y offset from the top left corner of the previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|80||B||a literal 80h byte to distinguish from new-bounding-box definitions&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Register or value in advances sprite layouts|register/value]]&amp;amp;gt;||V||Registers / values to be used. Depending on &amp;amp;lt;flags&amp;amp;gt; (see format below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Descriptions of elements ==&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;
=== Set-id ===&lt;br /&gt;
&lt;br /&gt;
The set-ID that you want to define for this set. You can choose any value between 00 and FF, and you can reuse them within a grf file at a later point (if being equal to an existing set ID, the existing one is overwritten and the new one is used).&lt;br /&gt;
&lt;br /&gt;
=== Sprite definition for ground and building sprites ===&lt;br /&gt;
&lt;br /&gt;
The ground and building sprite fields have the following format:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Bits!!Version!!Content&lt;br /&gt;
|-&lt;br /&gt;
|0-13||{{ottdp|0.6|2.5}}||Sprite number, exact meaning specified by bit 31&lt;br /&gt;
|-&lt;br /&gt;
|14-15||{{ottdp|0.6|2.5}}||0: draw sprite normally, 1: draw sprite in transparent mode, 2: recolor sprite&lt;br /&gt;
|-&lt;br /&gt;
|16-29||{{ottdp|0.6|2.5}}||Color translation special sprite number, see below&lt;br /&gt;
|-&lt;br /&gt;
|30||{{ottdp|0.6|2.5|ttdprev=alpha 57}}||If set, sprite is drawn normally even in transparent buildings mode (for building sprites only)&lt;br /&gt;
|-&lt;br /&gt;
|31||{{ottdp|0.6|2.5}}||Sprite type, see below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=alpha 57}} Since TTDPatch 2.0.1 alpha 57, the groundsprite value can be zero if no ground sprite is needed (this is useful if you need to draw custom foundations, see [[Callbacks#Decide drawing default foundations 30 14E 150|example]]). Ground sprites are always drawn normally, so bit 30 is ignored for them. Bit 30 may get a different meaning for ground sprites in a later version of TTDPatch, so please leave it zero for now. This does not apply to additional groundsprites using the &amp;quot;&amp;amp;lt;xpixeloffset&amp;amp;gt; &amp;amp;lt;ypixeloffset&amp;amp;gt; 80&amp;quot;-syntax (see above); for these bit 30 has the same meaning as for building sprites.&lt;br /&gt;
&lt;br /&gt;
==== Colour translation special sprite number ====&lt;br /&gt;
&lt;br /&gt;
This is used only if bits 14 or 15 are nonzero. Bits 16-29 must be the number of a regular TTD sprite containing a colour translation table (see below for available translation tables). For transparent mode, a suitable translation table is needed, e.g. that of TTD´s sprite number 802 (s.b.). See [[RecolorSprites]] for more information on the usage of transparent and recolouring sprites.&lt;br /&gt;
&lt;br /&gt;
For houses, if no recolour sprite is given but recolouring is turned on in bits 14-15, there are two possibilities:&lt;br /&gt;
* If you have [[Callbacks#Building colour (1E) |callback 1E]] enabled, it is called to determine the colour mapping.&lt;br /&gt;
* If [[Callbacks#Building colour (1E) |callback 1E]] is disabled or fails, one of the colours specified in property 17 will be chosen randomly.&lt;br /&gt;
&lt;br /&gt;
See [[RecolorSprites]] for a list of available colour translations.&lt;br /&gt;
&lt;br /&gt;
For industry tiles, if this field is zero, but recolouring is turned on in bits 14 or 15, the colour of the containing industry will automatically be applied.&lt;br /&gt;
&lt;br /&gt;
The ground sprite should be exactly the same size and shape as TTD&#039;s flat tile. In general, it shouldn&#039;t contain anything that has a z-dimension because any non-ground sprite will cover it.&lt;br /&gt;
&lt;br /&gt;
Useful values for ground sprites:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Sprite number (decimal)!!Contents&lt;br /&gt;
|-&lt;br /&gt;
|3924||bare land&lt;br /&gt;
|-&lt;br /&gt;
|3981||grass&lt;br /&gt;
|-&lt;br /&gt;
|4061||water&lt;br /&gt;
|-&lt;br /&gt;
|4550||snow or desert (depending on climate)&lt;br /&gt;
|-&lt;br /&gt;
|1420||concrete&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Please note that all the ground sprite becomes visible in &amp;quot;transparent buildings&amp;quot; mode, so you should draw parts that seem to be hidden as well.&lt;br /&gt;
&lt;br /&gt;
==== Sprite type ====&lt;br /&gt;
&lt;br /&gt;
If bit 31 is clear, the bottom 14 bits contain a regular TTD sprite number.&lt;br /&gt;
&lt;br /&gt;
If bit 31 is set, the bottom 14 bits contain a number of a sprite set in the most recent action 1, and the used sprite is decided according to the current construction state and the number of sprites in the set:&lt;br /&gt;
* if there&#039;s only one sprite, it&#039;s used always&lt;br /&gt;
* if there are two sprites, the first is used during construction (stages 0-2), and the second is used for the finished building (stage 3)&lt;br /&gt;
* if there are three sprites, the first will be used in the beginning of the construction (stage 0), the second will be used during the rest of the construction (stages 1 and 2) and the third will be used for the complete building (stage 3)&lt;br /&gt;
* if there are four or more sprites, the first four will be used for the four construction stages. Sprites after the first four are always ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flags in advanced sprite layouts ===&lt;br /&gt;
&amp;lt;flags&amp;gt; is a bitset of word size with these meanings:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Hex !! Parentsprite !! Groundsprite/Childsprite&lt;br /&gt;
|-&lt;br /&gt;
|| 0 || 0001 || Skip bounding box including child sprites || Skip sprite&lt;br /&gt;
|-&lt;br /&gt;
|| 1 || 0002 &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Add offset to sprite, disable default usage of construction stage or railtype-offset&lt;br /&gt;
|-&lt;br /&gt;
|| 2 || 0004 &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Add offset to recoloursprite&lt;br /&gt;
|-&lt;br /&gt;
|| 3 || 0008 &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Recolour sprite is from Action 1 (will be affected by the same construction stage resp. railtype-offsets as sprites, unless bit 2 is set)&lt;br /&gt;
|-&lt;br /&gt;
|| 4 || 0010 || Add offset for &amp;lt;xoffset&amp;gt; and &amp;lt;yoffset&amp;gt; || Add offset for &amp;lt;xpixeloffset&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| 5 || 0020 || Add offset for &amp;lt;zoffset&amp;gt; || Add offset for &amp;lt;ypixeloffset&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| 6 || 0040&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Resolve sprite with Variable 10 set to a specific value&amp;lt;ref name=&amp;quot;action123&amp;quot;&amp;gt;&lt;br /&gt;
Only valid for stations: The Action 1/2/3 chain is resolved multiple times, sprites can be part of different Action 1: The associated value in &amp;lt;register/value&amp;gt; is the raw value (not a register!) to put into Variable 10 while resolving the sprites.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;only allowed values currently 0-7&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;the value &#039;2&#039; is used when resolving custom foundations, (so, do not conflict with that)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;even if the sprite is not from an Action 1, the value still defines which Action2 chains defines the values for the referenced registers.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The register for &amp;quot;Add offset to recoloursprite&amp;quot; is defined by the Action 1/2/3 chain with Variable 10 as defined for the recolour sprite.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The other registers are defined by the Action 1/2/3 chain with Variable 10 as defined for the sprite.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If no variable 10 values are defined, then station property 13 bit 0 takes effect; i.e. variable 10 is set to 0 or 1 depending on the bit and whether the first groundsprite is resolved or a different sprite. This applies to both the groundsprite and the palette of the groundsprite.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| 7 || 0080&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Resolve recoloursprite with Variable 10 set to a specific value&amp;lt;ref name=&amp;quot;action123&amp;quot;/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| 8..15 || &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Reserved, should be zero. If the GRF sets unknown bits, it will be disabled.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Register or value in advanced sprite layouts ===&lt;br /&gt;
These are the temporary storage registers to add to the individual parts. The register values are considered signed.&lt;br /&gt;
The order of the registers is the same as the bits in &amp;lt;flags&amp;gt;. If a bit is not set, then no registers appears for it.&lt;br /&gt;
Most bits require one register.&lt;br /&gt;
*&amp;lt;xoffset&amp;gt; and &amp;lt;yoffset&amp;gt; can only be enabled together, using two registers,&lt;br /&gt;
*the &amp;quot;skip bounding box&amp;quot;-register uses value 1 to draw the sprite, and 0 to skip it,&lt;br /&gt;
*the &amp;quot;recolorsprite from Action 1&amp;quot; uses no register at all,&lt;br /&gt;
*the Variable 10 values are not set via a register, but via a byte-constant.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action2/Sprite_Layout&amp;diff=4659</id>
		<title>Action2/Sprite Layout</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action2/Sprite_Layout&amp;diff=4659"/>
		<updated>2023-11-30T20:24:10Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: add road stops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Action2 Sprite Layout =&lt;br /&gt;
{| |-&lt;br /&gt;
!Feature !! Version&lt;br /&gt;
|-&lt;br /&gt;
|Houses || {{ottdp|0.6|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|Industry Tiles || {{ottdp|0.6|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|Objects || {{ottdp|1.1|2.6|ttdprev=alpha r2023}}&lt;br /&gt;
|-&lt;br /&gt;
|Airport Tiles || {{ottdp|1.1|no}}&lt;br /&gt;
|-&lt;br /&gt;
|Road Stops || {{ottdp|14|no}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This Action2 defines a spritelayout for a tile. There are three formats available:&lt;br /&gt;
* Basic format for a single groundsprite and a single building sprite.&lt;br /&gt;
* Extended format for combining multiple sprites.&lt;br /&gt;
* Advanced format with register offsets&lt;br /&gt;
&lt;br /&gt;
== Basic format for tiles with a single building sprite ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; 02 07/09/0F/11/14 &amp;amp;lt;set-id&amp;amp;gt; 00 &amp;amp;lt;groundsprite&amp;amp;gt; &amp;amp;lt;buildingsprite&amp;amp;gt; &amp;amp;lt;xoffset&amp;amp;gt; &amp;amp;lt;yoffset&amp;amp;gt; &amp;amp;lt;xextent&amp;amp;gt; &amp;amp;lt;yextent&amp;amp;gt; &amp;amp;lt;zextent&amp;amp;gt;&amp;lt;/pre&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|Sprite-number]]&amp;amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Length|length]]&amp;amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|02||B||Defines action 02&lt;br /&gt;
|-&lt;br /&gt;
|07/09/0F/11/14||B||feature: 07 town buildings, 09 industry tiles, 0F objects, 11 airport tiles, or 14 road stops&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Set-id|set-id]]&amp;amp;gt;||B||ID for this definition&lt;br /&gt;
|-&lt;br /&gt;
|00||B||Literal 0 (to distinguish this definition from random/variational lists)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|groundsprite]]&amp;amp;gt;||D||Ground sprite for the building (see format below)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|buildingsprite]]&amp;amp;gt;||D||The sprite of the building (see format below), can be zero to indicate that no building sprite should be displayed (useful for early building stages)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xofs&amp;amp;gt;||B||x-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yofs&amp;amp;gt;||B||y-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xextent&amp;amp;gt;||B||size of sprite in x direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yextent&amp;amp;gt;||B||size of sprite in y direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;zextent&amp;amp;gt;||B||size of sprite in z direction&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the above, xofs, yofs, xextent, yextent and zextent define the 3D bounding box of the building sprite not including the ground sprite. The z-offset is always zero for buildings (TTD doesn&#039;t support floating buildings). Please note that xofs/xextent and yofs/yextent pairs that place the bounding box off the tile are not recommended.&lt;br /&gt;
&lt;br /&gt;
== Extended format using multiple combined sprites ==&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 55 vcs 3}} Since TTDPatch 2.0.1 alpha 55 vcs 3, houses, industry (and object) tiles support an extended syntax as well, which looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; 02 07/09/0F/11 &amp;amp;lt;set-id&amp;amp;gt; &amp;amp;lt;num-sprites&amp;amp;gt; &amp;amp;lt;groundsprite&amp;amp;gt; [&amp;amp;lt;buildingsprite&amp;amp;gt; (&amp;amp;lt;xoffset&amp;amp;gt; &amp;amp;lt;yoffset&amp;amp;gt; &amp;amp;lt;zoffset&amp;amp;gt; &amp;amp;lt;xextent&amp;amp;gt; &amp;amp;lt;yextent&amp;amp;gt; &amp;amp;lt;zextent&amp;amp;gt;) | (&amp;amp;lt;xpixeloffset&amp;amp;gt; &amp;amp;lt;ypixeloffset&amp;amp;gt; 80)] ...&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&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|Sprite-number]]&amp;amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Length|length]]&amp;amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|02||B||Defines action 02&lt;br /&gt;
|-&lt;br /&gt;
|07/09/0F/11/14||B||feature: 07 town buildings, 09 industry tiles, 0F objects, 11 airport tiles, or 14 road stops&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Set-id|set-id]]&amp;amp;gt;||B||ID for this definition&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;num-sprites&amp;amp;gt;||B||Number of following building sprites (the groundsprite mustn&#039;t be counted). Allowed range: 1 to 63 (0x01 to 0x3F). {{ottdp|1.2|no|ottdrev=r22518}} Adding 0x40 makes the layout an Advanced Spritelayout with register modifiers ([[Action2/Advanced Sprite Layout| see below]]).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|groundsprite]]&amp;amp;gt;||D||Ground sprite for the building (see format below)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;[[#Sprite definition for ground and building sprites|buildingsprite]]&amp;amp;gt;||D||The sprite to be drawn. Unlike the basic format, zero isn&#039;t allowed here.&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;| -- for sprites defining a new bounding box --&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xofs&amp;amp;gt;||B||x-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yofs&amp;amp;gt;||B||y-offset from northern tile corner (as a signed byte)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;zofs&amp;amp;gt;||B||z-offset from the ground&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xextent&amp;amp;gt;||B||size of sprite in x direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;yextent&amp;amp;gt;||B||size of sprite in y direction&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;zextent&amp;amp;gt;||B||size of sprite in z direction&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;| -- for sprites sharing their bounding box with the previous sprite --&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;xpixeloffset&amp;amp;gt;||B||x offset from the top left corner of the previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;ypixeloffset&amp;amp;gt;||B||y offset from the top left corner of the previous sprite&lt;br /&gt;
|-&lt;br /&gt;
|80||B||a literal 80h byte to distinguish from new-bounding-box definitions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: restrictions for sprites sharing their bounding box are the same as explained for [[Action0Stations#Sprite layout (09)|station tiles.]]&lt;br /&gt;
&lt;br /&gt;
{{ottd|0.7|r18959}} Since OpenTTD r18959 you can draw multiple ground sprites for a tile, which is useful if you want to use the usual grass/water/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.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|2.6|r2313}} The same feature is also partially supported in TTDPatch since TTDPatch 2.6 r2313: TTDPatch ignores the xpixeloffset and ypixeloffset 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 xpixeloffset and ypixeloffset zero to get the same effect in both games.&lt;br /&gt;
&lt;br /&gt;
{{:Action2/Advanced Sprite Layout}}&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4559</id>
		<title>User:Pikkabird</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4559"/>
		<updated>2023-09-25T05:59:13Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Sunshine standard cost calculations=&lt;br /&gt;
&lt;br /&gt;
For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers.&lt;br /&gt;
&lt;br /&gt;
==Running cost base multipliers in NFO / NML==&lt;br /&gt;
&lt;br /&gt;
* 07 / -1 locomotive purchase cost&lt;br /&gt;
* 0b /  3 locomotive running cost (steam locomotive basecost used for all locomotives, regardless of type)&lt;br /&gt;
* 0b /  3 wagon purchase cost&lt;br /&gt;
* 05 / -3 wagon running cost (diesel locomotive basecost used)&lt;br /&gt;
&lt;br /&gt;
* 0a /  2 road vehicle purchase cost&lt;br /&gt;
* 0a /  2 road vehicle running cost&lt;br /&gt;
&lt;br /&gt;
* 08 /  0 aircraft purchase cost&lt;br /&gt;
* 0d /  5 aircraft running cost&lt;br /&gt;
&lt;br /&gt;
I usually include a GRF parameter to halve all purchase and running costs (by decreasing the bases by 1).&lt;br /&gt;
&lt;br /&gt;
==Variable running cost==&lt;br /&gt;
&lt;br /&gt;
You should reduce the running costs of vehicles to 25% when the vehicle is stationary (current_speed == 0) for rail locomotives (ie not wagons), road vehicles and ships, or when an aircraft is on the ground (variable e6 != 12). This balancing feature improves profitability of shorter connections, vs the meta of building the longest possible routes from one side of the map to the other. &lt;br /&gt;
&lt;br /&gt;
==Cost formulas==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;p&amp;quot; may be either metric or imperial horsepower; these units are similar enough that the results will be comparable. For those using SI units, the conversion factor is 1 kW = 1.35 hp.&lt;br /&gt;
&lt;br /&gt;
* Locomotives: (p * 0.025) + (s * 0.1) + (c * 0.1) + ((2000 - y) * 0.1) &lt;br /&gt;
** Where p = power in hp, s = speed in km/h, y = year of introduction, c = passenger capacity.&lt;br /&gt;
&lt;br /&gt;
* Wagons: (s * 0.5) + (c * l)&lt;br /&gt;
** Where s = speed in km/h, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight).&lt;br /&gt;
&lt;br /&gt;
* Road Vehicles: (p * 0.1) + (c * l) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where p =  power in hp, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight), y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Aircraft: (s * s / 25000) + (c * 0.2) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where s = speed in km/h, c = passenger capacity, y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Ships: TBD&lt;br /&gt;
&lt;br /&gt;
If you have very overpowered vehicles in your set, the calculated numbers may exceed 255; in that case, you&#039;ll have to increase the relevant bases by 1, and divide costs by 2.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4558</id>
		<title>User:Pikkabird</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4558"/>
		<updated>2023-09-25T05:58:06Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Sunshine standard cost calculations=&lt;br /&gt;
&lt;br /&gt;
For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers. The standard base multipliers for Sunshine are:&lt;br /&gt;
&lt;br /&gt;
==Running cost bases in NFO / NML==&lt;br /&gt;
&lt;br /&gt;
* 07 / -1 locomotive purchase cost&lt;br /&gt;
* 0b /  3 locomotive running cost (steam locomotive basecost used for all locomotives, regardless of type)&lt;br /&gt;
* 0b /  3 wagon purchase cost&lt;br /&gt;
* 05 / -3 wagon running cost (diesel locomotive basecost used)&lt;br /&gt;
&lt;br /&gt;
* 0a /  2 road vehicle purchase cost&lt;br /&gt;
* 0a /  2 road vehicle running cost&lt;br /&gt;
&lt;br /&gt;
* 08 /  0 aircraft purchase cost&lt;br /&gt;
* 0d /  5 aircraft running cost&lt;br /&gt;
&lt;br /&gt;
I usually include a GRF parameter to halve all purchase and running costs (by decreasing the bases by 1).&lt;br /&gt;
&lt;br /&gt;
==Variable running cost==&lt;br /&gt;
&lt;br /&gt;
You should reduce the running costs of vehicles to 25% when the vehicle is stationary (current_speed == 0) for rail locomotives (ie not wagons), road vehicles and ships, or when an aircraft is on the ground (variable e6 != 12). This balancing feature improves profitability of shorter connections, vs the meta of building the longest possible routes from one side of the map to the other. &lt;br /&gt;
&lt;br /&gt;
==Cost formulas==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;p&amp;quot; may be either metric or imperial horsepower; these units are similar enough that the results will be comparable. For those using SI units, the conversion factor is 1 kW = 1.35 hp.&lt;br /&gt;
&lt;br /&gt;
* Locomotives: (p * 0.025) + (s * 0.1) + (c * 0.1) + ((2000 - y) * 0.1) &lt;br /&gt;
** Where p = power in hp, s = speed in km/h, y = year of introduction, c = passenger capacity.&lt;br /&gt;
&lt;br /&gt;
* Wagons: (s * 0.5) + (c * l)&lt;br /&gt;
** Where s = speed in km/h, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight).&lt;br /&gt;
&lt;br /&gt;
* Road Vehicles: (p * 0.1) + (c * l) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where p =  power in hp, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight), y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Aircraft: (s * s / 25000) + (c * 0.2) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where s = speed in km/h, c = passenger capacity, y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Ships: TBD&lt;br /&gt;
&lt;br /&gt;
If you have very overpowered vehicles in your set, the calculated numbers may exceed 255; in that case, you&#039;ll have to increase the relevant bases by 1, and divide costs by 2.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4557</id>
		<title>User:Pikkabird</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4557"/>
		<updated>2023-09-25T05:57:52Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Cost calculations=&lt;br /&gt;
&lt;br /&gt;
For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers. The standard base multipliers for Sunshine are:&lt;br /&gt;
&lt;br /&gt;
==Running cost bases in NFO / NML==&lt;br /&gt;
&lt;br /&gt;
* 07 / -1 locomotive purchase cost&lt;br /&gt;
* 0b /  3 locomotive running cost (steam locomotive basecost used for all locomotives, regardless of type)&lt;br /&gt;
* 0b /  3 wagon purchase cost&lt;br /&gt;
* 05 / -3 wagon running cost (diesel locomotive basecost used)&lt;br /&gt;
&lt;br /&gt;
* 0a /  2 road vehicle purchase cost&lt;br /&gt;
* 0a /  2 road vehicle running cost&lt;br /&gt;
&lt;br /&gt;
* 08 /  0 aircraft purchase cost&lt;br /&gt;
* 0d /  5 aircraft running cost&lt;br /&gt;
&lt;br /&gt;
I usually include a GRF parameter to halve all purchase and running costs (by decreasing the bases by 1).&lt;br /&gt;
&lt;br /&gt;
==Variable running cost==&lt;br /&gt;
&lt;br /&gt;
You should reduce the running costs of vehicles to 25% when the vehicle is stationary (current_speed == 0) for rail locomotives (ie not wagons), road vehicles and ships, or when an aircraft is on the ground (variable e6 != 12). This balancing feature improves profitability of shorter connections, vs the meta of building the longest possible routes from one side of the map to the other. &lt;br /&gt;
&lt;br /&gt;
==Cost formulas==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;p&amp;quot; may be either metric or imperial horsepower; these units are similar enough that the results will be comparable. For those using SI units, the conversion factor is 1 kW = 1.35 hp.&lt;br /&gt;
&lt;br /&gt;
* Locomotives: (p * 0.025) + (s * 0.1) + (c * 0.1) + ((2000 - y) * 0.1) &lt;br /&gt;
** Where p = power in hp, s = speed in km/h, y = year of introduction, c = passenger capacity.&lt;br /&gt;
&lt;br /&gt;
* Wagons: (s * 0.5) + (c * l)&lt;br /&gt;
** Where s = speed in km/h, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight).&lt;br /&gt;
&lt;br /&gt;
* Road Vehicles: (p * 0.1) + (c * l) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where p =  power in hp, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight), y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Aircraft: (s * s / 25000) + (c * 0.2) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where s = speed in km/h, c = passenger capacity, y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Ships: TBD&lt;br /&gt;
&lt;br /&gt;
If you have very overpowered vehicles in your set, the calculated numbers may exceed 255; in that case, you&#039;ll have to increase the relevant bases by 1, and divide costs by 2.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4556</id>
		<title>User:Pikkabird</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4556"/>
		<updated>2023-09-25T05:51:40Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Cost calculations=&lt;br /&gt;
&lt;br /&gt;
For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers. The standard base multipliers are:&lt;br /&gt;
&lt;br /&gt;
==Running cost bases in NFO / NML==&lt;br /&gt;
&lt;br /&gt;
* 07 / -1 locomotive purchase cost&lt;br /&gt;
* 0b /  3 locomotive running cost (steam locomotive basecost used for all locomotives, regardless of type)&lt;br /&gt;
* 0b /  3 wagon purchase cost&lt;br /&gt;
* 05 / -3 wagon running cost (diesel locomotive basecost used)&lt;br /&gt;
&lt;br /&gt;
* 0a /  2 road vehicle purchase cost&lt;br /&gt;
* 0a /  2 road vehicle running cost&lt;br /&gt;
&lt;br /&gt;
* 08 /  0 aircraft purchase cost&lt;br /&gt;
* 0d /  5 aircraft running cost&lt;br /&gt;
&lt;br /&gt;
I usually include a GRF parameter to halve all purchase and running costs (by decreasing the bases by 1).&lt;br /&gt;
&lt;br /&gt;
==Variable running cost==&lt;br /&gt;
&lt;br /&gt;
You should reduce the running costs of vehicles to 25% when the vehicle is stationary (current_speed == 0) for rail locomotives (ie not wagons), road vehicles and ships, or when an aircraft is on the ground (variable e6 != 12). This balancing feature improves profitability of shorter connections, vs the meta of building the longest possible routes from one side of the map to the other. &lt;br /&gt;
&lt;br /&gt;
==Cost formulas==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;p&amp;quot; may be either metric or imperial horsepower; these units are similar enough that the results will be comparable. For those using SI units, the conversion factor is 1 kW = 1.35 hp.&lt;br /&gt;
&lt;br /&gt;
* Locomotives: (p * 0.025) + (s * 0.1) + (c * 0.1) + ((2000 - y) * 0.1) &lt;br /&gt;
** Where p = power in hp, s = speed in km/h, y = year of introduction, c = passenger capacity.&lt;br /&gt;
&lt;br /&gt;
* Wagons: (s * 0.5) + (c * l)&lt;br /&gt;
** Where s = speed in km/h, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight).&lt;br /&gt;
&lt;br /&gt;
* Road Vehicles: (p * 0.1) + (c * l) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where p =  power in hp, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight), y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Aircraft: (s * s / 25000) + (c * 0.2) + ((2000 - y) * 0.1)&lt;br /&gt;
** Where s = speed in km/h, c = passenger capacity, y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
* Ships: TBD&lt;br /&gt;
&lt;br /&gt;
If you have very overpowered vehicles in your set, the calculated numbers may exceed 255; in that case, you&#039;ll have to increase the relevant bases by 1, and divide costs by 2.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4555</id>
		<title>User:Pikkabird</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=User:Pikkabird&amp;diff=4555"/>
		<updated>2023-09-25T05:48:48Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: Created page with &amp;quot;Cost calculations: For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers. The standard base multipliers are:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cost calculations:&lt;br /&gt;
For ease of balancing, vehicles use the same number for purchase and running cost, but with different base multipliers. The standard base multipliers are:&lt;br /&gt;
&lt;br /&gt;
Running cost bases in NFO / NML:&lt;br /&gt;
07 / -1 locomotive purchase cost&lt;br /&gt;
0b /  3 locomotive running cost (steam locomotive basecost used for all locomotives, regardless of type)&lt;br /&gt;
0b /  3 wagon purchase cost&lt;br /&gt;
05 / -3 wagon running cost (diesel locomotive basecost used)&lt;br /&gt;
&lt;br /&gt;
0a /  2 road vehicle purchase cost&lt;br /&gt;
0a /  2 road vehicle running cost&lt;br /&gt;
&lt;br /&gt;
08 /  0 aircraft purchase cost&lt;br /&gt;
0d /  5 aircraft running cost&lt;br /&gt;
&lt;br /&gt;
I usually include a GRF parameter to halve all purchase and running costs (by decreasing the bases by 1).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variable running cost:&lt;br /&gt;
&lt;br /&gt;
You should reduce the running costs of vehicles to 25% when the vehicle is stationary (current_speed == 0) for rail locomotives (ie not wagons), road vehicles and ships, or when an aircraft is on the ground (variable e6 != 12). This balancing feature improves profitability of shorter connections, vs the meta of building the longest possible routes from one side of the map to the other. &lt;br /&gt;
&lt;br /&gt;
Cost formulas:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;p&amp;quot; may be either metric or imperial horsepower; these units are similar enough that the results will be comparable. For those using SI units, the conversion factor is 1 kW = 1.35 hp.&lt;br /&gt;
&lt;br /&gt;
Locomotives: (p * 0.025) + (s * 0.1) + (c * 0.1) + ((2000 - y) * 0.1) &lt;br /&gt;
Where p = power in hp, s = speed in km/h, y = year of introduction, c = passenger capacity.&lt;br /&gt;
&lt;br /&gt;
Wagons: (s * 0.5) + (c * l)&lt;br /&gt;
Where s = speed in km/h, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight).&lt;br /&gt;
&lt;br /&gt;
Road Vehicles: (p * 0.1) + (c * l) + ((2000 - y) * 0.1)&lt;br /&gt;
Where p =  power in hp, c = capacity, l = &amp;quot;luxury&amp;quot; value (1 for passengers, 0.5 for freight), y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
Aircraft: (s * s / 25000) + (c * 0.2) + ((2000 - y) * 0.1)&lt;br /&gt;
Where s = speed in km/h, c = passenger capacity, y = year of introduction.&lt;br /&gt;
&lt;br /&gt;
Ships: TBD&lt;br /&gt;
&lt;br /&gt;
If you have very overpowered vehicles in your set, the calculated numbers may exceed 255; in that case, you&#039;ll have to increase the relevant bases by 1, and divide costs by 2.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=4554</id>
		<title>NML:Airports</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Airports&amp;diff=4554"/>
		<updated>2023-09-24T01:34:53Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: grf -&amp;gt; airport in tile check&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
&lt;br /&gt;
Airports and airport tiles can only be defined in OpenTTD {{ottd|1.1|r19459}} or later.&lt;br /&gt;
&lt;br /&gt;
==Airport (tile) IDs==&lt;br /&gt;
Airport and airport tile IDs are local to the NewGRF, you are free to choose any ID in the 0..255-range. For airport tiles, you should start your item definition with the &#039;substitute&#039;-property, which allocates a new airport tile. The value of this property should be the ID of a [[AirportTileDefaultProps|default airport tile]], which will be used instead of your item if it is not available for whatever reason (for example, missing NewGRF).&lt;br /&gt;
&lt;br /&gt;
Furthermore, you can set the &#039;override&#039;-property, which will cause the existing airport tile to be replaced with your item. For airports, there only is an &#039;override&#039;-property, which acts as a combined substitute and override.&lt;br /&gt;
&lt;br /&gt;
==Airport properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} The id of airport to replace / override, see [[AirportTypes]]. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| layouts&lt;br /&gt;
| list of layouts&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20377}}&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Name of the airport&lt;br /&gt;
|-&lt;br /&gt;
| years_available&lt;br /&gt;
| [start year, last year]&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} List of the availablility years: first and last year it can be built&lt;br /&gt;
|-&lt;br /&gt;
| ttd_airport-type&lt;br /&gt;
| 0 ... 3&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Substitute TTDPatch airport type&lt;br /&gt;
|-&lt;br /&gt;
| catchment_area&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Catchment area of the airport in tiles around its perimeter&lt;br /&gt;
|-&lt;br /&gt;
| noise_level&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19459}} Noise generation of this airport&lt;br /&gt;
|-&lt;br /&gt;
| maintenance_cost&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.2|r23415}} Maintenance cost factor for this airport&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport tile properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| override&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to override, see [[AirportTypes]]. &#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| substitute&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} The id of airport tile to replace&lt;br /&gt;
|-&lt;br /&gt;
| callback_flags&lt;br /&gt;
| bitmask&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} Do not set this, unless you use [[NML:Old style callbacks|old-style callbacks]].&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
|{{ottd|1.1|r19204}} 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;
|&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} See [[NML:Animation speed|speed settings]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(ANIM_TRIGGER_APT_XXX, ... )&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r19204}} Bitmask of triggers that will trigger the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; callback, see the [[#Animation triggers|table]] below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport variables==&lt;br /&gt;
&lt;br /&gt;
A number of variables are shared between airports and stations. These are listed on the [[NML:Stations#Base station variables|stations]] page.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| layout&lt;br /&gt;
| 0 .. (number of layouts - 1)&lt;br /&gt;
|&lt;br /&gt;
{{ottd|1.1|r20364}} Layout number of the airport (index in the layouts array)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport tile variables==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| town_radius_group&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| relative_x&lt;br /&gt;
| 0..255&lt;br /&gt;
| X-coordinate (top right -&amp;amp;gt; bottom left) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_y&lt;br /&gt;
| 0..255&lt;br /&gt;
| Y-coordinate (top left -&amp;amp;gt; bottom right) of the tile relative to the northernmost tile.&lt;br /&gt;
|-&lt;br /&gt;
| relative_pos&lt;br /&gt;
| 0xYYXX&lt;br /&gt;
|&lt;br /&gt;
A combination of relative_x and relative_y in the format 0xYYXX. Useful if you want to check for a single position. The [[NML:Builtin functions|builtin function]] relative_coord(x, y) may be useful when making comparisons.&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station parts (rail station parts, airports tiles, ...)&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables require a signed x,y offset as parameters. The offset is relative to the current tile. Offset 0,0 means the current tile.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of tile slopes|tile slopes]] for an overview of possible values&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_same_airport&lt;br /&gt;
| 1 if the tile is part of the same airport, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| 0..120&lt;br /&gt;
| The height of the lowest corner of the given tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_airporttile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an airport tile that is part of this GRF, the tile id is aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original airport tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an airport tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an airport tile or it belongs to another airport.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Airport callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite set (with 1 sprite)&lt;br /&gt;
| Preview graphics to use in the build menu. One sprite per layout may be given, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; to distinguish between layouts.&lt;br /&gt;
|-&lt;br /&gt;
| additional_text&lt;br /&gt;
| String&lt;br /&gt;
| Additional text to show in the buy menu. String may differ per layout, use the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable for this.&lt;br /&gt;
|-&lt;br /&gt;
| layout_name&lt;br /&gt;
| String&lt;br /&gt;
| Name of the airport layout in the variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that, although the airport isn&#039;t built yet, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;layout&amp;lt;/code&amp;gt; variable is always available and set to the layout the user has selected in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Airport tile callbacks==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| Sprite layout&lt;br /&gt;
| Graphics for an airport tile&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for callback trigger, see the [[#Animation triggers|table]] below. Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| CB_RESULT[_NO]_FOUNDATIONS&lt;br /&gt;
| Return CB_RESULT_FOUNDATIONS to draw standard foundations (default) or CB_RESULT_NO_FOUNDATIONS to not draw them.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Animation triggers===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Animation trigger&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_BUILT&lt;br /&gt;
| Airport is built (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_TILELOOP&lt;br /&gt;
| Airport tile is processed in the tileloop (at different times for different tiles)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_NEW_CARGO&lt;br /&gt;
| New cargo arrives at the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_CARGO_TAKEN&lt;br /&gt;
| All cargo of a cargo type is removed from the airport (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_250_TICKS&lt;br /&gt;
| Every 250 ticks (all tiles at the same time)&lt;br /&gt;
|-&lt;br /&gt;
| ANIM_TRIGGER_APT_AIRPLANE_LANDS&lt;br /&gt;
| {{ottd|1.9}} Triggered when an airplane (not a helicopter!) lands at airport (single tile only)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryCommonVariables&amp;diff=4553</id>
		<title>NML:IndustryCommonVariables</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:IndustryCommonVariables&amp;diff=4553"/>
		<updated>2023-09-24T01:31:31Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: /* Common variables */ returns -1 if belongs to another *industry*, not &amp;quot;another grf&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Common variables==&lt;br /&gt;
&lt;br /&gt;
The following variables are available to both industries and industry tiles. All of them require an x, y offset. For industries, this offset is unsigned and relative to the northernmost tile. For industry tiles, it is signed and relative to the current tile.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
|&lt;br /&gt;
See [[NML:List of tile slopes|tile slopes]] for an overview of possible values&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| 0..120&lt;br /&gt;
| The height of the lowest corner of the given tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_industrytile_id&lt;br /&gt;
| 0x00aa, 0xFFbb, 0xFFFE or 0xFFFF&lt;br /&gt;
| 0x00aa: The tile is an industry tile defined in this GRF with tile id aa.&amp;lt;br /&amp;gt; 0xFFbb: The tile is an original industry tile with id bb.&amp;lt;br /&amp;gt; 0xFFFE: The tile is an industry tile defined in another GRF.&amp;lt;br /&amp;gt; 0xFFFF: The tile is not an industry tile or it belongs to another industry.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Industries&amp;diff=4167</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=4167"/>
		<updated>2022-02-04T05:43:49Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: /* Industry callbacks */&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;
| cargo_types&lt;br /&gt;
| array of accept_cargo(input, outputs...) and produce_cargo(output, level) expressions&lt;br /&gt;
| {{nml|0.5}} {{ottd|1.9}} Types of cargo accepted and produced by the industry, and their production levels and production multipliers. See [[#Cargo_types_array|cargo types array]] below.&lt;br /&gt;
|-&lt;br /&gt;
| prod_cargo_types&lt;br /&gt;
| array of up to 2 ints&lt;br /&gt;
| {{nml|0.4}} Types of cargo produced. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable. {{nml|0.5}} Removed, use cargo_types instead.&lt;br /&gt;
|-&lt;br /&gt;
| accept_cargo_types&lt;br /&gt;
| array of up to 3 ints&lt;br /&gt;
| {{nml|0.4}} Types of cargo accepted. Use the cargotype(&amp;amp;lt;label&amp;amp;gt;) built-in function to specify a label from the cargotable. {{nml|0.5}} Removed, use cargo_types instead.&lt;br /&gt;
|-&lt;br /&gt;
| prod_multiplier&lt;br /&gt;
| array of up to 2 ints (0..255)&lt;br /&gt;
| {{nml|0.4}} Amount of each output cargo to produce every 256 ticks (8 or 9 times a month) {{nml|0.5}} Removed, use cargo_types instead.&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;
| (up to NML v5796-418, use prob_map_gen otherwise) Probability of occurring while generating initial industries. If the random game probability value is nonzero and IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION is not set, at least one instance of this type is guaranteed to appear on the map.&lt;br /&gt;
|-&lt;br /&gt;
| prob_map_gen&lt;br /&gt;
| 0..255&lt;br /&gt;
| (NML v5796-418 or newer) Probability of occurring while generating initial industries. If the random game probability value is nonzero and IND_FLAG_DO_NOT_FORCE_INSTANCE_AT_MAP_GENERATION is not set, 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;
| {{nml|0.4}} Output cargo multiplication factors for getting a unit of the first accepted cargo. {{nml|0.5}} Removed, use cargo_types instead.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_2&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| {{nml|0.4}} Output cargo multiplication factors for getting a unit of the second accepted cargo. {{nml|0.5}} Removed, use cargo_types instead.&lt;br /&gt;
|-&lt;br /&gt;
| input_multiplier_3&lt;br /&gt;
| array of up to 2 floats (0..255)&lt;br /&gt;
| {{nml|0.4}} Output cargo multiplication factors for getting a unit of the third accepted cargo. {{nml|0.5}} Removed, use cargo_types instead.&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;
===Cargo types array===&lt;br /&gt;
The &#039;&#039;cargo_types&#039;&#039; property takes an array of accept_cargo and produce_cargo expressions. This array is used to define which cargo types the industry accepts, which it produces, and how much cargo is produced on production ticks and on delivery. All cargo types the industry handles must be mentioned in its &#039;&#039;cargo_types&#039;&#039; property even when they are handled by production callbacks.&lt;br /&gt;
&lt;br /&gt;
The following is an example of a &#039;&#039;cargo_types&#039;&#039; property:&lt;br /&gt;
&lt;br /&gt;
 cargo_types: [&lt;br /&gt;
   produce_cargo(&amp;quot;GOOD&amp;quot;, 4),&lt;br /&gt;
   accept_cargo(&amp;quot;PASS&amp;quot;),&lt;br /&gt;
   produce_cargo(&amp;quot;PASS&amp;quot;, 0),&lt;br /&gt;
   accept_cargo(&amp;quot;IORE&amp;quot;, produce_cargo(&amp;quot;STEL&amp;quot;, 1), produce_cargo(&amp;quot;SLAG&amp;quot;, 0.25))&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
The above example has four items in its &#039;&#039;cargo_types&#039;&#039; array, two produce_cargo expressions and two accept_cargo expressions.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;produce_cargo(&amp;quot;GOOD&amp;quot;, 4)&amp;lt;/code&amp;gt; specifies the industry produces GOOD at a rate of 4 every production tick (256 game ticks), this production rate is scaled by the industry&#039;s production level.&lt;br /&gt;
# &amp;lt;code&amp;gt;accept_cargo(&amp;quot;PASS&amp;quot;)&amp;lt;/code&amp;gt; specifies the industry accepts PASS as a &amp;quot;black hole&amp;quot;, that is no cargo is produced when PASS is delivered. If you have a production callback that consumes a cargo you will also need to specify that cargo in this way.&lt;br /&gt;
# &amp;lt;code&amp;gt;produce_cargo(&amp;quot;PASS&amp;quot;, 0)&amp;lt;/code&amp;gt; specifies the industry produces PASS but not on the production ticks as usual. Specifying a production rate of zero is only useful for cargo types you produce via a production callback.&lt;br /&gt;
# &amp;lt;code&amp;gt;accept_cargo(&amp;quot;IORE&amp;quot;, produce_cargo(...), ...)&amp;lt;/code&amp;gt; specifies the industry produces the listed cargo types every time IORE is delivered. In the example above, delivering one IORE will result in one STEL produced and no SLAG produced (because 1*0.25 is zero after rounding down), and delivering 4 IORE will result in 4 STEL and 1 SLAG produced.&lt;br /&gt;
&lt;br /&gt;
At most 16 different cargo labels may appear in accept_cargo and at most 16 different cargo labels in produce_cargo, for a single industry. The same cargo label can be used in as many accept_cargo or produce_cargo as necessary.&lt;br /&gt;
&lt;br /&gt;
More complex production rules can be set up via the production callbacks, see [[#Industry_callbacks|callbacks]] below.&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;
| IND_FLAG_LONG_CARGO_TYPE_LISTS&lt;br /&gt;
| New format for callbacks &amp;lt;code&amp;gt;callbacks cargo_subtype_display&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cargo_input&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; cargo_output&amp;lt;/code&amp;gt; to support more input/output cargos. See the callbacks for details.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;incoming_cargo_waiting&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;incoming_cargo_waiting&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;incoming_cargo_waiting&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed. Use &amp;lt;code&amp;gt;produced_cargo_waiting&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed. Use &amp;lt;code&amp;gt;produced_cargo_waiting&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;this_month_production&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;this_month_production&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;last_month_production&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;last_month_production&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;this_month_transported&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;this_month_transported&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;last_month_transported&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.   Use &amp;lt;code&amp;gt;last_month_transported&amp;lt;/code&amp;gt; instead.&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. {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;transported_last_month_pct&amp;lt;/code&amp;gt; instead.&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.  {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;transported_last_month_pct&amp;lt;/code&amp;gt; instead.&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.  {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;production_rate&amp;lt;/code&amp;gt; instead.&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.  {{nml|0.5}} Removed.  Use &amp;lt;code&amp;gt;production_rate&amp;lt;/code&amp;gt; instead.&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;
| incoming_cargo_waiting&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} If any of the production callbacks is enabled, this variable will contain the amount of the cargo type waiting to be processed.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;incoming_cargo_waiting(&amp;quot;FOOD&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| produced_cargo_waiting&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, the amount of produced cargo that this waiting to be transported.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;produced_cargo_waiting(&amp;quot;GOOD&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| this_month_production&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, amount of cargo that was produced this month.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;this_month_production(&amp;quot;COAL&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| last_month_production&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, amount of cargo that was produced last month.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;last_month_production(&amp;quot;WOOD&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| this_month_transported&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, amount of produced cargo that was transported this month.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;this_month_transported(&amp;quot;IORE&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| last_month_transported&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, amount of produced cargo that was transported last month.  Returns 0..65535.  Example: &amp;lt;code&amp;gt;last_month_transported(&amp;quot;PAPR&amp;quot;)&amp;lt;/code&amp;gt;. &lt;br /&gt;
|-&lt;br /&gt;
| transported_last_month_pct&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, percentage of produced cargo that was transported last month.  Returns 0..100.  Example: &amp;lt;code&amp;gt;transported_last_month_pct(&amp;quot;BATT&amp;quot;)&amp;lt;/code&amp;gt;. &lt;br /&gt;
|-&lt;br /&gt;
| production_rate&lt;br /&gt;
| cargo label from the cargotable&lt;br /&gt;
| {{nml|0.5}} For the given cargo label, amount of output cargo that is produced every 256 ticks. Initial value from the &amp;lt;code&amp;gt;cargo_types&amp;lt;/code&amp;gt; property, but it will change accordingly when the production level changes.  Returns 0..255.  Example: &amp;lt;code&amp;gt;production_rate(&amp;quot;SUGR&amp;quot;)&amp;lt;/code&amp;gt;. &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;
| [[NML:Produce|Produce-block]]&lt;br /&gt;
| Called to produce cargo when it arrives.&lt;br /&gt;
|-&lt;br /&gt;
| produce_256_ticks&lt;br /&gt;
| [[NML:Produce|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, CB_RESULT_NO_TEXT or CB_RESULT_IND_NO_TEXT_NO_AMOUNT&lt;br /&gt;
| This callback allows displaying some text after a cargo name. Returning&lt;br /&gt;
* CB_RESULT_NO_TEXT displays only waiting amount of cargo,&lt;br /&gt;
* CB_RESULT_IND_NO_TEXT_NO_AMOUNT displays only the cargotype.&lt;br /&gt;
&lt;br /&gt;
Note: To remove cargo waiting text, return &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0x3800 + string(STR_EMPTY)&amp;lt;/code&amp;gt; where STR_EMPTY is an empty string in your lang file.&lt;br /&gt;
&lt;br /&gt;
If IND_FLAG_LONG_CARGO_TYPE_LISTS is not set:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: 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;
If IND_FLAG_LONG_CARGO_TYPE_LISTS is set:&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: 0 for output cargos, 1 for input cargos.&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;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Cargo type.&lt;br /&gt;
&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 when the industry is built. 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>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Houses&amp;diff=4166</id>
		<title>Action0/Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Houses&amp;diff=4166"/>
		<updated>2022-02-01T02:13:29Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: rem bad and outdated advice. Modern town sets can be as complex as industry sets, generally don&amp;#039;t work well when more than one is loaded at once, and should not be expected to &amp;quot;leave space&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
For town buildings (or simply houses), the offset defines the first house ID for this action 0. House IDs, like station IDs, are unique within each grf file, and in total each game can only have 255 IDs in TTDPatch and 512 IDs in OpenTTD for all active grf files.&lt;br /&gt;
&lt;br /&gt;
To start using a house ID, you must first define it by setting its property 08 (see below). If you try to modify a house ID whose property 08 isn&#039;t set, your request is ignored, but not reported as an error, either.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description&lt;br /&gt;
|-&lt;br /&gt;
|08||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Substitute building type&lt;br /&gt;
|-&lt;br /&gt;
|09||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Building flags&lt;br /&gt;
|-&lt;br /&gt;
|0A||W||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Availability years&lt;br /&gt;
|-&lt;br /&gt;
|0B||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Population&lt;br /&gt;
|-&lt;br /&gt;
|0C||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Mail generation multiplier&lt;br /&gt;
|-&lt;br /&gt;
|0D||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Passenger acceptance&lt;br /&gt;
|-&lt;br /&gt;
|0E||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Mail acceptance&lt;br /&gt;
|-&lt;br /&gt;
|0F||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Goods, food or fizzy drinks acceptance&lt;br /&gt;
|-&lt;br /&gt;
|10||W||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||LA rating decrease on removal (should be set to the same value for every tile for multi-tile buildings)&lt;br /&gt;
|-&lt;br /&gt;
|11||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Removal cost multiplier (should be set to the same value for every tile for multi-tile buildings)&lt;br /&gt;
|-&lt;br /&gt;
|12||W||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Building name ID&lt;br /&gt;
|-&lt;br /&gt;
|13||W||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Building availability mask&lt;br /&gt;
|-&lt;br /&gt;
|14||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||House callback flags&lt;br /&gt;
|-&lt;br /&gt;
|15||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||House override byte&lt;br /&gt;
|-&lt;br /&gt;
|16||B||{{ottdp|0.6|2.5|ttdprev=alpha 34}}||Periodic refresh multiplier&lt;br /&gt;
|-&lt;br /&gt;
|17||4*B||{{ottdp|0.6|2.5|ttdprev=alpha 35}}||Four random colours to use&lt;br /&gt;
|-&lt;br /&gt;
|18||B||{{ottdp|0.6|2.5|ttdprev=alpha 35}}||Relative probability of appearing&lt;br /&gt;
|-&lt;br /&gt;
|19||B||{{ottdp|0.6|2.5|ttdprev=alpha 38}}||Extra flags&lt;br /&gt;
|-&lt;br /&gt;
|1A||B||{{ottdp|0.6|2.5|ttdprev=alpha 39}}||Animation frames&lt;br /&gt;
|-&lt;br /&gt;
|1B||B||{{ottdp|0.6|2.5|ttdprev=alpha 39}}||Animation speed&lt;br /&gt;
|-&lt;br /&gt;
|1C||B||{{ottdp|0.6|2.5|ttdprev=alpha 43}}||Class of the building type&lt;br /&gt;
|-&lt;br /&gt;
|1D||B||{{ottdp|0.6|2.5|ttdprev=alpha 55 vcs 2}}||Callback flags 2&lt;br /&gt;
|-&lt;br /&gt;
|1E||D||{{ottdp|0.6|2.5|ttdprev=alpha 55 vcs 2}}||Accepted cargo types&lt;br /&gt;
|-&lt;br /&gt;
|1F||W||{{ottdp|0.6|2.6|ttdprev=r1554}}||Minimum life span in years&lt;br /&gt;
|-&lt;br /&gt;
|20||W||{{ottdp|1.2|2.6|ottdrev=r23072|ttdprev=r1677}}||Cargo acceptance watch list&lt;br /&gt;
|-&lt;br /&gt;
|21||W||{{ottdp|0.7|no|ottdrev=r13437}}||Long year (zero based) of minimum appearance&lt;br /&gt;
|-&lt;br /&gt;
|22||W||{{ottdp|0.7|no|ottdrev=r13437}}||Long year (zero based) of maximum appearance&lt;br /&gt;
|-&lt;br /&gt;
|23||V||{{ottdp|1.9|no|ottdrev=48b334cf}}||Tile acceptance list &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a town decides to expand, each active house type (both old and new ones) has a uniform probability to appear, so the more new houses you define, the fewer old TTD buildings will appear.&lt;br /&gt;
&lt;br /&gt;
== Descriptions ==&lt;br /&gt;
&lt;br /&gt;
=== Substitute building type (08) ===&lt;br /&gt;
&lt;br /&gt;
This building type will be used instead of your new one if your definition isn&#039;t available for any reason (the grf file is not found, for example).&lt;br /&gt;
&lt;br /&gt;
Don&#039;t set a substitute building type that is larger than your new one (for example, don&#039;t set 14 (stadium) for an 1x1 building) because this may corrupt savegames. Setting this property automatically copies every property of the substitute building to your new building, so you don&#039;t have to change properties that are the same as the substitute.&lt;br /&gt;
&lt;br /&gt;
House flags 40 and 80 are exceptions; these flags are never set automatically. Only the first property 08 setting copies properties; if you later change it, properties will stay.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a special use of this property beginning from alpha 72: if you set it to FFh, you can disable an old house type. In this case, the ID used must be the number of old house type you want to disable. Disabling only prevents building the type in towns; houses already present on the map will stay unchanged. The type can still be overridden, and overriding affects houses present on the map.&lt;br /&gt;
&lt;br /&gt;
If this house&#039;s action 3 appears before this property is set, the action 3 will have no effect.&lt;br /&gt;
&lt;br /&gt;
=== Building flags (09) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||This is a 1x1 building&lt;br /&gt;
|-&lt;br /&gt;
|1||2||This building can be built only on flat land (if clear, foundations are automatically displayed on sloped land)&lt;br /&gt;
|-&lt;br /&gt;
|2||4||This is a 2x1 building&amp;lt;ref name=&amp;quot;large&amp;quot;&amp;gt;If your building isn&#039;t 1x1, set flags for the north tile, then define the next 1 or 3 tiles tiles (by setting their property 8). The only bit that can be set in the flags of additional tiles is bit 5 (animation). There should be no property 8 setting between the first tile and the additional tiles.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3||8||This is a 1x2 building&amp;lt;ref name=&amp;quot;large&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|4||10||This is a 2x2 building&amp;lt;ref name=&amp;quot;large&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;For 2x2 buildings, the first additional tile is the east one, the second is the west part and the third is the south part. You probably want to set the substitute for additional tiles to a TTD additional tile whose flags are already zero. 2x2 buildings are always built on flat land no matter how bit 1 is set.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|5||20||Animation flag, set in tiles 04 and 05 (large office block). New buildings have a different animation scheme than large office blocks, but animation is still enabled with this bit.&amp;lt;ref&amp;gt;The animation flag works on a per-tile basis, so you should enable it for additional tiles of multi-tile buildings as well if you want all tiles to be animated.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|6||40||This building is a church&amp;lt;ref name=&amp;quot;only1&amp;quot;&amp;gt;Only one church and one stadium can exist in a town. The town won&#039;t build buildings with the according flag set until the old church/stadium is removed. (This can be done by either the town or a player)&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|7||80||This building is a stadium&amp;lt;ref name=&amp;quot;only1&amp;quot; /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Availability years (0A) ===&lt;br /&gt;
&lt;br /&gt;
The low byte is the minimum year, the high is the maximum. The building can only be built between these two years (inclusive). 1920 is added to both bytes before using the values.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no| }}&lt;br /&gt;
Since the year counting stops in TTDPatch in 2070 even with [[ttwiki:EternalGame|EternalGame]] on, start years above 150 mean &amp;quot;never&amp;quot;, and end years above 150 mean &amp;quot;forever&amp;quot;. In OpenTTD there is no limit for the maximum year (resp. it is 5000000).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039; Don&#039;t set the start year below 1930 (0Ah) unless you know what you&#039;re doing!&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} If TTDPatch finds a building that is available before 1930, it will not build old building types until that year, so you have to provide at least one custom building type that is available before 1930 for every [[TownZones|town zone]], or TTD may deadlock while trying to create a random game or expand a town.&lt;br /&gt;
&lt;br /&gt;
{{ottd|}} The availability of all active houses with the lowest availability year is set to start from year 0, so that always at least one house is available irrespective of starting year. Thus, if you de-activate default houses or set an introduction date prior to the default houses introduction year 1930, you should have at least for each [[TownZones|town zone]] a house with the same earliest availability year or you might end up with a situation where no house can be placed in a [[TownZones|town zone]].&lt;br /&gt;
&lt;br /&gt;
=== Population (0B) and Mail generation multiplier (0C) ===&lt;br /&gt;
[[Image:House_production.png|frame|right|Actual house production roughly depends on squared value of the population / mail generation multiplier.]]&lt;br /&gt;
&lt;br /&gt;
The population of the town will be increased by the amount set in prop. 0B if this building is built. Additional house parts should have a population of zero. The higher this value is, the more passengers this building generates.&lt;br /&gt;
&lt;br /&gt;
The higher the mail generation multiplier is, the more mail the building generates. For multi-tile buildings, mail generation is done in per-tile basis, so you can specify different values for every tile, although distributing the generation equally between tiles is suggested.&lt;br /&gt;
&lt;br /&gt;
This is how exactly passengers are generated: In each periodic processing (i.e. every 256 ticks), a random value 0&amp;lt;=X&amp;lt;=255 is generated for each house tile. If X isn&#039;t smaller than the population of the tile, no passengers are generated. Otherwise, X/8+1 passengers are generated (rounded down). If there is a recession going on, the number of generated passengers is halved, but this division gets rounded up instead of down. Mail generation happens in a similar manner, but with a new random value, and checking against the mail generation multiplier instead of the population.&lt;br /&gt;
&lt;br /&gt;
You can further customize how the cargo is generated with the [[Callbacks#Custom_cargo_production_.282E.29 |callback 2E]].&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Passenger (0D), Mail (0E) and Good/Food/Fizzy drinks (0F) acceptance ===&lt;br /&gt;
&lt;br /&gt;
The acceptance is given in units of 1/8th and must not be larger than 8 eighths.&lt;br /&gt;
&lt;br /&gt;
For property 0F, positive values indicate that the building accepts goods, and negative values (i.e. FF = 1/8th, FE = 2/8ths etc.) indicate acceptance of food or fizzy drinks, depending on the climate.&lt;br /&gt;
&lt;br /&gt;
All the above three values can be set independently for tiles of multi-tile buildings, since every tile is processed individually when determining what a station accepts.&lt;br /&gt;
&lt;br /&gt;
The type of accepted cargo can be modified using [[Action0Houses#Accepted_cargo_types|property 1E]].&lt;br /&gt;
&lt;br /&gt;
{{ottdp|no| }} Note that in TTDPatch the officefood switch may modify acceptance in the sub-arctic and subtropical climates.&lt;br /&gt;
&lt;br /&gt;
=== Building name ID (12) ===&lt;br /&gt;
&lt;br /&gt;
The ID of the text that should be displayed in the land query window. The name can also be set by [[Action4|action 4]] (see there). Should be set to the same value for every tile for multi-tile buildings.&lt;br /&gt;
&lt;br /&gt;
=== Building availability mask (13) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0..4||1,2,4,8,10||which [[VariationalAction2/Houses#Town zone (42)|town zone(s)]] the building can be built in&lt;br /&gt;
|-&lt;br /&gt;
|11||800||can appear in sub-arctic climate above the snow line&lt;br /&gt;
|-&lt;br /&gt;
|12||1000||can appear in temperate climate&lt;br /&gt;
|-&lt;br /&gt;
|13||2000||can appear in sub-arctic climate below the snow line&lt;br /&gt;
|-&lt;br /&gt;
|14||4000||can appear in subtropical climate&lt;br /&gt;
|-&lt;br /&gt;
|15||8000||can appear in toyland climate&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This property should be set to zero for additional building tiles.&lt;br /&gt;
&lt;br /&gt;
=== House callback flags (14,1D) ===&lt;br /&gt;
&lt;br /&gt;
For houses, the following [[callbacks]] can be defined by setting the corresponding bit in property 14:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Variable 0C value!!Version!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||17||{{ottdp| | }}||decide whether the house can be built on a given tile&lt;br /&gt;
|-&lt;br /&gt;
|1||2||1A||{{ottdp| | }}||decide the following frame of the animations&lt;br /&gt;
|-&lt;br /&gt;
|2||4||1B||{{ottdp| | }}||periodically start/stop the animation&lt;br /&gt;
|-&lt;br /&gt;
|3||8||1C||{{ottdp| | }}||change animation when construction state changes&lt;br /&gt;
|-&lt;br /&gt;
|4||10||1E||{{ottdp| | }}||decide the color of the building&lt;br /&gt;
|-&lt;br /&gt;
|5||20||1F||{{ottdp| | }}||decide the cargos amounts accepted&lt;br /&gt;
|-&lt;br /&gt;
|6||40||20||{{ottdp| | }}||decide the length of the current animation frame&lt;br /&gt;
|-&lt;br /&gt;
|7||80||21||{{ottdp| | }}||trigger destruction of building&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Property 1D was introduced after all bits of property 14 were filled. Its usage is the same, only the meaning of bits is different:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Variable 0C value!!Version!!Callback&lt;br /&gt;
|-&lt;br /&gt;
|0||1||2A||{{ottdp| | }}||decide the cargo types accepted&lt;br /&gt;
|-&lt;br /&gt;
|1||2||2E||{{ottdp| | }}||custom cargo production&lt;br /&gt;
|-&lt;br /&gt;
|2||4||143||{{ottdp| | }}||conditional protection&lt;br /&gt;
|-&lt;br /&gt;
|3||8||14E||{{ottdp|1.0|2.6|ottdrev=r17558|ttdprev=2249}}||decide if default foundations need to be drawn&lt;br /&gt;
|-&lt;br /&gt;
|4||10||14F||{{ottdp|1.0|2.6|ottdrev=r17558|ttdprev=2249}}||allow or deny autosloping below the tile&lt;br /&gt;
|}&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 variational Action2 for callbacks.&lt;br /&gt;
&lt;br /&gt;
Callback flags are ignored for additional building tiles.&lt;br /&gt;
&lt;br /&gt;
=== House override byte (15) ===&lt;br /&gt;
&lt;br /&gt;
Setting this property makes this building appear instead of the given old TTD building type. Setting the property is ignored if the given old house type is already overridden. You can set this property more than once to override more old building types.&lt;br /&gt;
&lt;br /&gt;
No new house of the overridden types will be built in towns.&lt;br /&gt;
&lt;br /&gt;
This property works in a per-tile basis, so you override tiles of old multi-tile buildings individually, although the old type will still be built if you don&#039;t override its north tile.&lt;br /&gt;
&lt;br /&gt;
=== Periodic refresh multiplier (16) ===&lt;br /&gt;
&lt;br /&gt;
This is used for random triggers, and sets how often the tile is re-randomized. When set to X, the tile will be re-randomized on every (X+1)-th periodic processing. (In other words, every (X+1)*256 game ticks.) If you want all tiles to be re-randomized, you must set this (but not necessarily to the same value) for each tile.&lt;br /&gt;
&lt;br /&gt;
If callback 1B is enabled in property 14, it is also called after re-randomizing random bits.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.1|2.5|ttdprev=2.5 beta 9}} In TTDPatch versions before TTDPatch 2.6 r1639 and TTDPatch 2.5 beta 9 (including beta 9), this variable could have any value between 0 and 255. After these versions, the upper limit has been lowered to 63. To maintain compatibility, values above 63 will be interpreted as 63.&lt;br /&gt;
&lt;br /&gt;
=== Random colours (17) ===&lt;br /&gt;
&lt;br /&gt;
This specifies four colors used for random painting (see [[Action2HousesIndustryTiles]]). Each byte of the dword defines a color, the values are the same as in Action2, except that numbering starts from zero instead of 775. If not set, this defaults to 04 08 0c 06 (red, blue, orange and green, the colors of the modern office building). Can be set to different values for tiles of multi-tile buildings.&lt;br /&gt;
&lt;br /&gt;
=== Probability (18) ===&lt;br /&gt;
&lt;br /&gt;
This sets the relative probability of this house being built. Old TTD house types have a probability of 16, and this is the default for new types as well.&lt;br /&gt;
&lt;br /&gt;
Increase (or better multiply) this value to make your building appear relatively more often, or decrease (divide) it to make it rarer. If you set this to zero, the house type never appears. The minimal useful value 1 means it&#039;s sixteen times less probable to build this type than a normal type, while the maximum setting of 255 means it&#039;s almost sixteen times more probable.&lt;br /&gt;
&lt;br /&gt;
The probability is relative since the absolute probability depends on the count and probability of other houses as well: the more types are available (and the higher their probabilities are), the less the chance is that your type will be chosen.&lt;br /&gt;
&lt;br /&gt;
=== Extra Flags (19) ===&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Value!!Version!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0||1||{{ottdp|0.6|2.5}}||This building appears during the generation of a town, but not later, i.e. will appear in random games, but new ones won&#039;t be built during the game. Useful for buildings that are intended to be historical.&lt;br /&gt;
|-&lt;br /&gt;
|1||2||{{ottdp|0.6|2.5}}||This building is protected, i.e. towns and AI players won&#039;t remove it. Human players can still remove it, so you may need to set a high remove cost/rating to make them think twice.&lt;br /&gt;
|-&lt;br /&gt;
|2||4||{{ottdp|0.6|2.5}}||Synchronized [[Callbacks#Animation_control_.281B.2F25.2F140.2F152.2F159.29| callback 1B]]. (for multi-tile buildings)&amp;lt;ref&amp;gt;If synchronized callbacks are enabled, callback 1B will be called when the periodic processing reaches the main tile of the building, and not when it reaches the current tile. This is useful if your animation must run synchronously on every tile of the building. If this bit is set, callback 1B is called according to the main tile&#039;s property 16, not the current one, to make sure every tile stays in sync.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3||8||{{ottdp|0.6|2.5|ttdprev=beta 2}}||[[Callbacks#Next animation frame (1A/26/141/153/158) |Callback 1A]] needs random bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Animation Frames (1A) ===&lt;br /&gt;
&lt;br /&gt;
The bottom seven bits define how many frames the animation consists of, minus one. (I.e. 0 means 1 frame, 1 means 2 frames etc.) The highest bit has another purpose (see below), so the biggest supported value is 7F (128 frames).&lt;br /&gt;
&lt;br /&gt;
The highest bit is set if the animation is looping, i.e. it should start again from the first frame after showing the last frame. Non-looping animations stop after the last frame, leaving it on the screen. Both kinds of animations start automatically when the building is created. It&#039;s recommended to use callback 1B with non-looping animations, so they are played multiple times.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.6|2.5|ottdrev=r12347|ttdprev=r1639}} In TTDPatch versions before TTDPatch 2.6 r1639 and TTDPatch 2.5 beta 9 (including beta 9) and OpenTTD before r12347, the frame number was limited to 32. If you intend to maintain compatibility with those versions, you should not use animations longer than 32 frames.&lt;br /&gt;
&lt;br /&gt;
=== Animation Speed (1B) ===&lt;br /&gt;
&lt;br /&gt;
This is the amount of time between switching frames.&lt;br /&gt;
&lt;br /&gt;
The default value is 2, which means the switch occurs every 108 milliseconds. Increasing this value by one doubles the wait, i.e. 3 will cause 216 ms delay, while 4 will pause 432 ms, and so on. Values below 2 have the same effect as 2, so the default is the fastest possible setting. The maximum is 16, which means 1769 seconds (approx. half an hour) delay. Settings above this value may cause strange behaviour.&lt;br /&gt;
&lt;br /&gt;
=== Building Class (1C) ===&lt;br /&gt;
&lt;br /&gt;
Types that were given the same class byte are considered to be in the same class. If you don&#039;t explicitly set this value, the type is considered to have no class (it won&#039;t be considered to be class 0). The scope of a class is the current GRF file, so two types are never in the same class if they were defined by different GRF files. Currently, this property affects variable 44 only.&lt;br /&gt;
&lt;br /&gt;
This property is a per-tile one, you can set it for additional tiles as well. It&#039;s a better idea, however, to set it for the main tile only, since var. 44 counts tiles, not buildings, and you may count multi-tile multiple times otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Accepted cargo types (1E) ===&lt;br /&gt;
&lt;br /&gt;
There may be cases when you want your house to accept something other than the default types (passenger, mail, goods and food). This property allows you to do that. If this property is set to FFFFFFFFh (the default), the meaning of properties 0D, 0E and 0F aren&#039;t changed, that is, they are the passenger, mail and goods/food acceptances, accordingly. If this property isn&#039;t FFFFFFFFh, the first three bytes must be climate-dependent cargo slot numbers (the fourth byte is ignored). In this case property 0D is the amount of acceptance of the first cargo type given, 0E is the same for the second type and 0F is the same for the third type.&lt;br /&gt;
&lt;br /&gt;
From GRF version 7 and above, the meaning of this property changes: instead of climate-dependent cargo slot numbers, you have to give climate-independent cargo IDs. If your GRF has a cargo translation table, then this ID is the index in that table; otherwise, it&#039;s the cargo slot number. Acceptance of cargoes not currently present will automatically be disabled.&lt;br /&gt;
&lt;br /&gt;
=== Minimum life span in years (1F) ===&lt;br /&gt;
&lt;br /&gt;
Towns are prevented from destroying the house if it hasn&#039;t yet reached the age given here. The default is 0, which means towns are free to remove the house any time they like. Please note that this setting doesn&#039;t prevent AI players from removing the house; only towns are affected. If you need to protect your building from AI players as well, you can set the &amp;quot;protected&amp;quot; flag (property 19 bit 1), or use [[Callbacks#Protect building conditionally (143) |callback 143]] and use your custom code to decide who (and when) is allowed to remove the building.&lt;br /&gt;
&lt;br /&gt;
For this to operate consequently on multi-tile buildings, you must set the same minimum lifespan for all tiles of the building.&lt;br /&gt;
&lt;br /&gt;
=== Cargo acceptance watch list (20) ===&lt;br /&gt;
&lt;br /&gt;
This property is a list of cargo types, types whose acceptance should be watched. The first byte is the length of the list, the remaining bytes identify cargo types. {{grfFrom|7}} If your GRF is version 7 or above, and has a cargo translation table, the bytes are indexes in the table; otherwise, they are cargo slot numbers. When a cargo from this list is accepted by the current tile, [[Callbacks#Watched cargo accepted (148) |callback 148]] is called on &#039;&#039;all&#039;&#039; tiles of the building. See [[Callbacks#Watched cargo accepted (148) |callback 148]] for more details about how this happens.&lt;br /&gt;
&lt;br /&gt;
{{ttdp|}} This property has no effect if the station2 structure isn&#039;t present. The station2 structure is present if any of the following is true:&lt;br /&gt;
* Generalfixes is on, and miscmods.noextendstationrange is off&lt;br /&gt;
* Any of fifoloading, newcargos or irregularstations is on&lt;br /&gt;
&lt;br /&gt;
=== Availability years (long format) - Minimum (21) - Maximum (22) ===&lt;br /&gt;
&lt;br /&gt;
Those two properties allow to specify a range of dates (based on year zero(0) that are not limited to the 1930 dates. So earlier buildings can be introduced. Be sure to add substantial houses to the sets, if you do not wat to have uniform towns, since the current earliest houses will remain in their current 1920 era. Mind also the warning wrt. introduction years as described at property 0A.&lt;br /&gt;
&lt;br /&gt;
=== Tile acceptance list (23) ===&lt;br /&gt;
{{ottdp|1.9|no|ottdrev=48b334cf}} &lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
 &amp;lt;numinput&amp;gt; (&amp;lt;cargotype&amp;gt; &amp;lt;acceptance&amp;gt;)*&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Size!!Variable!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|B||numinput||Number of (&amp;lt;cargotype&amp;gt; &amp;lt;acceptance&amp;gt;) pairs to follow,&lt;br /&gt;
|-&lt;br /&gt;
|B||cargotype||Cargotype (from CTT) to accept.&lt;br /&gt;
|-&lt;br /&gt;
|B||acceptance||Acceptance in 1/8 units.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This property defines up to 16 cargotypes, which are accepted by the house.&lt;br /&gt;
Use this property instead of property 0D..0F.&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=DefaultHouseProps&amp;diff=923</id>
		<title>DefaultHouseProps</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=DefaultHouseProps&amp;diff=923"/>
		<updated>2005-12-12T02:38:37Z</updated>

		<summary type="html">&lt;p&gt;Pikkabird: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Default property values for TTD&#039;s houses&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Default House Properties=&lt;br /&gt;
&lt;br /&gt;
Default property values for TTD&#039;s houses&lt;br /&gt;
&lt;br /&gt;
This page is largely a copy of housedata.html, from &amp;lt;nowiki&amp;gt;http://users.tt-forums.net/csaboka/ttdpatch/housetut.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This list contains all properties of default TTD house types, allowing you to know what will be copied to your new house ID when you set its property 8, and can also be used for reference when deciding what properties your new house should have. House names are taken from Marcin Grzegorczyk&#039;s &amp;amp;quot;Transport Tycoon Deluxe savegame internals&amp;amp;quot; file, which has more descriptive names than the original TTD ones. Unfortunately, even these names aren&#039;t unique, either. The &amp;amp;quot;Flags&amp;amp;quot; column lists what will be set to your new building&#039;s property 9 (that&#039;s why their church and stadium flags aren&#039;t set). Negative goods acceptance means that the building accepts food/candy instead of goods/fizzy drinks. &amp;amp;quot;None&amp;amp;quot; in the max. year column means that the building type never becomes obsolete. The rest of the columns is pretty self-explanatory.&lt;br /&gt;
&lt;br /&gt;
|| ID| Name| Climates | Town zones| Flags| Min. build year| Max. build year| Population| Mail generation| Passenger acceptance (in 1/8 units)| Mail acceptance (in 1/8 units)| Goods/food acceptance (in 1/8 units)| Remove ratings decrease| Remove cost multiplier&lt;br /&gt;
&lt;br /&gt;
00h| tall office block| temperate| 4| 01h| 1963 | none| 187| 70| 8| 3| 4| 140| 150&lt;br /&gt;
&lt;br /&gt;
01h| office block| temperate| 3, 4| 01h| 1957| none| 85| 55 | 8| 3| 4| 130| 140&lt;br /&gt;
&lt;br /&gt;
02h| small block of flats| temperate | 1, 2, 3| 01h| 1968| none| 40| 20| 8| 3| 1 | 90| 100&lt;br /&gt;
&lt;br /&gt;
03h| church| temperate| 0, 1, 2, 3| 01h| 1930 | none| 5| 2| 2| 0| 0| 230| 90&lt;br /&gt;
&lt;br /&gt;
04h| large office block| temperate, sub-arctic, subtropical| 4| 21h| 1975| none| 220| 85| 10| 4| 6| 160| 160&lt;br /&gt;
&lt;br /&gt;
05h| large office block| snow | 4| 21h| 1975| none| 220| 85| 10| 4| 6 | 160| 160&lt;br /&gt;
&lt;br /&gt;
06h| town houses| temperate| 0, 1, 2, 3| 01h| 1930| none| 30| 12| 4| 1| 0| 80| 80&lt;br /&gt;
&lt;br /&gt;
07h| hotel (N part)| temperate| 2, 4| 08h| 1959| none| 140| 22 | 6| 1| 2| 150| 180&lt;br /&gt;
&lt;br /&gt;
08h| hotel (E part)| | | 00h| 1959| none| 0| 22| 6| 1| 2| 150 | 180&lt;br /&gt;
&lt;br /&gt;
09h| statue| temperate, sub-arctic, subtropical| 3, 4| 01h| 1945| none | 0| 0| 2| 0| 0| 40| 65&lt;br /&gt;
&lt;br /&gt;
0Ah | fountain | temperate, sub-arctic, subtropical| 4| 01h| 1945| none| 0| 0| 2 | 0| 0| 40| 65&lt;br /&gt;
&lt;br /&gt;
0Bh| park (with a pond)| temperate| 2 | 01h| 1930| none| 0| 0| 2| 0| 0| 75 | 60&lt;br /&gt;
&lt;br /&gt;
0Ch| park (with an alley)| temperate| 3| 01h| 1935| none| 0| 0| 2| 0| 0| 75| 60&lt;br /&gt;
&lt;br /&gt;
0Dh | office block | temperate| 3, 4| 01h| 1951| none| 150| 65| 8 | 2| 4| 110| 130&lt;br /&gt;
&lt;br /&gt;
0Eh| shops and offices 1| temperate| 2, 3, 4 | 01h| 1930| 1960| 95| 48| 6| 2| 3| 100 | 110&lt;br /&gt;
&lt;br /&gt;
0Fh| shops and offices 2| temperate| 2, 3, 4| 01h| 1930| 1960 | 95| 48| 6| 2| 3| 100| 105&lt;br /&gt;
&lt;br /&gt;
10h | shops and offices 3 | temperate| 2, 3, 4| 01h| 1930| 1960| 95| 48| 6 | 2| 3| 100| 107&lt;br /&gt;
&lt;br /&gt;
11h| modern office building| temperate, sub-arctic, subtropical| 4 | 01h| 1977| none| 130| 50| 10| 3| 6| 150 | 200&lt;br /&gt;
&lt;br /&gt;
12h| warehouse| temperate| 4| 01h| 1983| none | 6| 10| 6| 3| 8| 110| 145&lt;br /&gt;
&lt;br /&gt;
13h | office block (with spiral stairway) | temperate| 4| 01h| 1985| none| 110| 55| 6| 2| 6| 110| 155&lt;br /&gt;
&lt;br /&gt;
14h| stadium (N part)| temperate| 0, 1, 2, 3| 10h| 1930| none| 65| 5| 4| 0| 0| 300 | 250&lt;br /&gt;
&lt;br /&gt;
15h| stadium (E part)| | | 00h| 1930| none| 0 | 5| 4| 0| 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
16h| stadium (W part) | | | 00h| 1930| none| 0| 5| 4| 0| 0 | 300| 250&lt;br /&gt;
&lt;br /&gt;
17h| stadium (S part)| | | 00h| 1930| none | 0| 5| 4| 0| 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
18h | old houses | temperate| 0, 1| 01h| 1930| 1951| 15| 6| 3 | 1| 0| 75| 70&lt;br /&gt;
&lt;br /&gt;
19h| cottages| temperate| 0| 01h| 1930| 1952| 12| 7| 3| 1| 0| 75 &amp;amp;nbsp; | 75&lt;br /&gt;
&lt;br /&gt;
1Ah| houses| temperate| 0, 1, 2, 3| 01h| 1931| none | 13| 8| 3| 1| 0| 75| 71&lt;br /&gt;
&lt;br /&gt;
1Bh &amp;amp;nbsp;| flats | temperate| 2, 3, 4| 01h| 1935| none| 100| 35| 7 &amp;amp;nbsp;| 2| 2| 100| 135&lt;br /&gt;
&lt;br /&gt;
1Ch| tall office block| temperate| 2, 3, 4 | 01h| 1963| none| 170| 50| 8| 3| 3| 170 | 145&lt;br /&gt;
&lt;br /&gt;
1Dh| shops and offices| temperate| 2, 3, 4| 01h| 1930| 1955 | 100| 40| 6| 2| 3| 135| 132&lt;br /&gt;
&lt;br /&gt;
1Eh | shops and offices | temperate, subtropical| 2, 4| 01h| 1973| none| 180| 64| 8 &amp;amp;nbsp;| 3| 3| 180| 155&lt;br /&gt;
&lt;br /&gt;
1Fh| theatre| temperate| 3, 4 | 01h| 1930| none| 35| 23| 8| 2| 2| 230 | 220&lt;br /&gt;
&lt;br /&gt;
20h| stadium (modern style, N part)| temperate, sub-arctic, subtropical| 0, 1, 2, 3| 10h| 1958| none | 65| 5| 4| 0| 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
21h | stadium (modern style, E part) | | | 00h| 1958| none| 0| 5| 4| 0 | 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
22h| stadium (modern style, W part)| | | 00h| 1958 | none| 0| 5| 4| 0| 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
23h| stadium (modern style, S part)| | | 00h| 1958| none| 0| 5| 4 | 0| 0| 300| 250&lt;br /&gt;
&lt;br /&gt;
24h| offices (&#039;vertical tube&#039; style)| temperate, sub-arctic, subtropical| 3, 4 | 01h| 2000| none| 140| 65| 8| 3| 2| 250 | 170&lt;br /&gt;
&lt;br /&gt;
25h| houses| sub-arctic| 0, 1| 01h| 1930| 1960 | 15| 6| 3| 1| -1| 75| 70&lt;br /&gt;
&lt;br /&gt;
26h | houses | snow| 0, 1| 01h| 1930| 1960| 15| 6| 3 | 1| -1| 75| 70&lt;br /&gt;
&lt;br /&gt;
27h| cinema| temperate| 2, 3, 4 | 01h| 1945| none| 35| 23| 8| 2| 2| 230 | 210&lt;br /&gt;
&lt;br /&gt;
28h| shopping mall (N part)| temperate| 1, 2, 3, 4| 10h| 1983| none | 180| 5| 8| 2| 3| 300| 250&lt;br /&gt;
&lt;br /&gt;
29h &amp;amp;nbsp;| shopping mall (E part) | | | 00h| 1983| none| 0| 5| 8| 2 | 3| 300| 250&lt;br /&gt;
&lt;br /&gt;
2Ah| shopping mall (W part)| | | 00h| 1983| none| 0| 5| 8| 2| 3| 300| 250&lt;br /&gt;
&lt;br /&gt;
2Bh| shopping mall (S part)| | | 00h| 1983| none| 0| 5| 8 | 2| 3| 300| 250&lt;br /&gt;
&lt;br /&gt;
2Ch| flats| sub-arctic| 2, 3, 4| 01h| 1930| none| 80| 20| 5| 2| -2| 90| 100&lt;br /&gt;
&lt;br /&gt;
2Dh| flats| snow| 2, 3, 4| 01h| 1930| none | 80| 20| 5| 2| -2| 90| 100&lt;br /&gt;
&lt;br /&gt;
2Eh | houses | sub-arctic| 0, 1, 2, 3| 01h| 1930| none| 16| 6| 3| 1| -2| 70| 70&lt;br /&gt;
&lt;br /&gt;
2Fh| houses| snow| 0, 1, 2, 3 | 01h| 1930| none| 16| 6| 3| 1| -2| 70 | 70&lt;br /&gt;
&lt;br /&gt;
30h| houses| sub-arctic| 0, 1, 2| 01h| 1930| 1963 | 14| 6| 3| 1| -2| 70| 80&lt;br /&gt;
&lt;br /&gt;
31h | houses | snow| 0, 1, 2| 01h| 1930| 1963| 14| 6| 3 | 1| -2| 70| 80&lt;br /&gt;
&lt;br /&gt;
32h| tall office block| sub-arctic, subtropical| 3, 4 | 01h| 1966| none| 135| 60| 8| 3| 4| 120| 150&lt;br /&gt;
&lt;br /&gt;
33h| tall office block| snow| 3, 4| 01h| 1966| none | 135| 60| 8| 3| 4| 120| 150&lt;br /&gt;
&lt;br /&gt;
34h | tall office block | sub-arctic| 3, 4| 01h| 1970| none| 170| 70| 9 | 3| 4| 130| 170&lt;br /&gt;
&lt;br /&gt;
35h| tall office block| snow| 3, 4 | 01h| 1970| none| 170| 70| 9| 3| 4| 130 | 170&lt;br /&gt;
&lt;br /&gt;
36h| tall office block| sub-arctic, subtropical| 3, 4| 01h| 1974| none | 210| 80| 10| 3| 5| 140| 200&lt;br /&gt;
&lt;br /&gt;
37h | tall office block | snow| 3, 4| 01h| 1974| none| 210| 80| 10 | 3| 5| 140| 200&lt;br /&gt;
&lt;br /&gt;
38h| houses| sub-arctic| 0 | 01h| 1930| none| 10| 5| 2| 1| -1| 60| 60&lt;br /&gt;
&lt;br /&gt;
39h| houses| snow| 0| 01h| 1930| none | 10| 5| 2| 1| -1| 60| 60&lt;br /&gt;
&lt;br /&gt;
3Ah | shops and offices | sub-arctic| 1, 2, 3, 4| 01h| 1930| none| 25| 20| 3 | 1| -1| 80| 100&lt;br /&gt;
&lt;br /&gt;
3Bh| shops and offices| snow| 1, 2, 3, 4 | 01h| 1930| none| 25| 20| 3| 1| -1| 80 | 100&lt;br /&gt;
&lt;br /&gt;
3Ch| church| sub-arctic| 0, 1, 2, 3| 01h| 1930| none | 6| 2| 2| 0| 0| 230| 85&lt;br /&gt;
&lt;br /&gt;
3Dh &amp;amp;nbsp;| church | snow| 0, 1, 2, 3| 01h| 1930| none| 6| 2| 2| 0| 0| 230| 85&lt;br /&gt;
&lt;br /&gt;
3Eh| houses| sub-arctic| 0, 1, 2 | 01h| 1930| none| 17| 7| 3| 1| -1| 80| 80&lt;br /&gt;
&lt;br /&gt;
3Fh| houses| snow| 0, 1, 2| 01h| 1930| none | 17| 7| 3| 1| -1| 80| 80&lt;br /&gt;
&lt;br /&gt;
40h | shops and offices | sub-arctic| 2, 3, 4| 01h| 1930| 1960| 90| 45| 6 | 2| 3| 110| 140&lt;br /&gt;
&lt;br /&gt;
41h| shops and offices| snow| 2, 3, 4 | 01h| 1930| 1960| 90| 45| 6| 2| 3| 110 | 140&lt;br /&gt;
&lt;br /&gt;
42h| hotel (N part)| sub-arctic| 2, 3, 4| 08h| 1972| none | 140| 25| 6| 1| -3| 160| 160&lt;br /&gt;
&lt;br /&gt;
43h | hotel (E part) | | | 00h| 1972| none| 0| 25| 6| 1 | 2| 160| 160&lt;br /&gt;
&lt;br /&gt;
44h| hotel (N part)| snow| 2, 3, 4| 08h | 1972| none| 140| 25| 6| 1| -3| 160| 160&lt;br /&gt;
&lt;br /&gt;
45h| hotel (E part)| | | 00h| 1972| none| 0| 25| 6| 1| 2| 160| 160&lt;br /&gt;
&lt;br /&gt;
46h| shops and offices| sub-arctic, subtropical | 2, 3, 4| 01h| 1963| none| 105| 50| 7| 2| 3 | 105| 130&lt;br /&gt;
&lt;br /&gt;
47h| shops and offices| snow| 2, 3, 4| 01h| 1963 | none| 105| 50| 7| 2| 3| 105| 130&lt;br /&gt;
&lt;br /&gt;
48h| tall office block| sub-arctic| 3, 4| 01h| 1978| none| 190| 75 | 9| 3| 4| 135| 190&lt;br /&gt;
&lt;br /&gt;
49h| tall office block| snow| 3, 4| 01h| 1978| none| 190| 75| 9| 3| 4| 135| 190&lt;br /&gt;
&lt;br /&gt;
4Ah| tall office block (N part)| sub-arctic| 2, 3, 4| 04h| 1967| none| 250| 60| 7| 2| 2| 200| 140&lt;br /&gt;
&lt;br /&gt;
4Bh| tall office block (W part)| | | 00h| 1967| none| 0| 60| 7 | 2| 2| 200| 140&lt;br /&gt;
&lt;br /&gt;
4Ch| tall office block (N part)| snow| 2, 3, 4| 04h| 1967| none| 250| 60| 7| 2| 2| 200 | 140&lt;br /&gt;
&lt;br /&gt;
4Dh| tall office block (W part)| | | 00h| 1967| none| 0 | 60| 7| 2| 2| 200| 140&lt;br /&gt;
&lt;br /&gt;
4Eh| houses (with a tree in a corner)| subtropical| 1, 2, 3, 4| 01h| 1930| none| 16| 6| 3| 1| -2| 80| 80&lt;br /&gt;
&lt;br /&gt;
4Fh| houses| subtropical| 1, 2, 3, 4| 01h | 1930| none| 16| 6| 3| 1| -2| 80| 80&lt;br /&gt;
&lt;br /&gt;
50h| houses| subtropical| 1, 2, 3, 4| 01h| 1930| none| 16| 5| 3| 1| -2| 80| 80&lt;br /&gt;
&lt;br /&gt;
51h| houses (suburb-type) | subtropical| 0| 01h| 1930| none| 7| 4| 3| 1| -1| 30| 30&lt;br /&gt;
&lt;br /&gt;
52h| flats| subtropical| 2, 3, 4| 01h| 1930| none| 45| 15| 6| 2| 1| 95| 130&lt;br /&gt;
&lt;br /&gt;
53h| church| subtropical| 1, 2, 3| 01h| 1930| none| 8 | 3| 2| 0| 0| 200| 90&lt;br /&gt;
&lt;br /&gt;
54h| houses (with two trees in front)| subtropical| 1, 2, 3, 4| 01h| 1930| none| 18| 7| 3| 1 | -2| 80| 80&lt;br /&gt;
&lt;br /&gt;
55h| flats| subtropical| 2, 3, 4| 01h | 1973| none| 90| 24| 6| 2| 1| 95| 110&lt;br /&gt;
&lt;br /&gt;
56h| flats| subtropical| 2, 3, 4| 01h| 1962| none| 120| 25| 6| 2| 1| 95| 120&lt;br /&gt;
&lt;br /&gt;
57h| tall office block (N part) | subtropical| 3, 4| 04h| 1984| none| 250| 80| 8| 3| 4| 140| 190&lt;br /&gt;
&lt;br /&gt;
58h| tall office block (W part)| subtropical| | 00h| 1984 | none| 0| 80| 8| 3| 4| 140| 190&lt;br /&gt;
&lt;br /&gt;
59h| flats| subtropical| 2, 3, 4| 01h| 1930| none| 80| 23| 6| 2| 1| 95| 110&lt;br /&gt;
&lt;br /&gt;
5Ah| tall office block| subtropical| 3, 4| 01h| 1993| none| 180| 90| 8| 3| 4| 150| 180&lt;br /&gt;
&lt;br /&gt;
5Bh| church| toyland| 0, 1, 2, 3, 4| 01h| 1930| none| 8| 3| 2| 0| 0| 200| 90&lt;br /&gt;
&lt;br /&gt;
5Ch| toyland houses| toyland| 0, 1, 2, 3, 4| 01h| 1930| none| 18| 5 | 6| 2| 2| 90| 90&lt;br /&gt;
&lt;br /&gt;
5Dh| toyland houses| toyland | 0, 1| 01h| 1930| none| 7| 3| 3| 1| 1| 50| 70&lt;br /&gt;
&lt;br /&gt;
5Eh| toyland houses| toyland| 0, 1, 2, 3| 01h| 1930| none| 15| 6| 3| 1| 2| 75| 80&lt;br /&gt;
&lt;br /&gt;
5Fh| toyland houses| toyland| 0, 1, 2, 3| 01h| 1930| none| 17| 6 | 3| 1| 2| 75| 80&lt;br /&gt;
&lt;br /&gt;
60h| toyland houses| toyland | 0, 1, 2, 3| 01h| 1930| none| 19| 6| 3| 1| 2 | 75| 80&lt;br /&gt;
&lt;br /&gt;
61h| toyland houses| toyland| 0, 1, 2, 3| 01h| 1930| none| 21| 6| 3| 1| 2| 75| 80&lt;br /&gt;
&lt;br /&gt;
62h| tall office block| toyland| 2, 3, 4| 01h| 1930| none| 75| 20 | 8| 4| 2| 130| 160&lt;br /&gt;
&lt;br /&gt;
63h| shoe house (N part)| toyland | 0, 1, 2, 3, 4| 08h| 1930| none| 35| 9| 4| 1| 2 | 80| 90&lt;br /&gt;
&lt;br /&gt;
64h| shoe house (E part)| | | 00h| 1930| none | 0| 0| 4| 1| 2| 80| 90&lt;br /&gt;
&lt;br /&gt;
65h | tall office block | toyland| 2, 3, 4| 01h| 1930| none| 85| 18| 8 | 4| 2| 130| 150&lt;br /&gt;
&lt;br /&gt;
66h| igloo| toyland| 0 | 01h| 1930| none| 11| 3| 3| 1| 1| 45 &amp;amp;nbsp;| 60&lt;br /&gt;
&lt;br /&gt;
67h| tepees| toyland| 0| 01h| 1930| none | 10| 3| 3| 1| 1| 45| 60&lt;br /&gt;
&lt;br /&gt;
68h| shops and offices | toyland| 2, 3, 4| 01h| 1930| none| 67| 22| 8 | 4| -4| 130| 140&lt;br /&gt;
&lt;br /&gt;
69h| shops and offices| toyland| 2, 3, 4 | 01h| 1930| none| 86| 23| 8| 4| -4| 130 | 145&lt;br /&gt;
&lt;br /&gt;
6Ah| tall office block| toyland| 2, 3, 4| 01h| 1930| none| 95| 28| 8| 4| 2| 130| 165&lt;br /&gt;
&lt;br /&gt;
6Bh | statue | toyland| 2, 3, 4| 01h| 1930| none| 30| 10| 4 | 1| 2| 70| 90&lt;br /&gt;
&lt;br /&gt;
6Ch| teapot-house| toyland| 0, 1, 2, 3, 4| 01h| 1930| none| 25| 8| 3| 1| 2| 65| 75&lt;br /&gt;
&lt;br /&gt;
6Dh| piggy-bank| toyland| 0, 1, 2, 3, 4| 01h| 1930| none| 18| 7| 3| 2| -4| 95| 85&lt;br /&gt;
&lt;br /&gt;
||&lt;/div&gt;</summary>
		<author><name>Pikkabird</name></author>
	</entry>
</feed>