<?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=Adf88</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=Adf88"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Adf88"/>
	<updated>2026-05-14T06:58:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3713</id>
		<title>VariationalAction2/Houses</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=VariationalAction2/Houses&amp;diff=3713"/>
		<updated>2016-02-08T08:05:39Z</updated>

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

		<summary type="html">&lt;p&gt;Adf88: /* Building availability mask (13) */ fix wrong url to &amp;quot;town zones (42)&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. House IDs, unlike station IDs, need not be set in order, so you can use action 7 to skip action 0s of the houses you don&#039;t currently need (for example those houses that don&#039;t appear on the current climate anyway). You are advised to do so in order to define as few IDs as possible, leaving space for other GRFs. You don&#039;t need to skip all action 0s for a house ID to disable it; skipping the action 0 that sets property 08 is enough.&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;
&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 [[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 [[VarAction2Houses#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;
== Example ==&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Decide_input_and_output_cargo_types&amp;diff=3694</id>
		<title>Callback: Decide input and output cargo types</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Decide_input_and_output_cargo_types&amp;diff=3694"/>
		<updated>2015-09-29T07:49:34Z</updated>

		<summary type="html">&lt;p&gt;Adf88: /* Decide input and output cargo types (14B,14C) */ Remove superfluous information.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Decide input and output cargo types (14B,14C) ==&lt;br /&gt;
{{ottdp|0.6|2.6|ottdrev=r11177|ttdprev=r1718}}&lt;br /&gt;
&lt;br /&gt;
These callbacks are called when the industry is built, and allow customizing the input and output cargo types dynamically. Both callbacks are called repeatedly, with the lowest byte of variable 10 starting from zero and increasing after every call; you should return a cargo type each time, or FFh to terminate the list. (A failed callback terminates the list, too.) The same limitations apply as for callback 14A: industry tiles aren&#039;t yet placed, and some industry variables contain junk. You can use random action2s, however. The interpretation of the returned value depends on two factors: the current GRF version number and the presence of a cargo translation table:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!GRF version!!Has cargo translation table!!Interpretation&lt;br /&gt;
|-&lt;br /&gt;
|6 or below|| ||Climate-dependent cargo slot number&lt;br /&gt;
|-&lt;br /&gt;
|7 or above||No||Cargo bit&lt;br /&gt;
|-&lt;br /&gt;
|7 or above||Yes||Index in the translation table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Although currently [[Callbacks#Decide input and output cargo types (14B,14C) |callback 14B]] is called no more than three times, and [[Callbacks#Decide input and output cargo types (14B,14C) |callback 14C]] no more than twice, this may change between versions/implementations, to allow more input/output types. To be safe, you should return FFh as the last element even when you use all three input types or both output types.&lt;br /&gt;
&lt;br /&gt;
[[Category:Callbacks]]&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Decide_input_and_output_cargo_types&amp;diff=3693</id>
		<title>Callback: Decide input and output cargo types</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Decide_input_and_output_cargo_types&amp;diff=3693"/>
		<updated>2015-09-28T13:51:18Z</updated>

		<summary type="html">&lt;p&gt;Adf88: OpenTTD version that  supports callbacks 14B 14C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Decide input and output cargo types (14B,14C) ==&lt;br /&gt;
&lt;br /&gt;
These callbacks are called when the industry is built, and allow customizing the input and output cargo types dynamically. Both callbacks are called repeatedly, with the lowest byte of variable 10 starting from zero and increasing after every call; you should return a cargo type each time, or FFh to terminate the list. (A failed callback terminates the list, too.) The same limitations apply as for callback 14A: industry tiles aren&#039;t yet placed, and some industry variables contain junk. You can use random action2s, however. The interpretation of the returned value depends on two factors: the current GRF version number and the presence of a cargo translation table:&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!GRF version!!Has cargo translation table!!Interpretation&lt;br /&gt;
|-&lt;br /&gt;
|6 or below|| ||Climate-dependent cargo slot number&lt;br /&gt;
|-&lt;br /&gt;
|7 or above||No||Cargo bit&lt;br /&gt;
|-&lt;br /&gt;
|7 or above||Yes||Index in the translation table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Although currently [[Callbacks#Decide input and output cargo types (14B,14C) |callback 14B]] is called no more than three times, and [[Callbacks#Decide input and output cargo types (14B,14C) |callback 14C]] no more than twice, this may change between versions/implementations, to allow more input/output types. To be safe, you should return FFh as the last element even when you use all three input types or both output types.&lt;br /&gt;
&lt;br /&gt;
These callbacks are available from {{ottd|0.6|r11177}} OpenTTD r11177 and {{ttdp|2.6}} TTDPatch 2.6 r1718 and above&lt;br /&gt;
&lt;br /&gt;
[[Category:Callbacks]]&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Custom_cargo_production&amp;diff=3556</id>
		<title>Callback: Custom cargo production</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Custom_cargo_production&amp;diff=3556"/>
		<updated>2014-08-31T12:00:07Z</updated>

		<summary type="html">&lt;p&gt;Adf88: /* Custom cargo production (2E) */ Link to house production algorithm description on Action0/Houses page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Custom cargo production (2E) ==&lt;br /&gt;
&lt;br /&gt;
This callback can be used to customize cargo production of house tiles. It is called every 256 ticks when the tile can produce cargo.&lt;br /&gt;
Because a tile can produce many types of cargo, this callback is called in a loop until it returns 20FFh (the loop count is limited&lt;br /&gt;
to 256 to avoid endless loops). If the returned value is not 20FFh, the high byte must be a cargo type and the low byte must be the&lt;br /&gt;
amount to be distributed. You can return a cargo type more than once if needed, so you can distribute more than 255 units from it.&lt;br /&gt;
During the callback, the lowest byte of variable 10 contains the number of iterations happened so far and variable 18 contains a&lt;br /&gt;
random value to help randomizing the production. (The old code randomizes production to make it look more natural, you can do the&lt;br /&gt;
same via a VarAction2 with nvar=0). Original passenger/mail generation algorithm is described [[Action0/Houses#Population_.280B.29_and_Mail_generation_multiplier_.280C.29|here]].&lt;br /&gt;
&lt;br /&gt;
Uses 15 return bits.&lt;br /&gt;
&lt;br /&gt;
{{grfFrom|7}} From GRF version 7 and above, the interpretation of the high byte in the returned value changes: instead of a climate-dependent&lt;br /&gt;
cargo slot number, you have to return a climate-independent cargo ID. If your GRF has a cargo translation table, then this ID&lt;br /&gt;
is the index in that table; otherwise, it&#039;s the cargo bit. Trying to produce a cargo not currently present is not an error, but will be ignored.&lt;br /&gt;
[[Category:Callbacks]]&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Houses&amp;diff=3555</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=3555"/>
		<updated>2014-08-31T11:53:38Z</updated>

		<summary type="html">&lt;p&gt;Adf88: /* Population (0B) and Mail generation multiplier (0C) */ Fix image floating after last edit&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. House IDs, unlike station IDs, need not be set in order, so you can use action 7 to skip action 0s of the houses you don&#039;t currently need (for example those houses that don&#039;t appear on the current climate anyway). You are advised to do so in order to define as few IDs as possible, leaving space for other GRFs. You don&#039;t need to skip all action 0s for a house ID to disable it; skipping the action 0 that sets property 08 is enough.&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;
&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 [[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 [[VarAction2Houses#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;
== Example ==&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Houses&amp;diff=3554</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=3554"/>
		<updated>2014-08-31T11:45:27Z</updated>

		<summary type="html">&lt;p&gt;Adf88: /* Population (0B) and Mail generation multiplier (0C) */ detailed description on how passengers/mail is generated&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. House IDs, unlike station IDs, need not be set in order, so you can use action 7 to skip action 0s of the houses you don&#039;t currently need (for example those houses that don&#039;t appear on the current climate anyway). You are advised to do so in order to define as few IDs as possible, leaving space for other GRFs. You don&#039;t need to skip all action 0s for a house ID to disable it; skipping the action 0 that sets property 08 is enough.&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;
&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 [[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]].&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 [[VarAction2Houses#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;
== Example ==&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3553</id>
		<title>File:House production.png</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3553"/>
		<updated>2014-08-31T11:14:15Z</updated>

		<summary type="html">&lt;p&gt;Adf88: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;House production vs. population / mail generation.&lt;br /&gt;
&lt;br /&gt;
Made with gnuplot:&lt;br /&gt;
&lt;br /&gt;
 set border 0&lt;br /&gt;
 set size square&lt;br /&gt;
 set xzeroaxis lt -1&lt;br /&gt;
 set yzeroaxis lt -1&lt;br /&gt;
 set arrow from graph 1,0 to graph 1.05,0 size screen 0.025,15,60 filled&lt;br /&gt;
 set arrow from graph 0,1 to graph 0,1.05 size screen 0.025,15,60 filled&lt;br /&gt;
 set tics scale 0&lt;br /&gt;
 set format x &amp;quot;&amp;quot; &lt;br /&gt;
 set format y &amp;quot;&amp;quot; &lt;br /&gt;
 set xlabel &amp;quot;population / mail gen.&amp;quot;&lt;br /&gt;
 set ylabel &amp;quot;production&amp;quot;&lt;br /&gt;
 set term pngcairo size 190,190&lt;br /&gt;
 set output &amp;quot;house_production.png&amp;quot;&lt;br /&gt;
 plot [0:1] [0:1] (x**2) with lines notitle&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3552</id>
		<title>File:House production.png</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3552"/>
		<updated>2014-08-31T11:10:49Z</updated>

		<summary type="html">&lt;p&gt;Adf88: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;House production vs. population / mail generation.&lt;br /&gt;
&lt;br /&gt;
Made with gnuplot:&lt;br /&gt;
&lt;br /&gt;
set border 0&lt;br /&gt;
&lt;br /&gt;
set size square&lt;br /&gt;
&lt;br /&gt;
set xzeroaxis lt -1&lt;br /&gt;
&lt;br /&gt;
set yzeroaxis lt -1&lt;br /&gt;
&lt;br /&gt;
set arrow from graph 1,0 to graph 1.05,0 size screen 0.025,15,60 filled&lt;br /&gt;
&lt;br /&gt;
set arrow from graph 0,1 to graph 0,1.05 size screen 0.025,15,60 filled&lt;br /&gt;
&lt;br /&gt;
set tics scale 0&lt;br /&gt;
&lt;br /&gt;
set format x &amp;quot;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
set format y &amp;quot;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
set xlabel &amp;quot;population / mail gen.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
set ylabel &amp;quot;production&amp;quot;&lt;br /&gt;
&lt;br /&gt;
set term pngcairo size 190,190&lt;br /&gt;
&lt;br /&gt;
set output &amp;quot;house_production.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
plot [0:1] [0:1] (x**2) with lines notitle&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3551</id>
		<title>File:House production.png</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=File:House_production.png&amp;diff=3551"/>
		<updated>2014-08-31T11:08:45Z</updated>

		<summary type="html">&lt;p&gt;Adf88: House production vs. population / mail generation.

Made with gnuplot:

set border 0
set size square
set xzeroaxis lt -1
set yzeroaxis lt -1
set arrow from graph 1,0 to graph 1.05,0 size screen 0.025,15,60 filled
set arrow from graph 0,1 to graph 0,1.0...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;House production vs. population / mail generation.&lt;br /&gt;
&lt;br /&gt;
Made with gnuplot:&lt;br /&gt;
&lt;br /&gt;
set border 0&lt;br /&gt;
set size square&lt;br /&gt;
set xzeroaxis lt -1&lt;br /&gt;
set yzeroaxis lt -1&lt;br /&gt;
set arrow from graph 1,0 to graph 1.05,0 size screen 0.025,15,60 filled&lt;br /&gt;
set arrow from graph 0,1 to graph 0,1.05 size screen 0.025,15,60 filled&lt;br /&gt;
set tics scale 0&lt;br /&gt;
set format x &amp;quot;&amp;quot; &lt;br /&gt;
set format y &amp;quot;&amp;quot; &lt;br /&gt;
set xlabel &amp;quot;population / mail gen.&amp;quot;&lt;br /&gt;
set ylabel &amp;quot;production&amp;quot;&lt;br /&gt;
&lt;br /&gt;
set term pngcairo size 190,190&lt;br /&gt;
set output &amp;quot;house_production.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
plot [0:1] [0:1] \&lt;br /&gt;
        (x**2) with lines notitle&lt;/div&gt;</summary>
		<author><name>Adf88</name></author>
	</entry>
</feed>