<?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=Glx</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=Glx"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Glx"/>
	<updated>2026-05-14T09:26:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Ambient_sound_effects&amp;diff=5111</id>
		<title>Callback: Ambient sound effects</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Callback:_Ambient_sound_effects&amp;diff=5111"/>
		<updated>2025-10-29T00:25:11Z</updated>

		<summary type="html">&lt;p&gt;Glx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Ambient sound effects (144) ==&lt;br /&gt;
&lt;br /&gt;
This callback is a generic callback for feature 0C (new sounds) used for playing ambient sound effects.&lt;br /&gt;
&lt;br /&gt;
The 15-bit return value is the sound effect number. Values from 0 to 72 (dec) are TTD&#039;s built-in sound effects, values beyond that refer to the sounds from [[Action11|Action 11]].&lt;br /&gt;
&lt;br /&gt;
To decide whether to play a sound, and what sound to play, Var.Action 2 variable 10 holds the following information:&lt;br /&gt;
* {{grfTill|7}} For GRF version 7 and below: THRRxxxt&lt;br /&gt;
* {{grfFrom|8}} For GRF version 8 and above: xTHHRRtt&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!Field!!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|T||Tile class, 0=bare land, 4=trees, 6=water&lt;br /&gt;
|-&lt;br /&gt;
|HH||&lt;br /&gt;
{{grfTill|7}} Height of north corner of tile (multiple of 8)&amp;lt;br/&amp;gt;&lt;br /&gt;
{{grfFrom|8}} Height of lowest corner of tile (multiple of 1)&lt;br /&gt;
|-&lt;br /&gt;
|RR||8 random bits&lt;br /&gt;
|-&lt;br /&gt;
|xxx||Reserved&lt;br /&gt;
|-&lt;br /&gt;
|tt||&lt;br /&gt;
* Bits 0..2: Terrain type: 0 normal (grass), 1 desert, 2 rainforest, 4 on or above snowline.&lt;br /&gt;
* Bits 3..5: {{grfFrom|8}} Water class: 0 - undefined / land; 1 - sea; 2 - canal; 3 - river. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This callback must be enabled by bit 4 in [[GlobalVariables#Misc._GRF_Features_.281E_.2F_9E.29|action D var 9E]].&lt;br /&gt;
[[Category:Callbacks]]&lt;/div&gt;</summary>
		<author><name>Glx</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spriteset&amp;diff=5109</id>
		<title>NML:Spriteset</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Spriteset&amp;diff=5109"/>
		<updated>2025-10-07T02:36:41Z</updated>

		<summary type="html">&lt;p&gt;Glx: Advanced spriteset syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavBlocksyntax}}&lt;br /&gt;
&lt;br /&gt;
A spriteset associates a name with a number piece of an existing image file and describes the offsets with respect to some origin the graphics will be painted within the game. Different features and situations require that a single set has a certain amount of actual sprites associated. E.g. a vehicle usually requires eight sprites in order to provide on view for each of the eight possible ingame orientations of a vehicle.&lt;br /&gt;
&lt;br /&gt;
 spriteset (&amp;amp;lt;spriteset-name&amp;amp;gt;[, &amp;amp;lt;image-file&amp;amp;gt;]) {&lt;br /&gt;
 	[[NML:Realsprites|list of realsprites]]&lt;br /&gt;
 	...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Parameter &amp;amp;lt;spriteset-name&amp;amp;gt; specifies the name of this spriteset. This name is used to refer to the spriteset later on.&lt;br /&gt;
&lt;br /&gt;
Parameter two &amp;amp;lt;image-file&amp;amp;gt; (optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite (see [[NML:Realsprites|Real sprites]]).&lt;br /&gt;
&lt;br /&gt;
{{nml|0.7.5}} An alternative syntax combining spriteset and [[NML:Alternative sprites|Alternative sprites]] allows to create 32bpp only NewGRF.&lt;br /&gt;
&lt;br /&gt;
 spriteset (&amp;amp;lt;spriteset-name&amp;amp;gt;, zoom_level, type[, &amp;amp;lt;image-file&amp;amp;gt;[, &amp;amp;lt;mask-file&amp;amp;gt;]]) {&lt;br /&gt;
 	[[NML:Realsprites|list of realsprites]]&lt;br /&gt;
        ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Within the spriteset are a list of [[NML:Realsprites|Real sprites]], which defines the position and size of the sprite within the image file, its alignment offsets and any other real sprite properties.&lt;br /&gt;
&lt;br /&gt;
Each sprite may be prefixed with a label, see [[NML:Spritelayout#Sprite| sprite layouts]] for more info. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 	some_label: [... real sprite ...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to use a sprite set depends on the feature:&lt;br /&gt;
&lt;br /&gt;
* For canals, cargos, airports (not tiles!) and railtypes, you can refer to sprite sets directly from the graphics block, or use intermediate (random)switches to make a descision.&lt;br /&gt;
* For vehicles, the same as above is possible. However, to facilitate the common case of having multiple loading stages, you can also define [[NML:Spritegroup|sprite groups]], see below. These sprite groups are then used in place of a single sprite set.&lt;br /&gt;
* Stations, houses, industry tiles, objects and airport tiles all define the look of a tile. This often requires more than one sprite, for example a concrete ground sprite with a building sprite on top of it. To combine and arrange these sprites a [[NML:Spritelayout|sprite layout]] is used, directly referring to sprite sets is not possible here&lt;br /&gt;
* Features not mentioned here have no use for sprite sets, as such they are not supported by NML.&lt;/div&gt;</summary>
		<author><name>Glx</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=4367</id>
		<title>NML:Stations</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Stations&amp;diff=4367"/>
		<updated>2023-01-12T21:17:13Z</updated>

		<summary type="html">&lt;p&gt;Glx: /* Station callbacks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavPropVarCB}}&lt;br /&gt;
Stations are supported since {{nml|0.7}}.&lt;br /&gt;
&lt;br /&gt;
==Station sections==&lt;br /&gt;
&lt;br /&gt;
Stations can be built from multiple sections. Station tiles will remember, which tiles were built together in one action.&lt;br /&gt;
* Building a 2x5 station in one action creates a single station section of size 2x5.&lt;br /&gt;
* Building a 2x5 station by placing two 1x5 areas next to each other in two actions creates two station sections of size 1x5; even when using the same station type from the same NewGRF.&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Overbuilding stations and removing station tiles will remove tiles from station sections.&lt;br /&gt;
* On construction all station sections are contiguous rectangular NxM tile ares. (regular station section)&lt;br /&gt;
* When tiles are overbuilt or tiles are removed, station sections may end up non-rectangular and non-contiguous. (irregular station section)&lt;br /&gt;
Station tiles can query their position inside a contiguous line of tiles from the same section.&lt;br /&gt;
* This is great as long as the section remains regular.&lt;br /&gt;
* If tiles are non-contiguous, they are indistinguishable from tiles of other sections.&lt;br /&gt;
&lt;br /&gt;
For irregular sections the &amp;quot;position&amp;quot; inside the section will become rather arbitrary.&lt;br /&gt;
The picture shows the perspective of each tile of a irregular section as &amp;quot;(platform, position)/(num-platforms, length)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:station_sections_irregular.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Tile types==&lt;br /&gt;
&lt;br /&gt;
When station sections are built, they can store a &amp;quot;tile type&amp;quot; for each tile using the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; callback.&lt;br /&gt;
&lt;br /&gt;
Tile types have multiple usages:&lt;br /&gt;
* The type can be read via the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_type&amp;lt;/code&amp;gt; variable, and can act as persistent storage.&lt;br /&gt;
* It decides whether the tile is traversible by trains, or whether it is a building without tracks.&lt;br /&gt;
* It decides whether catenary pylons and/or wires shall be drawn/hidden on the tile. Note: even non-track station buildings have a rail type, and can draw catenary.&lt;br /&gt;
&lt;br /&gt;
The tile type is immutable after construction. So, unlike the platform/position information, the tile type will never change after construction, even if tiles of the station section are removed or overbuilt.&lt;br /&gt;
&lt;br /&gt;
The number of tile types is quite limited: 4 per orientation, 8 in total.&lt;br /&gt;
* Tile types 0, 2, 4 and 6 are used for station sections with tracks in X direction (⤢).&lt;br /&gt;
* Tile types 1, 3, 5 and 7 are used for station sections with tracks in Y direciton (⤡).&lt;br /&gt;
* Callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt; decides between the pairs (0,1), (2,3), (4,5), (6,7) during construction. The orientation is always picked by the player.&lt;br /&gt;
&lt;br /&gt;
==Station properties==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! property&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| class&lt;br /&gt;
| String literal of length 4&lt;br /&gt;
|&lt;br /&gt;
&#039;&#039;&#039;This property &#039;&#039;must&#039;&#039; be set first, before any other properties or graphics.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Stations belonging to the same class are grouped in the GUI.&amp;lt;br&amp;gt;&lt;br /&gt;
There is one special class:&lt;br /&gt;
* &amp;quot;WAYP&amp;quot;: The station type will be shown in the waypoint construction window, instead of the station construction window.&lt;br /&gt;
|-&lt;br /&gt;
| classname&lt;br /&gt;
| string&lt;br /&gt;
| You only need to set this for one station in every class. &lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| string&lt;br /&gt;
| For example: string(STR_50S_STATION)&lt;br /&gt;
|-&lt;br /&gt;
| disabled_platforms &amp;lt;br&amp;gt; disabled_length&lt;br /&gt;
| bitmask(1, 2, 3, 4, 5, 6, 7, 8)&lt;br /&gt;
|&lt;br /&gt;
Restricts the possible number-of-platforms and platform-lengths the player can build as one section.&lt;br /&gt;
* Sizes 1 to 7 can be disabled individually,&lt;br /&gt;
* &amp;quot;size 8&amp;quot; is used for anything bigger than 7.&lt;br /&gt;
To put restrictions on sizes bigger than 7 (for example, only allow even sizes), you can use callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;tile_check&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;Note: Players can remove single tiles from any station, so stations sections can end up with forbidden sizes anyway.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_threshold&lt;br /&gt;
| 0..4095&lt;br /&gt;
| Threshold between &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;little&amp;lt;/code&amp;gt; and &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;lots&amp;lt;/code&amp;gt; spritesets, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
|-&lt;br /&gt;
| draw_pylon_tiles &amp;lt;br&amp;gt; hide_wire_tiles &amp;lt;br&amp;gt; non_traversable_tiles&lt;br /&gt;
| bitmask(0, 1, 2, 3, 4, 5, 6, 7)&lt;br /&gt;
| Specifies which [[#Tile_types|tile types]] are traversible/non-traversible, and whether pylons and/or catenary shall be drawn for electrified rail types.&lt;br /&gt;
Note: it is common that all tile types behave the same, you may want to use the short cuts&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0&amp;lt;/code&amp;gt; for no tile types, and&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;0xFF&amp;lt;/code&amp;gt; for all tile types.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_random_triggers&lt;br /&gt;
| Array of cargo labels from the [[NML:Cargotable|cargotable]]&lt;br /&gt;
| Cargo types, which will [[NML:Random_switch#Stations|trigger re-randomization]] when delivered, loaded or unloaded at the station.&lt;br /&gt;
|-&lt;br /&gt;
| general_flags&lt;br /&gt;
| bitmask(STAT_FLAG_XXX, STAT_FLAG_YYY, ...)&lt;br /&gt;
|&lt;br /&gt;
;STAT_FLAG_DISTRIBUTED_CARGO&lt;br /&gt;
:Specifies whether waiting cargo amounts are scaled by station size for spriteset selection, see [[NML:Spritegroup#Stations|spritegroup]] for details.&lt;br /&gt;
;STAT_FLAG_RANDOM_ANIMATION&lt;br /&gt;
:If set, callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_next_frame&amp;lt;/code&amp;gt; will get random data in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;&lt;br /&gt;
;STAT_FLAG_CUSTOM_FOUNDATIONS&lt;br /&gt;
:Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
;STAT_FLAG_EXTENDED_FOUNDATIONS&lt;br /&gt;
:Selects between two possible spriteset formats for callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;foundations&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
|-&lt;br /&gt;
| animation_info&lt;br /&gt;
| Array [ANIMATION_XXX, frame-count]&lt;br /&gt;
| XXX = [LOOPING &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; NON_LOOPING], 1..253 frames&lt;br /&gt;
|-&lt;br /&gt;
| animation_speed&lt;br /&gt;
| 0..16&lt;br /&gt;
|&lt;br /&gt;
Speed of animation, see [[NML:Animation speed|animation speed table]] for the meaning of the values.&lt;br /&gt;
|-&lt;br /&gt;
| animation_triggers&lt;br /&gt;
| bitmask(STAT_ANIM_XXX, STAT_ANIM_YYY, ...)&lt;br /&gt;
| Enables callback &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;anim_control&amp;lt;/code&amp;gt; for specified triggers:&lt;br /&gt;
;STAT_ANIM_IS_BUILT&lt;br /&gt;
:Tile is built. (all new-built/overbuilt tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_ARRIVES&lt;br /&gt;
:Cargo is deliverd from industry to station. (all station tiles)&lt;br /&gt;
;STAT_ANIM_CARGO_REMOVED&lt;br /&gt;
:All cargo was loaded onto a vehicle, no more cargo (of this type) is waiting. (all station tiles)&lt;br /&gt;
;STAT_ANIM_TRAIN_ENTERS&lt;br /&gt;
:Train stops at station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LEAVES&lt;br /&gt;
:Train leaves station. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_TRAIN_LOAD_UNLOAD&lt;br /&gt;
:Train is loading or unloading. (all tiles of platform)&lt;br /&gt;
;STAT_ANIM_250_TICKS&lt;br /&gt;
:Every 250 ticks. (synchronized for all tiles of the station)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Station variables==&lt;br /&gt;
&lt;br /&gt;
===Base station variables===&lt;br /&gt;
The following variables are shared between stations and [[NML:Airports|airports]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_station&lt;br /&gt;
| 0..65535&lt;br /&gt;
| 16 random bits, shared between all station sections (rail station sections, airports, ...)&lt;br /&gt;
|-&lt;br /&gt;
| had_vehicle_of_type&lt;br /&gt;
| bitmask(HAD_VEHICLE_OF_TYPE_XXX, ...)&lt;br /&gt;
| Bitmask of vehicle types that have visited the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | BUS | TRUCK | AIRCRAFT | SHIP]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| is_waypoint&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Whether the station is a waypoint&lt;br /&gt;
|-&lt;br /&gt;
| facilities&lt;br /&gt;
| bitmask(FACILITY_XXX, ...)&lt;br /&gt;
| Bitmask of facilities associated with the station. XXX = &amp;lt;nowiki&amp;gt;[TRAIN | TRUCK_STOP | BUS_STOP | AIRPORT | DOCK]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| airport_type&lt;br /&gt;
| AIRPORTTYPE_XXX&lt;br /&gt;
| Type of airport, contains a bogus value if the station has no airport. XXX = &amp;lt;nowiki&amp;gt;[SMALL | LARGE | HELIPORT | OILRIG]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| build_date&lt;br /&gt;
| &amp;lt;code style=&amp;quot;color:green&amp;quot;&amp;gt;date&amp;lt;/code&amp;gt;(yyyy,mm,dd)&lt;br /&gt;
| Date when the station was built. Is clamped to the 1920-2099 range.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following variables are also shared with [[NML:Airports|airports]]. They all require a single argument: a cargo type from your [[NML:Cargotable|cargo translation table]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| cargo_amount_waiting&lt;br /&gt;
| 0..32767&lt;br /&gt;
| Units of cargo of waiting&lt;br /&gt;
|-&lt;br /&gt;
| cargo_rating&lt;br /&gt;
| 0..100&lt;br /&gt;
| Rating for this cargo type (in %)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_since_pickup&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time since the cargo was last picked up. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_time_en_route&lt;br /&gt;
| 0..255&lt;br /&gt;
| Time this cargo has spent en-route. 1 unit equals 185 ticks, or about 2.5 game days.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_speed&lt;br /&gt;
| 0..255&lt;br /&gt;
| Speed of the last vehicle picking up this cargo type. The unit depends on the type of vehicle. For trains and road vehicles, one unit is 1 km/h; for ships, it&#039;s 0.5 km/h; for aircraft, it&#039;s 8 mph. If the max. speed is above 255 speed units, 255 is used instead. 0 if no vehicle as picked up the cargo type yet.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_last_vehicle_age&lt;br /&gt;
| 0..255&lt;br /&gt;
| Age of the last vehicle picking up this cargo type, in years. 255 if no vehicle has picked up the cargo type yet.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type is currently being accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_ever&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type has ever been accepted at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_last_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted last month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_this_month&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted this month at the station, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| cargo_accepted_bigtick&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if this cargo type was accepted at the station since the last periodic processing, which happens every 250 ticks. 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variables without a parameter===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| tile_type&lt;br /&gt;
| 0..7&lt;br /&gt;
| The type of tile, as decided by &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;select_tile_type&amp;lt;/code&amp;gt;. Bit 0 also tells the orientation.&lt;br /&gt;
|-&lt;br /&gt;
| terrain_type&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| track_type&lt;br /&gt;
| Entry from [[NML:Railtypetable|railtype translation table]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| company_num&lt;br /&gt;
| 0 ... 14&lt;br /&gt;
| company number of the vehicle owner. TTDPatch only supports up to 8 companies (0 ... 7)&lt;br /&gt;
|-&lt;br /&gt;
| company_type&lt;br /&gt;
| PLAYERTYPE_XX&lt;br /&gt;
| &lt;br /&gt;
;PLAYERTYPE_HUMAN&lt;br /&gt;
:human player&lt;br /&gt;
;PLAYERTYPE_AI&lt;br /&gt;
:AI player&lt;br /&gt;
;PLAYERTYPE_HUMAN_IN_AI&lt;br /&gt;
:human managing AI company&lt;br /&gt;
;PLAYERTYPE_AI_IN_HUMAN&lt;br /&gt;
:AI managing human company&lt;br /&gt;
&lt;br /&gt;
OpenTTD only uses PLAYERTYPE_HUMAN and PLAYERTYPE_AI. If you cheat yourself to be part of an AI company OpenTTD will still report PLAYERTYPE_AI for the company with yourself and the AI and it&#039;ll report PLAYERTYPE_HUMAN for the now uncontrolled company.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour1&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| company_colour2&lt;br /&gt;
| COLOUR_XXX&lt;br /&gt;
|&lt;br /&gt;
Same as company_colour1, if no 2nd company colour is chosen. Refer to the table [[NML:List of default colour translation palettes#Company colour helper functions|here]] for possible values.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_reserved&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_reserved_or_disabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile has been reserved by a train for PBS (Path-based signalling) purposes, or if PBS is not enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| pbs_enabled&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if PBS is enabled. Currently PBS is always considered enabled if the game version used supports it, but in the future, this may change to check if the current signal block actually uses PBS-signals.&lt;br /&gt;
|-&lt;br /&gt;
| rail_continuation&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| rail_present&lt;br /&gt;
| bitmask(0, ... 7)&lt;br /&gt;
| [[#Rail continuation|see below]]&lt;br /&gt;
|-&lt;br /&gt;
| animation_frame&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the current tile.&lt;br /&gt;
|-&lt;br /&gt;
| random_bits_tile&lt;br /&gt;
| 0..15&lt;br /&gt;
| 4 random bits, specific to this station tile.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Rail continuation====&lt;br /&gt;
Variables &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; both contain a bitmask, with 8 possible bits set. Each bit corresponds to one of the adjacent tiles, refer to the table or picture below. The bit in &amp;lt;code&amp;gt;rail_present&amp;lt;/code&amp;gt; is set if the tile contains any rail track. Bits 0..3 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are only set if there is rail track on the tile and if that track connects to the current tile (note that this tile has no connection to the tiles corresponding to bits 2 and 3, but that doesn&#039;t matter). Bits 4..7 in &amp;lt;code&amp;gt;rail_continuation&amp;lt;/code&amp;gt; are set if there is track on the tile and if that track connects to tile 2 or 3, whichever is applicable.&lt;br /&gt;
{| |-&lt;br /&gt;
!Bit!!Set if rail continues in direction of...&lt;br /&gt;
|-&lt;br /&gt;
|0||+Length&lt;br /&gt;
|-&lt;br /&gt;
|1||-Length&lt;br /&gt;
|-&lt;br /&gt;
|2||+Platforms&lt;br /&gt;
|-&lt;br /&gt;
|3||-Platforms&lt;br /&gt;
|-&lt;br /&gt;
|4||+Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|5||-Length, +Platforms&lt;br /&gt;
|-&lt;br /&gt;
|6||+Length, -Platforms&lt;br /&gt;
|-&lt;br /&gt;
|7||-Length, -Platforms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following picture illustrates which bits represent which tile for the two possible station orientations:&lt;br /&gt;
&lt;br /&gt;
[[File:station_var45.png]]&lt;br /&gt;
&lt;br /&gt;
===Variables that require one or more arguments===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! name&lt;br /&gt;
! arguments&lt;br /&gt;
! value range&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_slope&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;The first parameter is the distance to move along the platform, the second parameter is the distance to move sideways (between platforms). Both parameters are signed numbers with range -8..7, negative numbers go northwards.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| SLOPE_XXX&lt;br /&gt;
| See [[NML:List of tile slopes|tile slopes]] for an overview of possible values. Note that the slope is &#039;mirrored&#039; in the NW-SE orientation, i.e. the bits for CORNER_W and CORNER_E are swapped.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_water&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the tile is water, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_terrain_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| TILETYPE_XX&lt;br /&gt;
| TILETYPE_NORMAL, TILETYPE_DESERT, TILETYPE_RAIN_FOREST, TILETYPE_SNOW&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_water_class&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| WATER_CLASS_XXX&lt;br /&gt;
| XXX = [NONE &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; SEA &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; CANAL &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; RIVER] Note that tiles for which &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;nearby_tile_is_water&amp;lt;/code&amp;gt; is 0 may still have a water class, e.g. industry tiles with water beneath them.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_height&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255 (currently limited to 0..15)&lt;br /&gt;
| Height of the lowest corner of the tile. 1 unit is one height level of 8 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_class&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
[[NML:List of tile classes|Tile class]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_animation_frame&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255&lt;br /&gt;
| Animation frame of the given tile&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_is_station&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile, 0 otherwise&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_station_id&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..255&lt;br /&gt;
| If the given tile is a station tile defined by this NewGRF, the item ID. Else, the content is undefined.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_grf&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by this NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_other_grf&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile defined by a different NewGRF, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_grfid&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 32-bit GRFID&lt;br /&gt;
| GRFID of the NewGRF defining the given station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_original_gfx&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is a station tile with original graphics, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_same_station&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile is part of the same station, 0 otherwise. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_perpendicular&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| 1 if the given tile a station tile aligned perpendicular to this tile, 0 if it is aligned parallel. Undefined if the tile is not a station tile.&lt;br /&gt;
|-&lt;br /&gt;
| nearby_tile_tile_type&lt;br /&gt;
| tile- and platform-offset &amp;lt;ref name=&amp;quot;offset&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..7&lt;br /&gt;
| [[#Tile_types|Tile type]] of the given tile. The orientation bit is adjusted to be relative to the current tile&#039;s orientation:&lt;br /&gt;
* 0, 2, 4, 6: Tracks are parallel.&lt;br /&gt;
* 1, 3, 5, 7: Tracks are perpendicular.&lt;br /&gt;
|-&lt;br /&gt;
| platform_length&lt;br /&gt;
| PLATFROM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;&amp;gt;Possible values are: &lt;br /&gt;
;PLATFORM_SAME_STATION:Consider all tiles that are part of the same station&lt;br /&gt;
;PLATFORM_SAME_SECTION:Consider all tiles that are part of the same individually built [[#Station_sections|section]]&lt;br /&gt;
;PLATFORM_SAME_DIRECTION:Consdier all tiles that are part of the same station and have the same platform direction.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Length of the platform (along the platform direction) in tiles&lt;br /&gt;
|-&lt;br /&gt;
| platform_count&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Number of platforms (counted perpendicular to the platform direction)&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the first (northernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Position along the platform, 0 for the last (southernmost) tile.&lt;br /&gt;
|-&lt;br /&gt;
| platform_position_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Position along the platform, 0 for the middle tile. When the number of tiles is even, the southernmost of the two middle tiles is assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_start&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from top to bottom, so 0 for the northernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_end&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| 0..15&lt;br /&gt;
| Platform number, counting from bottom to top, so 0 for the southernmost platform.&lt;br /&gt;
|-&lt;br /&gt;
| platform_number_from_middle&lt;br /&gt;
| PLATFORM_SAME_XXX&amp;lt;ref name=&amp;quot;platform&amp;quot;/&amp;gt;&lt;br /&gt;
| -8..7&lt;br /&gt;
| Platform number, counting top to bottom, using 0 for the middle platform. When the number of platforms is even, the southernmost of the two middle platformsis assigned number 0, so there is one more negative than positive number. Using PLATFORM_SAME_DIRECTION is not possible here.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Station callbacks==&lt;br /&gt;
&lt;br /&gt;
The following table contains a list of available station callbacks.&lt;br /&gt;
&lt;br /&gt;
Additionally, it&#039;s possible to provide cargo-specific graphics, using the identifier from the [[NML:Cargotable|cargo table]] as callback name. These callbacks will be used if the cargo is waiting at the station. If multiple cargo types are waiting at the station, OpenTTD will pick one of the options the station provides.&lt;br /&gt;
If none of the listed cargo types is waiting at the station, the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;default&amp;lt;/code&amp;gt; callback will be used.&lt;br /&gt;
&lt;br /&gt;
Cargo-specific graphics callbacks are never called from the purchase menu, refer to the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;purchase&amp;lt;/code&amp;gt; callback below instead.&lt;br /&gt;
&lt;br /&gt;
Note that the above affects &#039;&#039;&#039;graphics only&#039;&#039;&#039;, other callbacks are unaffected.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! callback&lt;br /&gt;
! return value&lt;br /&gt;
! comment&lt;br /&gt;
|-&lt;br /&gt;
| default&lt;br /&gt;
| spritegroup&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase&lt;br /&gt;
| spritegroup or spriteset&lt;br /&gt;
| See [[#Graphics|below]]. If a spritegroup is linked instead of a spriteset, the &amp;quot;zero cargo amount&amp;quot; spriteset is used.&lt;br /&gt;
|-&lt;br /&gt;
| custom_spritesets&lt;br /&gt;
| Array of spritesets&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| sprite_layouts&lt;br /&gt;
| Array of spritelayouts&lt;br /&gt;
| See [[#Graphics|below]]. The number of sprite_layouts must be even, alternating X (⤢) and Y (⤡) orientations.&lt;br /&gt;
|-&lt;br /&gt;
| select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| purchase_select_sprite_layout&lt;br /&gt;
| index into sprite_layouts[]&lt;br /&gt;
| See [[#Graphics|below]]. The result&#039;s even-/oddness is ignored. The orientation is always adjusted by OpenTTD.&lt;br /&gt;
|-&lt;br /&gt;
| prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| purchase_prepare_layout&lt;br /&gt;
| expression list&lt;br /&gt;
| See [[#Graphics|below]].&lt;br /&gt;
|-&lt;br /&gt;
| foundations&lt;br /&gt;
| sprite set&lt;br /&gt;
| See [[#foundations|below]].&lt;br /&gt;
|-&lt;br /&gt;
| availability&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 1]&lt;br /&gt;
| Return 1 to make the station show up in the build window&lt;br /&gt;
|-&lt;br /&gt;
| tile_check&lt;br /&gt;
| Same as for the [[NML:IndustryTiles#Location check results|location_check]] industry callback&lt;br /&gt;
| Decide whether station may be built on this tile. This is an additional check to all built-in checks (like slope checks), you can only further restrict construction, not lessen conditions.&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: The [[NML:List_of_tile_slopes|tile slope]] of the tile, adjusted by station orientation:&lt;br /&gt;
** unmodified in X direction (⤢)&lt;br /&gt;
** mirrored in Y direction (⤡)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 8)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 24, 8)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| select_tile_type&lt;br /&gt;
| [0 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 6]&lt;br /&gt;
| Decides which tile type to store for each tile during construction. The lowest bit is always defined by the station orientation, no matter the callback result. See also [[#Tile_types|tile type above]].&lt;br /&gt;
&lt;br /&gt;
Called before constructing the station section, so nothing exists on the map yet. Since the station isn&#039;t built yet, so you can&#039;t access station variables.&lt;br /&gt;
Only these variables are available: company-information, and the class, height, slope, terrain type and water status of nearby tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 0, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = north tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 4, 4)&amp;lt;/code&amp;gt;: Tile position along the new-built platform. (0 = south tile)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 8, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = north platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 12, 4)&amp;lt;/code&amp;gt;: Platform number within the new-built section. (0 = south platform)&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 16, 4)&amp;lt;/code&amp;gt;: Length of the new section being built.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info1, 20, 4)&amp;lt;/code&amp;gt;: Number of platforms in the new section being built.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| anim_next_frame&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
| Called for every animation frame, returns the next frame to display. Alternatively, return CB_RESULT_NEXT_FRAME or CB_RESULT_STOP_ANIMATION to show the next frame or stop animation, respectively.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits, if enabled in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; property.&lt;br /&gt;
Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
|-&lt;br /&gt;
| anim_control&lt;br /&gt;
| Next animation frame or CB_RESULT_XXX&lt;br /&gt;
|&lt;br /&gt;
Called whenever an animation trigger happens. Return the animation frame to show, or CB_RESULT_XXX with XXX = [CB_RESULT_START_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; STOP_ANIMATION &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; DO_NOTHING] to respectively start the animation in its current frame, stop the animation or do nothing. Returning a sound effect in the high byte will cause that sound effect to be played.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;extra_callback_info1&amp;lt;/code&amp;gt;: 32 random bits. The low 16 bits are always different for each station tile, but the high 16 bits are the same for all triggered tiles.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 0, 8)&amp;lt;/code&amp;gt;: Reason for the callback trigger (STAT_ANIM_xxx). Note that you need to enable the wanted triggers in the &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;animation_triggers&amp;lt;/code&amp;gt; property.&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 8, 8)&amp;lt;/code&amp;gt;: Cargo-type involved in the trigger. Only applies to STAT_ANIM_CARGO_ARRIVES, STAT_ANIM_CARGO_REMOVED, STAT_ANIM_TRAIN_LOAD_UNLOAD.&lt;br /&gt;
|-&lt;br /&gt;
| anim_speed&lt;br /&gt;
| 0 .. 16&lt;br /&gt;
| Decide the time an animation frame should last. Return value is interpreted as (num_ticks = 2^anim_speed), which each tick lasting 30 ms. Avoid using this callback if possible, since it has to be called each tick for every animated tile. This can be used to create animation frames that last between 30 ms and 33 minutes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
&lt;br /&gt;
[[File:Nml_station_graphics.dot.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== foundations ===&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;STAT_FLAG_CUSTOM_FOUNDATIONS&amp;lt;/code&amp;gt; is enabled in &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;general_flags&amp;lt;/code&amp;gt; you can draw custom foundation for station tiles on sloped terrain.&lt;br /&gt;
&lt;br /&gt;
There are two options for providing foundation sprites:&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS not set ====&lt;br /&gt;
The callback should return a spriteset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:simple_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
The foundations will be drawn by combining multiple sprites, as needed for the slope.&lt;br /&gt;
&lt;br /&gt;
==== STAT_FLAG_EXTENDED_FOUNDATIONS ====&lt;br /&gt;
The callback should return a spritset looking like this:&lt;br /&gt;
&lt;br /&gt;
[[File:extended_foundations.png]]&lt;br /&gt;
&lt;br /&gt;
In addition you will have to check&lt;br /&gt;
* &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;getbits(extra_callback_info2, 16, 2)&amp;lt;/code&amp;gt;:&lt;br /&gt;
** 0: sprites as in template above.&lt;br /&gt;
** 1: sprites like before, but with no wall on NW edge.&lt;br /&gt;
** 2: sprites like before, but with no wall on NE edge.&lt;br /&gt;
** 3: sprites like before, but with no walls on either north edge.&lt;/div&gt;</summary>
		<author><name>Glx</name></author>
	</entry>
</feed>